equinox icon indicating copy to clipboard operation
equinox copied to clipboard

feat!(CosmosStore): Azure.Cosmos 'V4' support / enable mocking Cosmos APIs

Open bartelink opened this issue 4 years ago • 4 comments

Takes master (which uses Cosmos SDK v3 (Microsoft.Azure.Cosmos) + makes it use V4 (Azure.Cosmos)

The diffs are fairly large between current master and the base of this PR; main reason being that Equinox.CosmosStore has cherry-picked the usage of System.Text.Json, leaving only two interesting facilities:

  1. using the stillborn Azure.Cosmos package
  2. introducing some mocking support, which I don't believe anyone has a use for
  • [x] port logic
  • [x] port to System.Text.Json
  • [x] Merge #202 (which pushes some code in here out to https://github.com/jet/FsCodec/pull/38)
  • [x] Merge #203 (@ylibrach's Client Abstractions work)
  • [x] Merge #206 (@ylibrach's Unfolds Compression flag)
  • [x] #208 Address failwith "TODO" re eqx dump functionality
  • [x] #208 Review Internal things like Gateway and other such policy tweaks with a view to aggressively removing and/or de-emphasizing things in V1/V2 that are not being actively used
  • [x] #216 Rename to Equinox.CosmosStore (with CosmosStoreConnection/Context/Category)
  • [x] https://github.com/jet/FsCodec/pull/48 provide path to map between FsCodec.SystemTextJson and FsCodec.NewtonsoftJson
  • [x] release FsCodec.SystemTextJson beta so we don't end up having a beta release depending on an alpha of something
  • [x] Remove CancellationToken parameters
  • [ ] @ylibrach renaming Equinox.CosmosStore.Core.ContainerGateway to CosmosContainerAdapter and any other desired changes
  • [ ] @bartelink to release next alpha and validate on a branch in dotnet-templates
  • [ ] ~Investigate RU consumption discrepancies first observed in #144 - atm there can be a 10% RU consumption increase, which seems (NOTE: wild speculation) to correlate with a lack of anticipated perf improvements when dealing with large spans of small events~ [master now as correct RU consumption using V3] now has correct RU consumption(https://github.com/Azure/azure-cosmos-dotnet-v3/issues/616#issuecomment-629813295), so there's reason to believe that this will eventually be righted in the V4 SDK too
  • [ ] 🤔 Consider holding off until V4 reinstates Checkpoint and ChangeFeed Batch Context information
  • [ ] Port skipping cert validation for emulators (done for V3, not possible in V4 yet)

bartelink avatar Feb 19 '20 03:02 bartelink

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Mar 03 '20 15:03 CLAassistant

🎉 Marking this ready for review; @ylibrach's hard work has reached a point where it's ready for much broader review.

Looking for comments regarding any significant problems triggered by breaking changes in this - we'll release a set of .alpha NuGet packages to enable test driving shortly

bartelink avatar Mar 19 '20 18:03 bartelink

@ylibrach I can cut an alpha.4 any time (I'ver merged in usage of the non-alpha release of FsCodec.SystemTextJson: v 2.1.0), but ideally you'd slip in naming changes etc you want to include

bartelink avatar May 10 '20 02:05 bartelink

Status update: This is parked for now, pending resumption of releases of V4 codeline from MS) a188f69 Presently, major features that were developed here are being cherry-picked onto master (which, for now, uses the Microsoft.Azure.Cosmos aka V3 API).

It's unclear at present whether the first non preview/rc Equinox.CosmosStore release will ultimately use Azure.Cosmos or Microsoft.Azure.Cosmos; the intention was and remains to move straight to V4 rather than forcing a transition (and/or the need to consider conflicts where codebases already use Microsoft.Azure.Cosmos) on consumers if it can at all be avoided (the OP details the concerns in more depth)

bartelink avatar Oct 01 '20 22:10 bartelink