Friday, May 30, 2014

GSoC Week 2: Designing database schema for store module data

In this week i had the weekly call with Pascal as usual. As discussed in that, i was mainly working on designing the database schemas for the new module data to be stored. As the first steps i have come up with the following schema for the new tables that will be used in storing system indicators as used memory, heap memory, free memory etc. Since it is bad practice to define a separate table to each indicator and as it is hard to scale that with time the following design is agreed. We first store metic_name with an id called  metric_id in seperate table for all metics. Then another table is used to store real data values against metirc name and id as below.

Metircs Types Table
[ metric_id, time_stamp, metric_value ]

Metic Values Table

[ metric_id, metric_name, metric_type ]

I am now going to follow this way and create the first set of tables and try to store memory data here.

In addition we discussed on handling historical data. As we can't store previous data forever since database is growing, we are going to have a periodical call to calculate the aggregate value of each metric and it will be moved to a seperate table.

I also sent a request to add my new module into OpenMRS reporsitory this week.


No comments:

Post a Comment