Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best database design for a "sensor system"

I'm doing a schoolwork and..

I have to do a vehicle tracker system. I thought of these three designs. What do you think?

My database schemas

(png at ImageShack ~99KB)

Opinions?

like image 638
Nick Avatar asked Oct 09 '09 16:10

Nick


1 Answers

  • If you always measure and store all parameters within one measuring session, then go for the design 1.

    Moving the attributes into separate tables only makes sense if the attributes are rarely stored and/or rarely needed.

  • If you have separate sensors for position and temperature, then go for design 3.

    This is most probable, since the position is measured by a GPS tracker and temperature and oil level are measured by the vehicle sensors, which are separate devices and the measurements are performed at separate times.

    You may even need to add a separate table for each sensor (i. e. if different sensors measure gas and temperature at different times, then make two tables for them).

  • Moving liquid into a separate table (as in design 2) makes sense if the list of the liquids you use is not known in design time (i. e. some third liquid, like hydrogen or helium-3 or whatever they will invent will be used by the vehicles and you will need to track it without redesigning the database).

    This is not a likely scenario, of course.

like image 104
Quassnoi Avatar answered Sep 28 '22 19:09

Quassnoi