We have a large news-oriented site that has high web traffic. The architecture is your often seen DB - Repo Layer - Services Layer - Asp.Net MVC. The problem that we've been seeing is around read performance. It turns out that all this DDD domain object stuff is great, in theory, for business rules, but has made life harder when it comes to optimizing read performance.
As a solution, I'm considering something entirely new (for us): using noSQL. I'd like to use a noSQL database for data being presented on our website. We can't get rid of our SQL Server (at least not anytime soon), but it seems to me that a practical step would be to use Mongo as a query database for all new development.
My question is whether it is possible to use SQL Server as your database of record and Mongo as your query database together and if so, what technology/technique would you use to update updates? I'd like Mongo to be refreshed ever 15 minutes.
2条答案
按热度按时间wdebmtf21#
I suggest to take a look into cqrs (Command Query Responsibility Segregation) pattern that was initially introduced by Greg Young . Also you can read here .
This approach involve to have two databases: read and write. Write database is used as primary write store and read - database for querying. Read database can have denormalized data. For example if you have article you can embed author information in it as well for quick display on ui. And in general nosql database good fit for read storage.
In your case primary normalized database can be in sql and read database can be in mongodb.
In general this approach good fit for high traffic systems. There is open source implementation of it -- ncqrs .
Also this approach in roadmap of microsoft for 2012 year.
from me: I am using this approach more than one year and giving to it my personal vote up.
to94eoyn2#
Migrating to a database like MariaDB Enterprise (on-prem or in the cloud through SkySQL) could be an interesting option to evaluate. MariaDB has multiple pluggable, purpose-built storage engines configured per table and with cross-engine join support (joining tables that use different storage engines). Some (but not all) of these engines are:
Here you find advice on how to choose the right storage engine: https://mariadb.com/kb/en/choosing-the-right-storage-engine/
There is also MariaDB Xpand which almost linearly scales reads and writes while keeping ACID compliance, and MaxScale, a database proxy that enables automatic failover, read-write splitting, transparent masking, exporting and importing database events to and from Kafka (CDC), and even use MariaDB as if it was a MongoDB database (you can connect an application that uses MongoDB drivers and store the data in MariaDB instead of MongoDB itself which allows you to join data from MongoDB apps with data in relational tables using a single SQL sentence).