1

I'm trying with Algo-trading. so I have WebSocket which has market data, I'm trying to store in the database. other modules read this stored database and make the buy/sell decisions.

  1. what should be the best database option here considering it should be faster to insert the data and required concurrent reading.
  2. how do I handle the WebSocket data, it contains a lot of data to store, without losing the data.

?

keerthan kumar
  • 332
  • 7
  • 25

2 Answers2

2

To answer question 1:

You can use a memory based database such as redis.

For question 2: you can use rabbitMQ or kafka.

masoud_9_6
  • 31
  • 6
0

To answer question 1:

Several people use Redis Timeseries to store market data for analysis/display. Insert and retreival are fast.

For question 2:

You could run several consumers and use Redis for de-duplication so you don't update everything twice, but it will heavily depend on your stack

namizaru
  • 646
  • 3
  • 5
  • is redis really faster than sqllite 3? – keerthan kumar Jan 07 '22 at 00:39
  • It will depend on the queries you are doing. However, Redis really shines in your use case if more than 1 node will be accessing the data at a given time, will be easier to HA if required and easier to backup and restore. – namizaru Jan 07 '22 at 18:16