Posted Wed, 11 Dec 2013 10:49:51 -0500 in reply to
Sönke Ludwig
Reply
On 2013-12-11 8:43 AM, Sönke Ludwig wrote:
Am 11.12.2013 12:25, schrieb Shammah Chancellor:
Is there any particular advantage for using Redis over a __gshared AA?
The only thing so far that I have is that I don't have a good key
expirey mechanism in AA's.
This seems to be something Sönke was trying to solve with the Sessions
list though as well. Maybe we should implement such a beast? (An AA
with key expiration)
-Shammah
The advantage of Redis is scalability and persistence. So in particular
it allows to scale the whole system using a load balancer when required
and it allows the web service to be restarted (possibly after a crash),
resuming work as if nothing had happened.
It depends a bit on how exactly the MemorySessionStore
will end up,
but it seems like the concept of a self-expiring map may be useful
enough to put it in the vibe.utils
package (even though that package
is meant more for internal use than as a public API).
For the HotCacheStore & MemoryCacheStore it's a shared AA with expiry.
SessionStore will end up being backed by a CacheDataStore - it's needed
to allocate space to shared objects that benefit from the same mechanism
as a session cache but not restrained to the active session.
It's in the plan which is here
https://github.com/rejectedsoftware/vibe.d/issues/433
Working on implementing it right now, should be very interesting. I'm
glad the low-level nature of vibe.d makes it possible for such things to
be done