Comments (8)
I can't see a case where you would want this library to be the single point of truth for defining a table structure.
The single point of truth should be the cloud formation, and this library should conform to that definition - not the other way around.
Imagine your above scenario, where your infrastructure team wants to implement streams off of the table for auditing concerns, or implementing point in time backup, or anything else that dynamodb can do.. This has nothing to do with the application your development team is creating, but they would have to:
- Ensure this library supports it, and if not implement it
- Code it into the application.
Would you advocate that this library implement the functionality to expose this?
Maybe your dev team is no more and you only have an infra team? So now we have to stand up a project for this and hire developers.
Maybe there is a case for deriving dynamo-toolbox from cloud formation, but definitely not the other way around.
I'm interested to hear your use cases but I just can't find any myself.
Cloud formation is a very powerful tool which this library shouldn't be (and isn't) trying to replace.
from dynamodb-toolbox.
@darbio interesting thoughts, It now sounds like I was driving myself in wrong direction, then may be dynamodb-toolbox should allow importing existing schema instead of exporting it. However my point still stands (was inverted) 😛 we need single source of truth. Thanks.
from dynamodb-toolbox.
I think this is YAGNI. It takes 2 seconds to write a YAML on table definition for Dynamodb.
from dynamodb-toolbox.
@darbio you are right, but dynamodb-toolbox table config and actual table schema can get out of sync very easily, I think It is a good idea to have dynamodb-toobox export schema and use that when provisoning table usign cfn. (ps. single source of truth for table schema)
from dynamodb-toolbox.
Which bits get out of sync?
Once you have your basic table definition (pk, sk and gsi's) adding more gsi's is a simple addition to the cloud formation.
Having it as an explicit step makes you think about why you are adding the gsi.
A table that has just one gsi can support many access patterns. I'd be making sure I was thinking really hard to justify adding further gsi's before I did it...
from dynamodb-toolbox.
@darbio Yes agree, but there dynamodb-toolbox table schema stills lives separately to actual table definition. There are chances that one might forget to update other. Or to be more specific, imagine a case where there are different teams managing ops and actual server code, having dynamodb-toolbox export schema can simplify things for both teams, as ops team can simply rely on table schema exported by dt table.
But it's just an opinion. I would personally like to not repeat myself, even if it is just couple of GSIs and primary keys. 🙂
from dynamodb-toolbox.
Seeing as CFn is either JSON or YAML it shouldn't be too hard to parse this in your code and load the table dynamically, if you really think it's worth the effort, maintenance and computational overhead, for something that shouldn't change much (if ever in a minor version bump).
I'd suspect that the time might be better spent coding business value rather than SPOT nirvana.
from dynamodb-toolbox.
right may be this should be marked low priority then, good to have but not something we need rn.
from dynamodb-toolbox.
Related Issues (20)
- Overlays break many constructor inputs HOT 1
- Error when importing abstraction that uses dynamodb-toolbox HOT 1
- Bug on Item.get, where unneeded properties are required HOT 2
- Error when sending EntityV2 `GetItemCommand` with property of type `binary()` HOT 3
- Undefined dependencies for Index keys cause Update / Put failures
- Recent versions do not run onDefault if dependsOn contains undefined parameter HOT 2
- Got Error: Please provide a valid entity definition HOT 2
- Created is changing with puts and is always the same as modified HOT 1
- Is `transform` valid for partition key? HOT 2
- Unable to convert date string to JS Date instance
- getting error for formatter.missingAttribute when using computeKey function to build pk and sk HOT 3
- Unable to save null values in V1 HOT 9
- Type inference for query responses with multiple entities HOT 3
- V1 Migration BatchGetCommand type mismatch HOT 5
- Suggestion: date() type HOT 3
- DeleteItemCommand getting empty input for computedKey HOT 4
- Cannot define index with only `partitionKey` in v1.1 HOT 3
- Application built with esbuild possibly broken after `experimentalDecorators` was activated HOT 4
- $add signature for Sets not matching documentation HOT 2
- EQ operator missing from Range Conditions HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dynamodb-toolbox.