Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 3.0 Planning #1040

Closed
55 of 69 tasks
fishcharlie opened this issue Nov 22, 2020 · 15 comments
Closed
55 of 69 tasks

Version 3.0 Planning #1040

fishcharlie opened this issue Nov 22, 2020 · 15 comments
Labels
Milestone

Comments

@fishcharlie
Copy link
Member

fishcharlie commented Nov 22, 2020

Version 3.0 Planning

The time has come to start thinking about what the next version of Dynamoose will look like.

Overview

v3.0 is planning to be pretty light in terms of breaking changes compared to v2.0. The main priority for v3.0 is to get an extremely solid foundation to be able to iterate on for a long time to come. I envision all future major versions of Dynamoose to include maybe 1 or 2 breaking changes that are relatively minor in scale. The goal is for this to be the last major version that requires any type of substantial changes to users codebases to get working with the new version. I also envision future major versions of Dynamoose to possibly take place more frequently due to the smaller amount of breaking changes that will occur.

This really includes things like solidifying the concepts of Dynamoose. What does a Model really mean? What should be the behavior of defaults? What does set mean (ex. should it occur before or after type checking, etc)? Lots of foundational questions like that I hope users will ask and discuss as part of our v3.0 process.

Goals

Alpha

Beta


  • Plugin Support
    • Need to figure out how this is going to work with TypeScript
  • Allow for schema and model prioritization to be impacted by validate methods
  • Consider changing rangeKey and hashKey to not be settings of the property but instead be settings of the model (or table in v3)
  • Add more functions to dynamoose.Table
  • Look into more single table design improvements
  • Drop native callback support and encourage users to use util.callbackify as an alternative?
    • After considering this more, I don't think this is going to happen in v3.
  • [BUG] Schema set function is not called #977?
  • Take TypeScript out of beta? (Will be easier if we move to Jest and write tests in TypeScript)
  • Throw warnings for invalid settings (ex. timestamps on Model settings). Need to make sure this is compatible with plugins.
  • Disallow Model's having multiple schemas
  • Consider removing dynamoose.UNDEFINED. This could be handled by having delete obj.a have different behavior than obj.a = undefined. We can check this by using obj.a === undefined and obj.hasOwnProperty('a').
    • This can't be done due to how update works. There is no way to pass in a single object and determine between reverting to the default, and using removing the property.

Timeline

  • Discussion/RFC/Proposals - Now
  • Development Starts - Now
  • Beta Release - TBD
  • Final Release - TBD

Blockers

FAQ

How can I submit ideas/goals for v3.0?

Create a new issue and include v3.0 right after the ] in the issue title. Make it clear it's a proposal for v3.0, and I will add it to this issue Goals section above. Your issue you create is where discussion will occur about the proposal.

How can I support v3.0?

Right now, submit feedback! What would you like to see in v3.0? If you could have complete control over Dynamoose and could break everything to make it work better, what would you change? No ideas are off limits here. Even if I shot down an idea in the past because it was a breaking change, now is the time to bring it up again.

As this process moves forward, the ways you can support v3.0 will change. This will include submitting PRs, testing beta versions, etc.

I have an idea for v3.0, but I'm not sure if it's good.

Follow the steps above for How can I submit ideas/goals for v3.0?! Even if you are unsure about it, it will lead to discussion which will benefit Dynamoose.

What does the timeline look like for v3.0?

This is definitely a 2021 project at the earliest. The reason I'm starting discussion now is to keep breaking changes organized. I also want a very extended period where users can comment on ideas for v3.0. Right now, I don't anticipate development starting in 2020. However this could change and I might decide to start minor development in late December.

Can I submit PRs for v3.0 right now?

Yes! Feel free to submit PRs to the v3 branch. It would be a good idea to comment here and tag me so I'm aware and don't overlap with your work.

@cko-moho-khaleqi
Copy link

AWS SDK v3 is out for node

@fishcharlie
Copy link
Member Author

@cko-moho-khaleqi Yep! Had a few blockers with it so kept it on there. Haven't gotten a chance to investigate resolutions that I was given yet tho.

@HuEric
Copy link

HuEric commented Jan 31, 2021

Really neat planning, great work so far from @fishcharlie and all contributors ! 👏
After watching this re:Invent Data modeling with DynamoDB video, I'm looking forward to single table design feature as it's the one of the most efficient ways to use DynamoDB.

@fishcharlie
Copy link
Member Author

@HuEric What exactly are you hoping for here? It's important to know that everything in that video is possible with Dynamoose today. Big difference between single table design feature and Look into more single table design improvements.

I'd love to hear more about what you are looking for here.

