A very common e-commerce business is selected for SpringCloud Alibaba’s actual combat.

Of course, in order to learn from SpringCloud Alibaba, the business has been greatly simplified. Here, only a simplified version of users can place orders.

1. E-commerce business process

Order business flow chart of e-commerce system:

This process has also been simplified. After browsing, you may not place an order directly, but add it to your cart first. We have omitted this step.

Next, we need to refine the business, which can be refined using a sequence diagram.

2. Timing of inventory withholding

Notice that in our swimlane diagram, inventory is withheld after the user places an order.

In the e-commerce system, there are two main ways to deduct inventory:

  • Order withholding inventory: Order withholding inventory is a better way for users to experience, so as to avoid finding inventory shortage when users pay. The disadvantage is that it is not suitable for a situation where there is a limited inventory of goods, because an unpaid order will affect other people to buy the goods.
  • Payment withholding inventory: Payment withholding inventory is not good for the user experience, as users may find that they are out of inventory when they make a payment. However, it is more suitable for the second kill type of business, to avoid the backlog of unpaid orders.

However, a timeout period should be set for ordering inventory reduction. If the payment is not completed within a certain period of time, the inventory should be released in time.

zai

3. Division of e-commerce business process modules

Through the above sequence diagram, we have a clear understanding of the business of e-commerce ordering. Next, we divide the specific business modules:

  • 1. User module: there needs to be a user service for the management of basic user information, including user name, level and so on.
  • 2, commodity module: users browse commodities, there needs to be a commodity module to support, to show the user the introduction of commodities, prices and other information.
  • 3. Order module: Users need order module to create orders.
  • 4. Payment module: After the order is created, the user needs to pay. There needs to be a payment module to realize the payment function.
  • 5. Inventory module: after the payment is completed, the operation personnel need to deliver goods. In this step, the inventory quantity of corresponding goods needs to be deducted, so there should be inventory module.

Of course, the real business is much more complex than that, and we only consider a simple user-ordered business, so these are the main business modules.

We use the service division method of vertical division, with obligation as the dimension, to divide the service.


“Do simple things repeatedly, do repetitive things carefully, and do serious things creatively!” –

I am three points evil, can call me old three/three minutes/three elder brother/three son, a full stack of literary and military development, let’s see next period!



Reference:

[1] : Small column SpringCloudAlibaba micro-service practice [2] : How is the e-commerce system designed?

[4] : Detail: Design of e-commerce front-end inventory logic