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.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e43e04-4301d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e43e04-4301d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?