Discussions

News: Did Someone Say GigaSpaces Now Has Memcached Support? (June 16 Release)

  1. GigaSpaces 7.1.1 will be released on June 16th, with the typical set of bug fixes, although it will include a significant new feature: memcached support.

    Memcached is a distributed cache, implemented initially by LiveJournal. It is interacted with over TCP sockets, providing a set of sixteen commands - mostly variants of read/write operations, including some asynchronous write operations, which can be tangibly faster.

    Memcached is an excellent example of a simple, cross-language read-mostly cache; it doesn’t support write-behind in and of itself, nor does it support event handling as a standard. This makes the typical memcached implementation unsuitable as a system of record and limits it to cache-only - which means that your initial read is limited by your actual data source, and introduces extra complexity to reads. In other words, it’s read-scalable – but not write-scalable, which is what many applications today need.

    The typical read operation process looks something like this:

    1. Try to read the item of interest from the cache, by a generated or natural key - one book suggests using the full SQL query used to find the object, which sounds like SQL injection waiting to happen (See “Using memcached,” J. Finsel, p. 36)
    2. If the cache read fails (i.e., the key is not in the cache), read the item from a system of record
    3. Store the item into the cache by key

    A write operation would be fairly similar, except you’d not check to see if the item was in the cache already - you’d write the item to the database and then to the cache, ensuring that the cache was current. Memcached provides a very primitive versioning capability via a secondary generated identifier for each cache entry.

    With memcached, the client library is responsible for distribution. A typical client uses a list of hostname/port combinations, and determines at write/read time which actual memcached instance to use (usually based on the key, although it’s not formally defined.) Therefore, a given client library in one application could potentially distribute data across multiple memcached servers differently than another client library.

    With GigaSpaces XAP 7.1.1, a space – a data and processing container, analogous to a Java EE server with an embedded database - can be deployed with the “memcached” schema, which means that the memcached protocol is supported for that space. A memcached client can then connect to that server with absolutely no code changes.

    The benefits, though, are very noticeable: XAP can provide easy write-behind and initial load semantics for memcached, which means memcached is also write-scalable, provided that your read/write scenarios are nontransactional, as many are. The standard XAP interfaces provide transactions, of course, so you can mix and match transactions with nontransactional operations – something other memcached implementations do not support.

    The typical XAP applications also benefit from memcached in that our implementation of the protocol – not supporting transactions – becomes very fast for simple write operations.  

    For example, an application might use the memcached protocol to write new events into a space: stock updates, for example, or RSS entries, neither of which needs a more complex usage than pass/fail. A transaction would work for these, but the transaction is slower (due to the nature of how transactions are implemented in Java) and the result is the same without the transaction: did this operation succeed or not?

    The application can then use GigaSpaces’ event listeners to execute a workflow on the object, whether translating to a native GigaSpaces entry, or handling the event in some other fashion. It’s also possible for other GigaSpaces processes to create a cache entry without using a memcached write operation.

    Our support for the memcached protocol also means that XAP is more easily accessible by even more languages. XAP has had C++, .NET, and Java support for quite some time, but memcached means that the native implementations of Python, Ruby, and PHP (for example) all have the ability to use a distributed, scalable, secure, and reliable storage mechanism for memcached.

    With GigaSpaces XAP 7.1.1, GigaSpaces Technologies has shown its commitment to a wide range of protocols and use cases, and providing faster access to more clients. We hope you find the new features useful, especially considering the addition of system-of-record capabilities given to memcached, and we’re always interested in seeing how people use the technology in new and fascinating ways.

    Threaded Messages (4)

  2. JPA[ Go to top ]

    Congratulations GigaSpaces for this

    When is JPA going to be supported? That would be really nice to have!

    I've been experimenting with GigaSpaces XAP + Seam + RichFaces and got it to work after some fighting. Are there any other people using this combination?

    The Cloud Computing Framework for XAP looks quite interesting, but the GigaSpaces site seems to be broken; cannot get any trial keys for example: <a href="CCF4XAP" rel="nofollow">http://www.gigaspaces.com/mycloud">CCF4XAP page</a> :(

  3. JPA[ Go to top ]

    Congratulations GigaSpaces for this

    When is JPA going to be supported? That would be really nice to have!

    We already have some (very) primitive JPA support, contributed from an openspaces.org participant. It's not part of the core product, however. 

    I can tell you that JPA is on our radar; we're not sure which release it will be in yet, but it should be this calendar year.

    I've been experimenting with GigaSpaces XAP + Seam + RichFaces and got it to work after some fighting. Are there any other people using this combination?

    What problems did you have?

    The Cloud Computing Framework for XAP looks quite interesting, but the GigaSpaces site seems to be broken; cannot get any trial keys for example: <a href="CCF4XAP" rel="nofollow">http://www.gigaspaces.com/mycloud">CCF4XAP page</a> :(

    I'll let the people responsible for that know. Thanks!

  4. JPA[ Go to top ]

    I've been experimenting with GigaSpaces XAP + Seam + RichFaces and got it to work after some fighting. Are there any other people using this combination?

    What problems did you have?

    The problems were first to get Seam and Spring to work together (because having to use Jetty with XAP) and then those with XAP. Seam wants transactions (that it normally just automatically gets from a JEE container), so needed to configure transactionmanager from Spring to be used with Seam. Then, needed to configure Spring transactionmanager for my gigaspace. XAP wants to load stuff from processing unit's pu.xml spring configuration before anything else happens in the web application startup, so I had this chicken-and-egg problem of having to configure Spring-related stuff into Seam, Seam-related stuff into Spring and not to configure Seam-related stuff into pu.xml, because it doesn't work as Seam is not started when pu.xml is handled. Oh well, I managed to put Seam-related spring-configs into a separate applicationContext.xml that I can start after Seam has been started (it's listener before Spring's in web.xml) and things seem to mostly work. So, fairly interesting stuff, eh? :)

    Maybe I should blog about what I did, so that no-one else has to go through the hassle. Let's see...

     

  5. JPA[ Go to top ]

    We're working on the CCF5XAP issues. The problem with the license is related to, well, a GIANT SOFTWARE COMPANY's external email services. We're working on it - it should be back up soon. If you need more information or help, email me at joe at gigaspaces dot com .

     

    captcha: "fogies Jr." I swear the captchas are haunted.