| In the age of Internet and cloud computing,e-commerce develops in a high speed,but offline retail profit decreases a lot.Retail stores attempt to change their business mode into O2O(Online To Offline).O2 O combines online and offline business together,which becomes the industry trend.There are three goals in researching and implementing an O2 O commercial system.Firstly,the system should support the complex business scenarios.Secondly,the system should support high concurrency and high availability so as to provide 7*24 hours' online service.Thirdly,the system should be cost-efficiency and easy to scale.O2 O is still in its primary stage of development,which lacks of abundant money investment.So we should lower the system's dependence of expensive hardware,cloud infrastructure,middleware and concern more about the scalability.Nowadays,retail enterprises such as Xujiahui retail store,attempted to upgrade their retail system to O2 O system.However,they only made some business upgrade and still use traditional architecture which has many bottlenecks.Firstly,the architecture of database cluster is a bottleneck.It uses the traditional three-copy Master-Slave schema,which has low performance of writing and limited data capacity.Secondly,the architecture of server cluster is a bottleneck.In the load balance cluster,the single active load balancer is a throughput bottleneck.Thirdly,there also exist lots of defects in core business system.It directly operates on database and has strict ACID transaction which is low performance.In this paper,we study to make some improvement of the system,on account of the above system defects.Firstly,we design and implement a high concurrency and high availability database cluster XFabric.We uses the scalable framework Mysql Fabric in XFarbic.It aggregates different shards and replicas of database based on their consistency.Besides,horizontal sharding,vertical sharding,reference cutting,cross shards joining,and read-write separation are also designed and implemented in XFabric.Secondly,we design and implement a high concurrency and high availability server cluster XCluster.We uses Supervisord to manage the server processes and uses a monitor machine to monitor all the servers.We design and implement a load balance architecture based on client connecting protocol.Servers' load information and requests' diversity are considered to implement the new load balance algorithm.Thirdly,we design and implement a high concurrency and high availability core business system XBuy.XBuy is developed based on the traditional order-stock system.We uses separated Redis cache,transaction degrade,stock's consistency guarantee and asynchronous queuing to increase concurrency and availability.In the end of this paper,we evaluate the performance and availability of the system through experiments.We compare the traditional system with the improved system.The experiment results indicate that the improvements on database cluster,service cluster,order-stock system are of great significance.These improvements enhance the concurrency and availability of the system and achieve the three goals mentioned above. |