当前位置:网站首页>Evolution of e-commerce development
Evolution of e-commerce development
2022-06-11 12:27:00 【log. Info (Xiao Lu)】
We System = Application service + Database storage
What kind of business does our system have What kind of service , How the corresponding data is stored , How a simple business uses higher technology
When many of our users come to visit , How to achieve higher scalability , How to achieve high availability of the system
How do we rate website size

Our service , External is a website ( for instance JD.COM TaoBao ), There are various internal micro services The underlying business is complex , Consider the capacity of these websites at this time , How to expand , When we use this technology Why use this technology What are the advantages and disadvantages of this technology
For example, the following

Based on Taobao 10 Flow chart for , Our application started like this , Directly package our project into war Put it in tomcat
step1
We write an application , He can connect db External services {
bs framework } It includes many functions For example, register to log in
All his functions are in one jvm The following implementation There is nothing in between rpc call even to the extent that db And the project are on the same server
When we have a lot of traffic This architecture has to change

step2 We can expand the capacity , Deploy 2 individual tomcat , utilize Nginx Do the forwarding , In this way, we can achieve Increase the throughput of the whole system But this brings problems It's distributed session Session problems
For example, your users A, according to nginx Fall on machine 1 On Well session Left at the node 1 Next time according to nginx Fall on machine 2 On , Such node 2 It's not session Of You need to log in again

be based on Distributed ession The conversation problem There are several solutions
First of all nginx Load balancing configure ip hash , According to the user's ip Conduct hash Then we can see that it falls into that node
The problem is that A single point of failure my Ip unchanged I will always be at this point
{
Suppose I this tomcat Hang up I can't place an order Because now my The service collapsed. }
There is also a waste of resources
There is also the neglect of the processing capacity of the machine for instance I want my machine to have good performance Handle more requests , Poor performance handles fewer requests
This is impossible

The way 2 session viscous

.. Now suppose our db The solution also solves , There are still problems with this scheme , When the traffic goes up, I have to add services
For example, the previous one tomcat node Now? 2 individual , It will cause a waste of resources
Than talking about double 11 Crazy orders , I just need to expand my single node , I don't need anything else, like logging in , register , Expansion of commodity modules
Join me. It's all taken apart Words I just need to add an order Nothing else to manage
Many business visits are not high But he also takes up resources

Next, I will split our single node service , for instance account number , Member services In this case , Dangshuang 11 When placing orders concurrently , I only need
Just expand the order node , And in every upgrade version , When the expansion goes online , I just need to package and launch the order module I don't care about anything else , all Service is a single responsibility

And then we split vertically according to functions , Some single services Put it on the next floor , Provide some business information , In this way, the current structure will be gradually formed , By business For example, member middle office , Trading Center , It can provide us with more intelligence Such application scenarios as business talk

such There are more services , More services ,1 A into N individual Between services Call dependencies also increase
For example, I place an order Check inventory , Check commodity Look at the marketing strategy Make payment I just order , I will call 4 A service , I used to follow the process from top to bottom , Not now All his services are remote Maybe the inventory is in Beijing , The goods are in Shanghai We have to use telecommunication , Telematics for instance dubbo,feign, Include http, Since it is telecommunication There will be a probability of packet loss , Because the network will jitter
Because I am calling synchronously Check the inventory first I'm checking the goods Look at marketing Finally, call payment to make payment
Can I make asynchronous calls for instance I'll pay first Then other inventory goods Marketing can be done slowly
Then there will be an asynchronous call I'll pay first , Then operate slowly ,

Also, distributed transactions For example, using seata Or use mq Use seata The bottom floor will be locked , Distributed transactions cost a lot of resources
It is possible that your throughput will not go up , We usually use mq To achieve final consistency ,
Generally, we will place orders asynchronously This way of message oriented middleware
We use the message center He can solve these problems But he also brings about these problems One is message repetition , Lost message idempotent There's a backlog of news
Message middleware Solved asynchronous decoupling Flow front elimination
The reason for network jitter is that there is no retry mechanism The message may be lost
The problem with idempotency is that I call you repeatedly The results you return are the same
For example, when I scan the code to pay Because of my network card , I swept it 2 Pass code How do I do Let the first successful consumption The second You don't succeed
If a message is lost, it will be retried Retries can occur many times Suppose we have already dealt with The second time we should not deal with

We can set a unique for each message Id For example, there is an order when placing an order Id, Now all kinds of mq There is also a message for sending messages Id
I handled it successfully I insert a , When I insert again , because id Is the only one that cannot be inserted repeatedly , I won't insert it the second time
The same logic as the de duplication table It can be used redis do
Status code I handled it successfully , I will change the status to 1 , The next time you insert it Must be in db Medium is 0 Words To insert If it is 1 You won't insert any more
There's a backlog of news , I process a piece of data and I put it in a table Insert A piece of data If this message records Every day mq Send hundreds of over a thousand What do I do I'm on my watch
Insert thousands of data
With the development There will still be a compatibility problem , We can go through feign,dubbo These make remote calls , It can be used redis,es For storage , however dubbo It's a company ,redis It's a company . Different companies make different products , But in the case of micro Services It's a whole set of solutions ( Include redis, dubbo these )
We need container deployment Devops docker k8s Continuous integration
Our microservices depend on more , If we use container deployment, the images we get can be used directly , You don't have to build it yourself, for example redis These services
Cloud native is a micro service + Operation and maintenance + Containerization Continuous delivery I will not affect the normal use of the website I can often go to iterative development

边栏推荐
- 14、课程总结与回顾
- flink 滚动窗口、滑动窗口、会话窗口、全局窗口
- ZABBIX installation and configuration application
- Record a CODIS memory cleanup
- C event bus
- 2. Completablefuture
- Format of Jerrys at protocol package [chapter]
- Redis data type Daily use Scenarios
- Splunk manually synchronize search head
- 12. AQS of abstractqueuedsynchronizer
猜你喜欢

How does data age in Splunk?

2、CompletableFuture

9、聊聊ThreadLocal

Is reflection really time-consuming? How long does it take to reflect 100000 times.

解决Splunk kvstore “starting“ 问题

Oracle 将数据导出到CSV(Excel)文件的方法

MCtalk创业声音丨博学明辨:兴趣社交,给退休前后老年朋友的「小而美」空间

Workload management of Splunk best practices

When a pure data service machine calls in, it falls back to 2g/3g

(recommended) how many splunks are appropriate? Search head
随机推荐
记一次 mysql 主从不同步问题排查
flink 时间语义、水位线(Watermark)、生成水位线、水位线的传递
7. CAS
9. Parler de threadlocal
flink 窗口表值函数
oracle删除用户后,却还可以使用该用户登录
Wechat applet startup page automatically jumps
Moist or not? This is a problem
C# System.Guid.NewGuid() 格式化
You call this shit MQ?
Format of Jerrys at protocol package [chapter]
Error occurred when MySQL imported the database data in pagoda as 0000-00-00 and enum as null
Harmonyos application development -- General app interface framework appgeneralframework[app general framework][api v6]
Flink time semantics, watermark, generated watermark, and transmission of watermark
flink 多流转换(侧输出流分流、Union、Connect) 实时对账app 的支付操作和第三方的支付操作的双流 Join
(solve) the kV store down problem of Splunk
Flink deployment mode and runtime architecture (session mode, single job mode, application mode, jobmanager, taskmanager, yarn mode deployment and runtime architecture)
Live app source code, and the status bar and navigation bar are set to transparent status
How does Wireshark modify the display format of packet capturing time and date?
flink 控制窗口行为(触发器、移除器、允许延迟、将迟到的数据放入侧输出流)