Hi all, I have a task to store large amount of gps data and some extra info in database and to access it for reporting and some other non frequent tasks.
When I recieve a message from gps device it can have variable number of fields. For example
Message 1: DeviceId Lat Lon Speed Course DIO1 ADC1
Message 2: DeviceId Lat Course DIO2 IsAlarmOn
Message 3: DeviceId Lat Lon Height Course DIO2 IsAlarmOn etc. up to 20-30 fields
There is no way to unify number of fields - diffirent device vendors, diffirent protocols etc. And another headache is size of database and necessity to support as much db vendors as possible(NHibernate is used).
So i came to idea to store messages that way:
Table1 - Tracks
PK - TrackId
TrackStartTime
TrackEndTime
FirstMessageIndex(stores MessageId)
LastMessageIndex(stores MessageId)
DeviceId(not an FK)
Table2 - Messages
PK - MessageId
TimeStamp
FirstDataIndex(stores DataId)
LastDataIndex(stores DataId)
Table3 - MessageData
PK - DataId
double Data
short DataType
All indexes are assignet with hilo. Tuned my queryes so Nhibernate can handle incerting 3000+k messages veeeeeery quickly(baching also used). Im happy with perfomance atm. But i dunno how it will work at 50+gb or 100+ gb size.
Will be very grateful for any tips and hints about my issue and storage design overall=)
Thanks, Alexey
PS.Sorry for my english=)