Do you think Terracotta is an alternative to Memcached ?
The following is a snapshot directly captured from the Twitter stream ..
Reminder to self :
- Memcached is a specialized engine for caching *only*. In case you are trying to use it as a data store, think twice and refactor your thoughts.
- Memcached is NOT a distributed hash table. This is quite a popular misconception that even Dare also mentions in one of his recent posts. Every memcached server is atomic and is not aware of any other memcached server in the cluster. Any algorithm for distribution, HA, failover is the responsibility of the client.
- How do you handle database updates and prevent staleness of your memcached data ? Updates to data are usually handled by pushing writes to the database and then having some asynchronous processes (or database triggers) build objects that are pushed into memcached. In case of Terracotta it is the other way round. You write into Terracotta Network Attached Memory and the data gets pushed into the database through asynchronous write behinds.
- Terracotta offers a truly coherent and clustered cache that remains consistent even in the presence of database writes through write behind to System of Record. Hence by writing data directly into Terracotta Network Attached Memory, data can be safely and durable stored, without risk of loss or corruption, and later drained to the DB asynchronously.
Can we conclude that for read-only (mostly) usecases, use memcached, while, for read-write usecases, use Terracotta to obtain transparent durability to the persistent store. Rather than alternatives, the two technologies are complementary.