views:

33

answers:

1

What would you recommended re an approach to persist data for the following situation:

  • WPF application (desktop)
  • Will be capturing information ever second (approx) and will need to store about 5 values per second effectively.
  • Will need to save data for up to say 1 month
  • Usage will be both (a) real time viewing of last few hours data, + (b) ability to view historic view of data for other data, kind of like an ad hoc query to view the data. There would need to be some limited filtering or querying on the data store (whatever it is) prior to it being presented

What approach would be recommended here, ideally that is easiest and keep the WPF installation simple?

+1  A: 

You could do it using the new SQL CE of Microsoft (which allows multithread). It's easy to deploy (I think it's just a matter of including a DLL)...

http://en.wikipedia.org/wiki/SQL_Server_Compact

It should handle the load fine, assuming not a gezillion people will be using it on the same machine. Even then it would be fairly easy to upgrade.

So you would run a timer or something to push your data mining into it every 5 seconds, then the client polls as the user loads screens in the client.

Later, you might want to separate it into two apps, one for the data mining, maybe running as a service and the other one as 'the client'. In that case having a server dedicated to the data mining would help.

keyle
until the CE version 4 is out (which has no installation support) I'd like to avoid it - if use of a database is the answer I'd probably want to stick with SQLite re no installation I think - but re database versus or not (e.g. flat file, other technique) sounds like you'd recommend use a light weight database then.
Greg
Yes, if you're going to write to a database every 5 seconds and poll data from clients, I'd definitely use a database. And because it's only once every 5 seconds and with 1-3 months data, a lightweight database should do just fine. Cheers.
keyle