sebastienros / yessql

A .NET document database working on any RDBMS
MIT License
1.19k stars 197 forks source link

Cosmos DB support #118

Open jersiovic opened 6 years ago

jersiovic commented 6 years ago

Hi,

I'm planning to start a new project using Orchard Core. However I'm worried cause at some point if we suceed it is possible for maintaining the system performance we need a sharding strategy for handling the amount of data we will store on Orchard db. As far as I know Cosmos DB is a distributed db that guarantees transparently the level of performance hired for a container or set of containers creating the number of partitions it needs. So, the question is do you plan to support Cosmos DB at Yessql? If not. Do you think it is sth that has any sense and it is sth feasible?

A problem I see is no client transaction scope can be used with the .NET SDK. It has to be done on the Azure Cosmos DB server via stored procedure or trigger.

Thank you, .... I'm happy to come back to Orchard :)

sebastienros commented 6 years ago

RDBMS supports sharding. You should try it maybe (SQL Server, Postgres, MysQL).

YesSql requires SQL for most of its implementation. It's not even abstracted. Not sure YesSql would be of any help then compared to Document databases like CouchDb or MongoDb. Maybe CosmosDB's API might even be better.

jersiovic commented 6 years ago

I thought it was a more expensive solution for RDBMS, but I should make numbers and tests before taking a decission. Thank you.

Well this samples using sql api for Cosmos db looks promising for using SQL implementation from YesSql. https://github.com/Azure/azure-cosmosdb-dotnet/blob/d17c0ca5be739a359d105cf4112443f65ca2cb72/samples/code-samples/Queries/Program.cs#L140-L174

YesSql is also the abstraction for accessing data used by Orchard. So, to have a CosmosDB implementation of YesSQL is worth for Orchard or any other software using YesSQL because expands the number of databases to which that app can be switched without changes

jimitndiaye commented 2 years ago

I know this issue is quite old but has anything changed regarding this situation with Cosmos DB support for YesSql and Orchard Core? We're interested in cosmos support for various reasons but price and georeplication are the main ones and thus would love to see support for this scenario assuming that Cosmos' SQL API supports most typical queries from YesSql as abstracted by EF Core. Or does YesSql go directly to the underlying SQL connection rather than via Efcore?

sebastienros commented 2 years ago

YesSql doesn't use EFCore at all. It uses Dapper and raw queries.

jimitndiaye commented 2 years ago

I thought that might be the case. That would be a show stopper right there considering how entrenched YesSql is within Orchard Core (with good reason obviously) - I should clarify that my main interest is Orchard Core and only incidentally YesSql due to the latter having it as a dependency. How feasible would a CosmosDb provider be for YesSql? The SQL dialect seems pretty close to TSql with some nuances. The main stumbling block might be that the connection mechanism is not based on IDbConnection like the other YesSql providers.

sebastienros commented 2 years ago

Not a chance it works. It's using DbConnection all the way. And there will be some sorts of queries that CosmosDb won't support for sure.