Thanks to everyone who attended my presentation “Queues, Pools and Caches” at Hotsos 2012. I had a blast and I hope you did too.
I think the presentation was a bit long to comfortably fit in an hour. In the next iteration I will drop the section about queues and expand more about Connection Pools and Memcached. The audience definitely showed the most interest in those topics.
There were many questions asked after the presentation, so I thought I’ll post a short FAQ to address those:
- During RAC node failure, how do we make sure the connections in the pool reconnect to the right location?
Hopefully, the data source your application uses supports FAN and can be configured to handle notifications from the RAC cluster regarding node availability. Otherwise, you’ll want to use TAF – configure failover in tnsnames.ora or in JDBC url, and make sure your application can handle exceptions that occur as a result of a disconnected session. The following papers dive deeply into the available solutions and how to implement those:
- How much Memcached cost? Does anyone actually use it?
It is an open-source product, and can be downloaded and installed for free from https://memcached.org. In the same website you can also find out that numerous companies use Memcached for their scalability, including: Wikipedia, Twitter, Youtube and Craigslist.
- How does Memcached compare to TimesTen or Coherence?
I do not have experience with TimesTen and Coherence, so I can’t compare them. In general, Coherence should be similar to Memcached as it is also a distributed, in-memory key-value store. TimesTen is not distributed, so it will not scale as well as Memcached and Coherence and it uses a full relational model instead of simple key-value model, so developing for TimesTen is completely different and may or may not be what you need in a specific situation.
- Why can’t I just cache data as part of my Java application?
You certainly can. The downside is that you probably can’t write a distributed data store, those can be complicated. So each server can only use its own memory for caching, and depending on how you write it, the same value can be cached on many servers, resulting in waste of memory space. Why go to all the trouble of reinventing the wheel if you end up with inferior result? Just use Memcached.
Those are all the questions I remember answering. Have more questions? Let me know.