I’m beginning to construct a brand new web site and I would like some steerage on the general structure.
The web site exhibits analytical knowledge for firms listed on the NY inventory alternate. Customers can seek for any NYSE listed firm to see historic monetary knowledge and dwell inventory worth. (See mockup under)
All of the uncooked knowledge (dwell and historic), are fetched from an exterior service (FinnHub.io). I make api calls to Finnhub and obtain the information as JSON. There are limits to what number of calls I could make so I would wish to preserve the api calls as minimal as potential.
The dwell inventory worth chart on the highest part of the web site is up to date each 5 seconds. The analytical knowledge on the remainder of the web page is up to date as soon as a day. Usually, majority of the customers will seek for solely the most well-liked shares.
And here’s what I’ve deliberate to date:
Construct the entrance finish as a Vue.js SPA that may make api calls to the backend Django for knowledge. When the backend Django receives a name from my entrance finish to fetch knowledge for a corporation, it’s going to first verify an area cache to see if the information is already obtainable, if that’s the case, serve it from the cache else name Finnhub api to get the uncooked knowledge, course of it and retailer it within the cache. All subsequent request for a similar firm for the remainder of the day shall be served from the cache. By doing so I can scale back Finnhub api calls and in addition be a bit extra responsive. The native cache might be up to date as soon as a day. The same caching mechanism might be carried out for the dwell inventory worth, however up to date each 5 seconds.
Is that this /really helpful method of constructing such an internet site? Do you assume there’s a higher technique to construction the entire course of? Are Vue, Django good decisions? What database do you recommend for the cache? Every other phrase of recommendation you’d wish to share?
Usually talking, what are the very best practices for constructing one thing like this?
Many thanks prematurely to your time and recommendation.