Php architecture is often asked how to improve the concurrent writing of the database, how to answer?

the bottleneck of a project is generally the database, because the machine bottleneck can be solved by load balancer and many machines, and the bottleneck of database reading can be solved by multiple slave libraries, but how can concurrent writes be improved? In particular, what about those that need to get the insertion results immediately and cannot be solved with message queuing?

Mar.28,2021

some personal opinions: (any language is similar, my side is Java)

omitting part of the previous content is, after all, a relatively simple process of evolution

We make session into a session server. Browser1 requests the server through load balancer. The server stores the session information in the session server and does it in reverse when you want to get it. (disadvantage: at present, session Server is a single point, how to solve a single point to ensure availability)

Session ServerSessionwebsession

SlaveORMORM

I/OCNDCDN

:

:

UserUsers1Users2

SQLUsers1Users2NoSQL

of course, there are still some problems with the above architecture, such as the load balancer server is a single point, so you can also cluster the load balancer server for master-slave hot backup, and make an automatic switching solution at the same time.

process: security, data analysis, monitoring, anti-cheating.
continue to develop: SOA architecture, service, message queue, task scheduling, multi-computer room.

Menu