views:

43

answers:

1

I have a data acquisition application broken into a client and a server.

The server is reponsible for grabbing data from the hardware, running some realtime analysis, and recording the data to disk when it's asked.

The client is a GUI that the operator can use to look at some pretty graphs (generated by the server), set some parameters, and turn recording on and off. It's usually run on the same machine as the server, but can be run from any other machine on the network.

Both are written in Qt (C++). Both are used on Linux.

The communication between the two is currently done with a homegrown library (in C++, but not Qt) that is essentially a hash table. The server has a list of parameters, like analysis.graph.width, and those parameters can be set and get by both the server and client(s).

The system is being redesigned to support new hardware, and now is a good time to replace this library if something better exists. Here are some requirements:

  • Ideally would play well with Qt (using QVariant to store values, using signals/slots)
  • Must allow values to be many different types (integers, strings, doubles, bools, lists of those)
  • Keys will be strings
  • Must be fast, allowing set/get operations up to 30 times per second
  • Must allow multiple clients to set/get parameters simultaneously

I found this list: http://en.wikipedia.org/wiki/Structured_storage, but the libraries listed there seem too complex (distributed, mirrored) or not cabable enough (values can only be strings).

Is anyone aware of libraries that would fit some or all of the requirements?

A: 

Well Dave I have had used redis for the same problem. It doesn't meet all your requirements but meets

  1. Must allow values to be many different types (integers, strings, doubles, bools, lists of those)
  2. Keys will be strings
  3. Must be fast, allowing set/get operations up to 30 times per second
  4. Must allow multiple clients to set/get parameters simultaneously

You can use the c/c++ api to communicate with redis. http://stackoverflow.com/questions/2181474/how-to-use-redis-within-a-c-program ... yes you will have to convert datatypes from one to another say char* to QString etc.

Ankur Gupta