Author: Matt Asay
Matt Asay is Vice President of Corporate Strategy at 10gen, the company behind MongoDB NoSQL database. With more than a decade spent in open source, Matt is a recognized open source advocate and board member emeritus of the Open Source Initiative (OSI).
One of the most important steps for building mobile social games is choosing the right type of database. No matter how simple or complex your game is, it’s essential that you think about the infrastructure requirements that will allow your company to grow as your game evolves to support demand, beat competition and become a viral success.
When most data stored by online games is unstructured, location-based and polymorphic, NoSQL databases such as MongoDB provide a general purpose store that can handle diverse data with quick read/write access and cost effective management.
The key factors that a social gaming ready database should have are:
Due to the viral nature of social games, the number of active users can fluctuate tremendously within a matter of hours. The last thing you want as a developer is for users’ games to crash unexpectedly or run slowly because there is a server overload. In order to accommodate the needs of social apps, NoSQL is becoming the preferred database model for developers.
Because social games are played by multiple players in remote areas, responsiveness and reliability is extremely important. Certain games like Swing Shot and multiplayer fighting games have players performing actions concurrently. If the actions are not happening quick enough, the user experience in severely diminished.
NoSQL databases help in this regard because they are document based. Whenever data is needed, it’s kept in single documents on a disk which enables the databases to read and write more quickly. Games that lag and take seconds to complete actions do not tend to last long. Users are very quick to exit a game out of pure frustration if things don’t run smoothly.
The goal of every developer is to grow their daily user count as high as possible to increase the amount of in game purchases or paid subscriptions they’re able to get. Growth for social games generally isn’t a slow gradual process. Users jump aboard quickly. Built in social sharing features make it easier than ever for users to tell their friends about the games they’re currently playing and invite them to join in.
Once a game goes viral and climbs up the rankings in the App store or Google Play Store, it can easily gain a million new users each day. Developers have to prepare for this growth before it happens instead of waiting until after the game explodes. This is what happened with The Simpsons: Tapped Out from Electronics Arts (EA). Upon its release, the game acquired a massive number of users which eventually caused EA to pull it from the app store because the game simply had more user activity than their database could handle.
Good NoSQL databases have the ability to scale without limit if needed. Additionally, when the app starts to grow and needs to add features, NoSQL doesn’t require the developer to make changes to the actual application or schema.
Since social gaming is still a fairly new phenomenon and developers are still testing the waters, so to speak, flexibility is a necessity. You have to be able to make changes on the fly in a lot of cases to make improvements to the game and increase user satisfaction. The document database model used in NoSQL offers the flexibility that social gaming requires; document databases often don’t require set schemas which gives the developer a lot more freedom to make changes without having to completely alter the database. Adding new data types is as simple as adding the new data to the correct document.
What we know about social mobile applications is growing each day. As more games get released and developers push the boundaries for what the games are capable of, the entire industry will experience tremendous growth over the next few years. Developers need to make sure their database model isn’t holding them back.