S
S
Sasha2015-08-13 17:51:00
PHP
Sasha, 2015-08-13 17:51:00

What is the best way to design or what do you use?

How to handle large amount of dynamic data.
For example, let's take a store that has the opportunity to postpone the goods (book).
This store consists of: (2-3 stores + warehouse) maybe more "not the point"

Таблица:count
(id| shop1| shop2| shop3| sklad| reserve| well)
( 1|     3|     0|    11|     1|       5|   10)

This will store the number of items in each store and warehouse, the reserve and everything available (.
Now the most difficult thing, you need to somehow collect and process all this, the difficulty arises when you book 2-3 goods by a crowd of users. How to deal with this "Use radishes" is not suitable. It will turn to php, the load is large, if only through js.
And then send, but it will work if there are 100 users, and if 1000000, for any reason, an error will occur, you need to freeze the value of the cell being changed (so that mysql has such an opportunity, but here again there is a problem, a big queue, there will be brakes.)
In advance, I took an online store as an example to explain the problem, I can come up with another example if someone does not like it, but this is demonstrative.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
OnYourLips, 2015-08-13
@OnYourLips

Table: count
Built incorrectly. Will you change the structure when adding/removing a new store? Needs to be redone.
Now the most difficult thing is to somehow collect and process all this, the difficulty arises when a crowd of users book 2-3 goods.
When a user adds a product to the cart, the product must be blocked for a certain period of time. If during this time the user has not bought it, then this unit of goods can again be considered free.
you need to freeze the value of the cell being changed
No need. It is necessary to use transactions, blocking the goods for the user.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question