Answer the question
In order to leave comments, you need to log in
How to handle parallel requests to the online store?
To learn PHP and SQL, I am making a simple online store from scratch.
The database has already been designed and the script for its creation has been written.
There were questions about handling both HTTP requests and database requests.
Created two users in the database, a store visitor and an administrator. The PHP script connects to the MySQL server. Depending on who has entered the site, one or another user is connected.
Question 1. What happens if two visitors connect to the database? Could this be? Can PHP scripts run in parallel? Is it possible to connect to the database in parallel using the same database user?
Question 2: If concurrent connections can occur to the database, how can I synchronize access? For example, readers (visitors) view products, and a writer (administrator) updates prices or adds a new product. Need to apply transactions or locks? Or transactions with a certain lock level?
Answer the question
In order to leave comments, you need to log in
What happens if two visitors connect to the database?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question