References
Caching
- Problem of distributed systems
- When update, need to update the cache or become stable
- Solution
- One big cache server with tons of memory - it can fail
- Cluster of servers
- Ehcache with a central Terracotta server
- P2P gossip protocol (slightly faster)
- In-process ( Infinispan and Hazelcast)
- Cloud provided
- "Consistent hashing" - the hashing determines which cache in the cluster to go
- Works even cluster changes
- Application
- ORM framework integration (hibernate 2nd level cache)
- Spring @Cachable annotated cache methods
- What NOT to cache
- May start with caching everything
- Frequent update & few reads, perhaps not worth the effort