Scaling to 100M: To Cache or Not to Cache?


This blog post is part 2 in the “Scaling Wix to over 100M Users” series. Read part 1 here.

When Wix started, we used the Tomcat, Hibernate, and Ehcache stack with a MySQL database and Flash front end. Why did we choose that stack? Simply because our first backend developer had experience with that stack from his previous workplace.

Part of that architecture was Ehcache—a great caching library for Hibernate and the JVM—which makes a map-like abstraction for an in-memory cache that can also be configured as a distributed cache. Ehcache, unlike Memcached, runs in process (in the JVM), and its distributed feature fully replicates cache state between all the nodes in a cluster. Note that at this time (around 2006-2008), Ehcache was still an independent open source project and not yet part of Terracotta. (With Terracotta, the replication and distribution model may be different, but that is not an important point for this article.)

<