Answer the question
In order to leave comments, you need to log in
Where in my case is it better to save the data - to a file or to the mysql database?
There is data, they are read every 5 minutes from a third-party service, and I build a graph based on them. Initially, the data was stored in the database.
But there is a lot of data and I thought - maybe it's worth caching them on the server side? And then take data from the cache and draw a graph on the client side?
And suddenly I thought - why am I writing to the database at all, maybe it’s more correct to write to a file right away?
Discuss me, what's the best way to do it?
Answer the question
In order to leave comments, you need to log in
The database already writes to a file)) But the database has tools for working with this data.
If you need to immediately contact several data sets (for example, for a period), then the database will be faster.
If all the data is available and stored in a single copy, then how the option to save them in .json and directly load them in the frontend
It all depends on how you plan to use them!
Nothing is clear from your reasoning. Then you take data from a third-party service and write it to the database. Then you start talking about their caching. And then all of a sudden you start mentioning writing to a file.
If you write data to the database, then let it stay that way. Why, what's the point of the fact that you start writing data to a file ...
Of course, you need to cache, but what does it have to do with it? ( https://habrahabr.ru/company/zerotech/blog/316316/)
But there is a lot of data and I thought - maybe it's worth caching them on the server side? And then take data from the cache and draw a graph on the client side?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question