Remote, in-memory key-value stores: An idea whose time has come and gone? [pdf]
I don&#x27;t get it:  <i>Key-value</i> stores is a topic that just won&#x27;t go away.  I was interested in key-value stores, did a little work, solved the problem for my needs, and don&#x27;t care anymore.  Sure maybe there can be some high end, challenging aspects, but what I did was dirt simple, childishly simple to do, blindingly fast, with plenty of capacity -- maybe will cover 75% of the need for everyone?<p>Heck, if we want something with really deep functionality, we are just back to relational database, right?<p>So, I wanted a key-value store for <i>session state</i> for users of the Web site of my startup.<p>When a user sends a page back to my server, it has in a &quot;hidden field&quot; the value of an encrypted token with identifies the user&#x27;s logical <i>session</i>.  And I have in VB.NET a class for the data I want to keep on that user, their <i>session state</i>.<p>So, in my VB.Net Web server code, I have defined some classes:  (1) An allocated instance of one class sends a new or updated key-value pair to the key-value server.  (2) An allocated instance of another class requests from the key-value server the value that corresponds to a key.  (3) An allocated instance of a third class gets the value back from the key-value server.<p>For communications, just take an instance of a class, <i>serialize it</i> (thank you VB.NET), copy it to a byte array, and send that via old TCP&#x2F;IP sockets.  Then the receiver gets the byte array and does a <i>deserialization</i> to get the corresponding object instance.<p>The key-value server is based almost entirely on just two instances of a standard .Net collection class.  One instance has the key-value pairs where, right, the key in the pair is the key in the collection class.  The other instance has a time-date pair as key and for a value a key from the key value store.  Here there is the time-date when the corresponding key-value was last written or read and is used for session time outs.  So, for session time outs,  just read this time-date and session key instance in ascending order on the time-date key and for any session time-outs delete that collection class element and also the corresponding element in the other collection class.<p>It&#x27;s a few hundred lines of code and was a simple exercise in TCPIP, object instance de&#x2F;serialization, and collection class usage.<p>I also have code to permit sending some system management commands to the key-value server.<p>It runs as just a console application.<p>The code is single threaded, and I&#x27;m counting on just the standard TCP&#x2F;IP FIFO queue to hold the backlog of work to be done.<p>All the data is held in main memory so should be blindingly fast.  Some simple arithmetic indicates that the main memory needed is not very large for even a quite busy Web server computer.<p>The session state server can serve any reasonable number of Web server computers, and a particular user doesn&#x27;t need <i>session affinity</i> with a particular Web server.<p>Looked simple and easy to me.<p>How much of the need will something so simple satisfy?<p>What needs will such a simple solution not satisfy?