4 ms·
Generic Answer: - The tech stack that is best is the one you/team are most comfortable with using. Specific Answer: - If you were using Elixir, you could hav
by matt_s 5y ago
Generic Answer:
- The tech stack that is best is the one you/team are most comfortable with using.
Specific Answer:
- If you were using Elixir, you could have 1 process (GenServer) per stock ticker that calls the API for just that stock. GenServers are lightweight processes that run concurrently in the BEAM. That process could then have a set of subscribing user processes to notify which would then do an alert to a user. This is assuming you can call an API for one stock vs. having to parse a feed of data. If I were doing this I wouldn't store any of the stock data in any way, its ephemeral and by the time a DB commit happens the price changed.
Caveats:
You mention API so I assume that means you are calling an API, parsing data, (dealing with rate limits) then alerting. I'd caution the use of the term "real-time" as you are farther away from trading data than big name brokers. My intent isn't to downplay the idea, just thinking it through based on the info in the one sentence question.
- christopher8827 5y agoYou can assume that a price comparison needs to be made between the saved price & the current price from the API.