2. Other caching systems
In memory Centralized
EHcache Memcached
Gemfire Redis
Gemfire
www.xebia.fr / blog.xebia.fr 3
3. The needs
Switching from statefull EJB to Web services : sessions
caching
Highly available
Speed & Multipurpose
High volumes
Future : replace existing cache systems
www.xebia.fr / blog.xebia.fr 2
4. MongoDB as a caching system
Pros Cons
TTL Support in MongoDB Speed
2.2
Disk usage
Higly available
Scalable
Automatic failover
Easy to use
www.xebia.fr / blog.xebia.fr 4
5. Testing
Writing a Tomcat valve and a sample Web application
Setting up an environment :
▶ 1 MongoDB Replicaset
▶ Between 2 and 6 applications servers
▶ 1 load balancer
Stress tests
Results
▶ 1300 req/sec => 5ms avg
www.xebia.fr / blog.xebia.fr 5