2 Minutes To Code (β Version)

Spy-memcached, java client for memcached - 2 minute tutorial

Overview of spy-memcached api (java client for memcached server)

Memcached is a robust caching server. This articles will explain how to use a memcached client called spy-memcached for connecting to memcached server in a java application.

When is memcached used :

If your application needs 100s or 1000s of mega-bytes of business objects that are fairly static, then a beginner starts with keeping everything in the jvm's heap space. This approach however is not scalable, neither is it efficient in terms of start-up time of the application, not to mention the sluggishness that such a huge heap brings to teh jvm.

It would be efficient if there was a way to keep these almost static objects in a separate processes heap and then fetch them as and when required. This is what memcached brings to the table. Memcached works on low-level tcp protocol and provides a high throughput for production environmets.