| To Resolve the problem of the traditional MVC pattern that modeling and design and implement around the database, this article will design a extensibility system via Command Query Responsibility Segregation + Even Sourcing pattern(CQRS+ES), that make it is possible to handle the special scene, Mobile Internet, to provide a high usability and robust service. And the service will be supplied to client of different types with unique business logic but different style data via RESTful like Web API.This article starts from implementing a system based on CQRS+ES architecture, considering replacing the transactional consistency by eventually consistency to increase the throughput of the system; decreases the coupling among the domain entities via communicating with command and event mechanism, meanwhile it provides the entry point for extending system; implementing event sourcing with event store for saving and reloading the non-flat domain entities; publishing the Web API by using RESTful style for compatible calling from difference platforms. In the last, testing the system to verify correctness and performance of the system. |