For those of you who do not know, the ehcache project has released a SOAP based server. It comes as a WAR which can be deployed to any web container. It also comes as a standalone server which uses Glassfish V3 embedded and can be started up with a simple script.
Why am I doing this? There are lots of theories that have made their way on to the ehcache mailing list. The prosaic truth is that a large US corporate using ehcache for their Java apps on 200+ servers also wants to use it for their C++ apps. And they are prepared to sponsor development. The Web Services API lets them do it. That’s it.
As to the larger question of how interesting this is to the world at large, my view is not very. However having to jump through all the hoops to get a server infrastructure done, I thought that the world at large may be interested in a RESTful, resource oriented ehcache server.
So, I am implementing the RESTful piece now. To me, this is pure exploration. I am on the journey and interested to see where it leads. I am using Jersey for this. Jersey and JSR311 are yet to be finalised. I have been logging bugs and interacting with the team as I go. They are releasing monthly, so I can release with a version of Jersey with all my bugs fixed.
I have a copy of Leonard Richardson’s and Sam Ruby’s book open in front of me. My aim to ensure that the ehcache server truly follows the resource oriented ideas in this book. Also that it honours ALL of the vaguaries of HTTP/1.1.
I expect to release the first complete RESTful implementation this weekend.
The conclusions I have right now:
1. Any language can use ehcache server. This includes C, C++, C#, VB, Perl, Python, Ruby, Scala, D …
2. There is no need to have a client per language. Because we just use HTTP, and almost all languages can do HTTP, we’re done.
3. Glassfish V3 uses NIO. The server performance should be awesome. Having said that, it will, as is memcached, two orders of magnitude slower than in-process caching, which uses references or pointers rather than network operations.
4. Ehcache server adds a few tricks due to HTTP. HEAD requests, conditional gets and expires headers. What’s faster than hitting a cache? Not needing to hit the cache at all. I am testing with curl, wget, various Java libs and browsers to make sure that this is done right. The combination of all these could massively outperform implementations like memcached.
5. Ehcache servers can be placed behind industry standard HTTP load balancers. You can have 2 or more of these in an ehcache cluster behind a single URL, offering load balancing and redundancy. So, if a single ehcache server dies, no problem.
The primary interest I have is providing a caching service which can act as a component in a RESTful resource oriented architecture. How far we take this will depend on who uses it and what they want.
Comments