Design a feed system of stock informaiton | Runhe Tian Coding Practice
Let's assume we have some scripts which are scheduled to get the data via FTP at the end of the day. Where do we store the data? How do we store the data in such a way that we can do various analyses of it?
- Proposal #1
Keep the data in text files. This would be very difficult to manage and update, as well as very hard to query. Keeping unorganized text files would lead to a very inefficient data model. - Proposal #2
We could use a database. This provides the following benefits:- Logical storage of data.
- Facilitates an easy way of doing query processing over the data.
Example: return all stocks having open > N AND closing price < M.
Advantages:- Makes the maintenance easy once installed properly.
- Roll back, backing up data, and security could be provided using standard database features. We don't have to "reinvent the wheel."
- Proposal #3
If requirements are not that broad and we just want to do a simple analysis and distribute the data, then XML could be another good option.
Our data has fixed format and fixed size: company_name, open, high, low, closing price. The XML could look like this:
Read full article from Design a feed system of stock informaiton | Runhe Tian Coding Practice
No comments:
Post a Comment