Database structure:

This is the current fixed database structure. There are also dynamic tables created to store the quotations of each stock each day (as we always read a whole day of a stock we create one table for each stock/day so we don't need to use WHERE on our queries, improving the execution speed).

  • StockGroups: this table contains the different groups available. The groups are fixed and defined through code and saved to database.
    • Id: identifier of the group
    • Name: name of the group
    • LastUpdate: date when the group was saved for the last time. A group is only checked for new stocks once a day, with this value we know if the update has been done or not.
  • Stocks: this table contains the different stocks available.
  • StockGroups-Stocks: this table contains the relations of Groups and Stocks. A stock can be on different groups. The table tracks when the stock was added or removed.
  • QuotationTables: this table keeps track of the tables generated for each stock each day. This way we have stored the name of the table and thus the naming system or the stock symbol / name can change and we will be able to find the table.
  • ExchangeMarkets: this table contains the different markets where the stocks are traded. Each market has different schedules and this table stores the daily key times (when the market opens or closes and if there are opening or closing bids).
  • ExchangeMarketHolidays: as each market has different holidays this table stores when a market will be completely closed (we currently don't track when a market has different scheduling, we just store the days when the market is completely closed).
  • Notifications: real-time plugins store here a kind of log to be able to track what happened in runtime.

Last edited Feb 18, 2013 at 9:03 AM by somos, version 12


No comments yet.