Social gaming is a “hits” business. There are a large number of social games that are developed but a relatively small number make it big. Every developer’s dream is to have their game go viral and shoot to the top of the download and DAU charts.
In this environment, selecting the right database is more critical to a game’s success than you might think. Many databases support a small number of DAUs. But, when your game goes viral, you better have a database that delivers consistently high performance while scaling to support a dramatically higher number of DAUs. Otherwise, all the hard work done to create a compelling game is wasted because your game couldn’t scale and players deserted the game in frustration.
Due to their performance and scalability advantages, NoSQL databases are increasingly being used for social games. But it seems like open-source NoSQL database projects are popping up all over the place and sorting through the options can be daunting. Selecting the right NoSQL database for your social game can be difficult, as there are various classes including key-value, document, and columnar. But which is right for your social game?
The truth is, key-value and document-oriented databases power the majority of NoSQL deployments behind social games, largely due to their balance of four key criteria:
- NoSQL Supports High Performance. The document and key-value data model keeps related data in a single physical location in memory and on disk (a document). This allows consistently low-latency access to the data — reads and writes happen with little delay. Today’s game players can’t experience even the slightest downtime or else applications are deemed unsuccessful and adoption declines. Look for a database that consistently provides sub millisecond reads and writes, even as you scale.
- NoSQL Provides Dynamic Elasticity. Because the document approach keeps records in “a single place” (one document in a contiguous physical location), it is much easier to move the data from one server to another while maintaining consistency and no downtime. Moving data between servers is required to add and remove cluster capacity to cost-effectively match the aggregate performance needs of the application to the performance capability of the database. Doing this without stopping the revenue flow of the game can make a big difference in game profitability. Look for a database that allows you to add more servers to your data tier with the click of a button and doesn’t require any application changes.
- NoSQL Has Schema Flexibility. While all NoSQL databases provide schema flexibility, key-value and document-oriented databases enjoy the most by far. Column-oriented databases still require maintenance to add new columns and to group them. A key-value or document-oriented database requires no database maintenance to change the database schema.
- NoSQL Supports Query Changes. Balancing schema flexibility with query expressiveness (the ability to ask the database questions, for example, “return me a list of all the farms in which a player purchased a sunflower seeds last year”) is often important. While a document database provide indexing and querying at the database level, a key-value database only permits accessing the data record associated with a given key.
If you are considering building a social game, think about the infrastructure requirements to support growth. As we discussed, the most important issues for managing data in social games are elasticity, concurrent random read latency and throughput, and data format flexibility. All of which, NoSQL document-oriented databases address.
Your choice of database technology is arguably the most important infrastructure component decision you will make.
About the Author
Bob Wiederhold is the CEO of Couchbase and has more than 25 years of high technology experience. Until an acquisition by IBM in 2008, Bob served as chairman, CEO, and president of Transitive Corporation, the worldwide leader in cross-platform virtualization with over 20 million users. Previously, he was president and CEO of Tality Corporation, the worldwide leader in electronic design services, whose revenues and size grew to almost $200 million and had 1,500 worldwide employees. Bob held several executive general management positions at Cadence Design Systems, Inc., an electronic design automation company, which he joined in 1985 as an early stage start-up and helped to grow to more than $1.5 billion during his 13 years at the company. Bobalso headed High Level Design Systems, a successful electronic design automation start-up that was acquired by Cadence in 1996. Bob has extensive board experience having served on both public (Certicom, HLDS) and private company boards (Snaketech, Tality, Transitive, FanfareGroup).