yevhen / Streamstone

Event store for Azure Table Storage
Other
395 stars 64 forks source link

Support for drop in replacement using DocumentDb/CosmosDB #35

Closed andrejohansson closed 6 years ago

andrejohansson commented 7 years ago

Document DB have now been renamed to Cosmos DB and according to the documentation it should be able to act as a drop in replacement for Azure table storage. It sounds like if this is true, it should be a trivial matter to add suppport for it?

You need to use the new Azure Preview SDK in order to get the features to connect to Cosmos but the api should be compatible with the existing storage Api. See

References

yevhen commented 7 years ago

I think we first need to finish the work started on porting to .NET Core and then it will be easier to add support for latest AzureSDK (CosmosDb).

andrejohansson commented 7 years ago

@yevhen I see that the nuget package now builds for netstandard, doeast it mean AzureSDK can be added now? :-)

yevhen commented 7 years ago

@andrejohansson I think so. Do you have vision on how best to proceed with that? We can discuss the approach and I'll surely accept PR? ))

andrejohansson commented 7 years ago

For a brute force approach, I just wanted to try to replace it and se if something starts at all.

I´ve tested the following:

As for vision, the main reason for me for preferring to use Cosmos is that I'm hoping to use more advanced features (better query language, triggers etc). But I'm unsure of what will be available. Have to try atleast!

yevhen commented 7 years ago

I don't want to switch (replace) WindowsAzure.Storage dependency to CosmosDb. The vast majority of SS users use the former. I'd like them to co-exist. I think it would be better to create another package like Streamstone.CosmosDb for that.

I see it like this:

  1. Create second set of project files which do reference CosmosDb. So in every folder there will be XXX.CosmosDb.proj (Example.CosmosDb, Streamstone.CosmosDb and Streamstone..CosmosDb.Tests). Change output dir to bin\CosmosDb to prevent binary conflicts
  2. Create second nuspec with dependency on CosmosDb
  3. Extend build script so that it creates Streamstone.CosmosDb package.

But sure, first to figure out why it doesn't work ;)

yevhen commented 6 years ago

I believe we can close this one. Check out this announcement https://azure.microsoft.com/blog/announcing-the-general-availability-of-azure-cosmosdb-table-api/

It means to take advantage of CosmosDb only connection string need to be changed. No need to switch SDK

andrejohansson commented 6 years ago

Nice! Hoping to get time to try this out soon.