I need to receive exchange rates from the API of various exchanges and display them in the form of graphs on my website. The problem is that the number of requests to the API is limited, therefore you need to save data on the server and then transfer it to users. How can this be implemented? Just stored as a Json file on the server, or use any specialized databases? Here is an example of the data I need https://www.binance.com/api/v1/klines?symbol=BNBBTC&interval=1m
1 answer
For convenient work for the future, it is better to store in a database. Since you will constantly receive updated data from exchanges, it is better to record all new data with change dates (jumps / intervals) in the database. In this way, you will collect data that can later be displayed not only at the “now” or “weekly” intervals, but also at intervals “04/01/2018 - 05/01/2018”.
Well, for output to the user, it is better to cache the necessary requests already in the same JSON or any other method of caching. To optimize database queries.
- Which database would you recommend to use for these purposes? My main thing now is MySQL - Oxpa
|