Azure CosmosDB, AWS DocumentDB, MongoDB — NoSQL databases support in .NET Core e-commerce platform

GrandNode
2 min readJun 8, 2021
Azure CosmosDB support in GrandNode 2.0

How it was possible?

First of all, GrandNode 2.0 and its architecture gave us the possibility to support also other database systems.

The main task was to avoid every reference to MongoDB driver in the solution. We wanted to keep only the real, important, and required references, for example in the MongoDBRepository.cs file.

There are many reasons for this. But most of all, this approach guarantees us independence and flexibility. With very few changes, we are able to support other database engines.

How did we add support for the AWS DocumentDB database?

AWS DocumentDB support was possible to achieve after enabling the installation process without chosen Collation. We provide a way to install with “none” collation.

Secondly, as AWS DocumentDB doesn’t support the decimal128 data type, we were forced to change it in GrandNode and use double type.

That’s all. You can use AWS DocumentDB in your store.

How did we add support for the Azure CosmosDB database?

The process of adding support for Azure CosmosDB was a bit harder, however, it also wasn’t a big challenge to solve.

Instead of previous problems, that had been solved during the AWS DocumentDB implementation, we had to make something with the index creating process.

You can look at one of our commits that were pushed during the CosmosDB implementation.

Performance

We haven’t made a performance comparison yet, however, there is a slightly visible difference during the installation process.

Azure CosmosDB installation seems to be much longer than on AWS DocumentDB and MongoDB.

During our short tests after sample database installation, we saw that there is a similar level of performance on each of the databases. With a slight advantage in favor of MongoDB.

Next steps for us

We need to think about the installation process on Azure CosmosDB. We noticed that the installation process is way too long to be on the acceptable level. We have some thoughts on it, however, further improvements will be introduced later.

Our next goal is to give a hand to smaller businesses that don’t need the database server. In that case, we aim for LiteDB support.

LiteDB is a simple, fast and lightweight embedded .NET document database, LiteDB is fully written in C#. It’s free and open-source.

Our GitHub: https://github.com/grandnode/grandnode2

Feel free to download the beta version of GrandNode 2.0.

--

--

GrandNode

More than just an e-commerce platform. GrandNode is the most advanced e-commerce platform at the market. Unbelievable? See for yourself!