Hi, I'm working on a database design for a building monitoring system. It goes a bit like this: There's a building. A building has multiple areas which can contain loggers or groups of live feed sensors. A logger has a single sensor and it's data is collected by handsets which is then downloaded into the system later.
So for example:
Building:
+ Area1:
Cold room 1 (Logger)
Cold room 2 (Logger)
+ Freezer 1 (Live monitoring):
Live sensor 1
Live sensor 2
A logger has readings that are stored in the database, as do the live monitoring sensors, and the readings can generate alerts.
My problem is that a logger and a live monitoring sensor are very similar, but because they exist at different levels of the hierachy I'm finding it difficult to model in a way that seems nice. Here is what I have come up with so far. This is just a mock up to play with ideas, theres plenty missing:
http://thejunkroom.co.uk/~marks/db1.png
Bit of mess I know..
It's a shame it can't be like this:
Building:
+ Area1:
+ Foo
Cold room 1 (Logger)
Cold room 2 (Logger)
+ Freezer 1 (Live monitoring):
Live sensor 1
Live sensor 2
As then it could be more like this:
http://thejunkroom.co.uk/~marks/db2.png
But alas it isn't this way.
So, is there a better design for this?
I hope this makes some kind of sense..
Thanks, Mark.