Question

What would you consider the best solution to store via G-WAN Key-Value Store my values in RAM and multi-threaded, and able to be used by all my scripts (from other virtual servers or not) ?

Thank you in advance.

Was it helpful?

Solution

I wish to store different values in different "storages" so as to be able to recover each one via a "key" (type char).

The G-WAN KV store does that (for any type of data: binary too).

Once your application will have millions of concurrent users, one way to speed-up lookups will be to use different G-WAN servers to host either a partitioned data set or a redundant data set (it all depends on the type of your application).

The G-WAN reverse-proxy featuring an elastic load-balancer makes such things this almost transparent for developers.

I do not care that the data is lost when you restart g-wan.

Then you won't have to use a persistant layer like mySQL, etc.

So it would be fine (I think) to have a persistent pointer but I'm not sure that this is the most suitable solution

Look at the persistence.c example for about how to share common data among all worker threads in G-WAN.

But you can avoid that if you are using G-WAN with one single worker thread (./gwan -w 1). One thread is more than enough to start developing and even to operate your application until the point you will need to process more requests.

With one single thread, you can just use a static pointer to your G-WAN KV store (unless different scripts need to access it).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top