@HuEric
Copy link

HuEric commented Feb 4, 2021

Sure !
What I'm looking at now, is a way to handle multiple schemas when querying one table, like inside RestaurantTable, I would like to have as results Restaurant + Order.
It seems like we are kinda locked into one schema when making queries.

@fishcharlie
Copy link
Member Author

@HuEric That is totally possible right now. When defining your model, just set an array of Schemas, one schema for Restaurant and another for Order. Then in your model you'll just have both of those schemas as an array for the schema argument.

Then when making retrieving or saving documents, it will automatically determine which Schema to use depending on the data in the document.


The major improvement we are looking at adding for v3 is changing the idea of a Model to represent an entity or type of data (examples: Restaurant, Order, Person or Movie). Currently, a Model represents a Table in DynamoDB. In v3 we are going to consider changing a Model to represent that entity or type of data.

@HuEric
Copy link

HuEric commented Feb 4, 2021

Thanks @fishcharlie for clarifying it !
As I didn't see any mention when reading the documentation, I assumed (wrongly) that there is no way to make use of several schemas inside a same table with Dynamoose.

@fishcharlie
Copy link
Member Author

@HuEric https://dynamoosejs.com/guide/Model

You can also pass in an array of Schema instances or schema objects into the schema paremeter. This is useful for cases of single table design where you want one model to have multiple options for a schema. Behind the scenes Dynamoose will automatically pick the closest schema to match to your document, and use that schema for all operations pertaining to that document. If no matching schema can be found, it will default to the first schema in the array.

@fishcharlie fishcharlie mentioned this issue Mar 13, 2021
23 tasks
@fishcharlie
Copy link
Member Author

I'm looking for volunteers who want to help with Dynamoose v3. This will include the following responsibilities:

  • Reviewing and testing pull requests
  • Providing feedback & suggestions on API/breaking changes
  • Testing v3 with your own codebase to help us catch bugs/problems early
  • Being able to answer questions about how Dynamoose is being used in your applications to help guide the development process
  • Responding to GitHub comments when you are tagged

My only expectation is that volunteers are active in responding to discussions or questions when tagged, and that you put in effort into testing v3 in your own codebase.

This is a great way to get involved in Dynamoose and ensure it continues to remain stable for your codebase without the responsibility that comes with being an active Dynamoose collaborator.

Please message me or post here if you are interested in helping and I'll start tagging you in PRs and discussions related to v3.

If for whatever reason you are unable to continue being active in v3 discussions, please ping me and I will remove you from the list of volunteers I tag in v3 related updates.

@simlevesque
Copy link

simlevesque commented Sep 11, 2021

@fishcharlie I'd be interested in helping you with this. Feel free to message me at any time.

edit: I have an internal fork in a codebase at work so I have some idea of what's inside.

@fishcharlie
Copy link
Member Author

@simlevesque All for the help! Next step is getting #1219 merged in. I just left a comment on that PR for what else needs to be done. Although you don't have write access to it, you could branch off of that branch, make the changes, and submit a different PR that merges your work into #1219.

The other tasks that someone could work on currently (without much interference) include:

  • Merging master branch into v3 branch
  • Fix website deployment error (run npm run site:build from terminal)
  • Add dynamoose.Type.Constant() helper method to easily create constant types (likely a function that takes in a value, and returns an object like: {type: {value: "Constant", settings: {value: /* VALUE PASSED IN*/}}})
  • Add dynamoose.Type.Combine() helper method to easily create combine types (same as above but for the Combine type
  • Rename dynamoose.NULL to dynamoose.Type.Null
  • Rename dynamoose.THIS to dynamoose.Type.This

Then of course just fixing any issues in general on this repo, helps free me up to work more on v3.

@simlevesque
Copy link

I'll see what I can do ! give me like a week

@fishcharlie
Copy link
Member Author

@simlevesque If you happen to work on #1219, please do me 2 favors:

  1. Create small PRs and submit often (don't want you to have a lot of pending work)
  2. Watch the PR comments (ie subscribe to the PR and watch it closely).

Reasons for this is that I might have time to work on it soon (not sure yet tho). So don't want you to be doing work and have me come in and finish it up, rendering your work useless. I'll be sure within the next week if I work on it to comment on the PR tho.

Not sure if that is a concern, but the more communication and less pending work, the better.

Let me know if any of that is a problem.

@simlevesque
Copy link

No, none of this is a problem. I can let you know what I'll work on. I guess I'll start from the top of your list.

@fishcharlie
Copy link
Member Author

Closing in favor of the v3 milestone.

@fishcharlie fishcharlie unpinned this issue Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants