Answer the question
In order to leave comments, you need to log in
Do I need to recalculate all database records (several million) to display stock balances?
Hello. Faced such task.
There is a stock, to which goods are added and subtracted several tens of thousands of times daily.
The final balance in the warehouse can be calculated by simple summation or subtraction of goods. And save the state of the drain, for further output to reports. But this will not work, because sometimes you need to change the records retroactively and then you have to recalculate everything again. Thought each time at request to recalculate all operations. This option will also make it easier to display the stock status on a specific date, which is also needed.
I have never worked with big data, but for some reason it seems that after some time, for example, in a year, when several million records have accumulated, it will be unrealistic to recalculate everything.
The program is written to order. What will be the iron is initially unknown. The warehouse is connected to a point of sale from which thousands of sales take place every day. From each product (running) on average, probably 5-6 decreases. And the same amount is delivered to the warehouse.
I would like to know your options for implementing this task.
Answer the question
In order to leave comments, you need to log in
The specifics strongly depend on the architecture. The only thing I can say is that any helpers in the form of subtotals can turn out to be rather evil.
Maybe the question is not addressed there?
Maybe I need to dig towards algorithms, not databases?
you need to dig towards 1s trade and warehouse, and not reinvent the wheel. there are many more discoveries ahead, for example, the concept of "closed period"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question