-
Notifications
You must be signed in to change notification settings - Fork 18
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
Clarify ctor/Creation/Verification lifecycle #43
Conversation
see also related pre-discussion thread with @samritchie |
e05cdc4
to
a6515b0
Compare
@samritchie I ended up havig to put an ugly guard into FSharp.AWS.DynamoDB/src/FSharp.AWS.DynamoDB/TableContext.fs Lines 947 to 951 in 6423028
If you search for CreateOrUpdateThroughput in that file, you can see its relatively low impact, but I definitely don't like the the coupling that guard adds.Pending a commit now to remove it (checking if it makes sense to expose the Describe API, but I guess that's pretty debatable too...) |
2b403f1
to
60a166b
Compare
@samritchie Refactored to put my expose my semantics in The choices now from my perspective are:
I'm happy to do any more cleanup you think makes sense, as long as I wind up with some code (that does not involve that cut and pasting the retry loop!) to to pop into my provisioning impl in https://github.com/jet/equinox/blob/acccec32fabb27ec03b731a9a1c340fb341e3ae7/src/Equinox.DynamoStore/DynamoStore.fs#L472-L473 |
c93555e
to
54cbdd6
Compare
@samritchie I worked in support for OnDemand mode - the throughput argument for the new Initialize/Provision APIs is now a DU |
f4429fe
to
f9f6ddb
Compare
@samritchie added support for configuring Streaming mode to manage an Equinox feature. High level:
In each of the above cases, you want to achieve a desired state, which means you need to
The exact way in which the |
@samritchie I've topped and tailed this and can't think of anything else significant I need in the context of jet/equinox#321 so am happy to clean up as you see fit now |
a8bb3fb
to
d72d9d2
Compare
@bartelink I'll make some time tomorrow to pull this branch and have a good run through. One of the main things I'm trying to work out is GSI provisioning - currently GSIs are set to the table provisioning levels on Create, but not modified on Update (I don’t think you’ve changed that). GSIs will often have the same write capacity and a different read capacity to the table. This is going to be a really low usage feature though, maybe it’s enough to offer the |
Thanks @samritchie I've just completed local testing now and it's happy (I had a flipped condition in the I have no immediate plans to use GSIs so definitely can't help beyond agreeing that yes, having it provisioned as per the actual table smells.
If you actually had a plan ;) |
@bartelink I had a bit of a go at the new initialisation APIs including some testing on a real account. Some of the notable behaviour I found with cloud Dynamo was:
The upshot is I'm not sure how useful/usable it is to update provisioning on an existing table as part of table initialisation - ie Initialising a context via constructor then VerifyAsync/InitialiseAsync definitely feels more painful to use from code (for people currently using those options) - I guess the gamble is the majority of people also found it as useless as I have in a real-world application. Hopefully the comments on the obsolete I know I complained about ambiguous use of the term 'Create' but I'm wondering if |
Right, have implemented as above - let me know your thoughts on how to proceed on the open conversations and I'll get to them asap... |
Apologies for the confusion re those breaking changes (which were intentional on my part, even if in retrospect pretty ill-judged 😊) @samritchie I've integrated with Arguably #35 should be re-opened? (I had intended to remove the resolves ref to it in the overview of this PR after our discussion there regarding the need to provide mapping for epoch times re TTL) |
Replaces
TableContext.Create
and associated APIs with a clearer set of APIs that facilitate better separation of what I see as multiple phases of processing, depending on how one deploys one's app (informed by how Equinox's tooling and conventions separates this in larger applications).The split is:
TableContext
with the assumption that the underlying table and requisite indexes are in place (without any external calls), via the constructorVerifyTableAsync
to check that thetableName
specified by the constructor is in place and has the correct indices in place (Scripting.Initialize
combines this step with the constructor for scripting scenarios). Does not create a table; throws if there is a problem. Should ideally only be called once per process startup.VerifyOrCreateTableAsync
- as perVerifyTableAsync
but will create the table if it happens not to be present. For small single EXE apps, or test scenarios, calling this once on startup may make sense. Can also be used from separated configuration logic; useful for any application scenario where the creation of tables is something that is managed via a configuration phase of a deployment strategy (DDL vs DML separation in SQL DB tech parlance)UpdateTableIfRequiredAsync
- can apply adjustments to Provisioning or Streaming configuration via theUpdateTable
API if the table's configuration is not as specified. Used to implement Equinox's CLI tooling wrt establishing and/or changing throughput an/or streaming configuration.resolves #35