Objective
Some time ago the company took the e-commerce site of the live database and architecture design, but the boss finally ran, and now take out to share.
Architecture diagram
One. File server
Use azure Storage Blob to store picture files so that clustered servers can share pictures and facilitate server migrations.
Two. Distributed Memory server
Use Dache to provide a distributed memory service that caches session and commodity information through a memory server.
Dache:https://github.com/ironyx/dache
Three. Database Master-slave replication
Use RAVENDB as the master-slave replication for the database, ravendb the master-slave replication of different general database, the first time to read the database from the main library, the second from the secondary library read and so on,
Write to the database, is to write to two databases at the same time, the maximum to avoid inconsistent data, can also be configured to read-only and write-only, as well as search performance needless to say, ravendb is dependent on Lucene.
Four. Database Task queue
SQL Server as a queue server, improve indexing speed, the task to join the queue, and then use the background server for timing processing, such as click on a product, to record the user click, when clicked, click on that item,
We can say that they join the queue, the background server timed processing such as 05:00 at night to batch import database, reduce data pressure.
Database Queue Description: Http://www.oschina.net/translate/building-high-performance-queue-in-database-for-storing-orders
Five. Background server
use the background server for task scheduling and Mail queue processing .....
Six. Sample code
Based on DDD architecture, Vnext 1.0.0.beta4 version, only partial functions are implemented
Download: HTTP://PAN.BAIDU.COM/S/1I3S3WKL
E-Commerce website structure