We’re Hipsters using Node.js and Mongo, and we love it
You learn a lot about yourself when launching a new venture. Two weeks ago we launched a Kickstarter for our new game, CasinoRPG. We've already learned a lot from this experience, but do you know what jumped out on day one? Apparently, that we are hipsters.
The first comment posted on our Reddit reveal.
Maybe we don't wear skinny jeans, shop at thrift stores, live where hipsters live, drink PBR, have interesting hair styles, aren't all that ironic, have trust funds, wear lumberjack beards or any of the other things attributed to hipsterism.
We are, however, self-proclaimed artists. We believe that games are the ultimate art form, from the code and data layer, all the way up to the graphics and audio. With this in mind, we specifically selected these so-called "hipster" technologies for our stack, because they are the right tools for the job, not because they are "cool."
We set out with four main requirements when constructing our stack:
Run on the open web
We love the open web and come from web development backgrounds, so this is where we wanted CasinoRPG to live. The usual suspects for browser-based games are Flash, Java applets and Unity. However, there's only one that allows for gameplay without the need for downloads or plugins - HTML5.
The dream of truly cross-device gameplay has been talked about for ages, but it has never lived up to the hype. The closest we have come is creating native apps for multiple different platforms. Not only is this a painful process, but it still doesn't reach the goal of true cross-device. We wanted to write our game once and let players choose whatever device they want to use, without degrading the gameplay experience. Only HTML5 offers this solution.
Many of today's browser-based games lack what so many "traditional" multiplayer games got right, real-time multiplayer. Our vision is to connect people through gameplay, and as most any gamer will tell you, that is best accomplished through real-time interaction. Thankfully, HTML5 offers a solution for this as well - WebSockets
WebSockets give us a quick connection to the server, but messages need to relay even more quickly. Our solution has been Node.js because of its non-blocking, event-driven nature. Node.js can be extremely fast when used correctly, and we've seen it fly for our use-cases.
Since CasinoRPG is a massively multiplayer game, we needed our stack to scale with it as the user-base expands. Node.js is again an ideal choice as the asynchronous framework is capable of handling large numbers of concurrent players without a sweat, and we can fairly easily split it off into multiple nodes. In addition, we aren't using Node.js as our HTTP server because we don't have one. The entire game runs off of S3 and a CDN, so our servers only see socket connections.
On the data layer side, MongoDB became our choice early on. We tested several different databases, including our long-time choice of MySQL. However, only MongoDB offered the combination of performance and scalability that we require. In particular, MongoDB makes replication and sharding a breeze, allowing us to scale with our user-base without missing a step. It also doesn't hurt that Mongo's geospatial indexing almost feels like it was designed with games in mind.
Shameless plug: If all of this interests you, please check out our Kickstarter.
UPDATE: Thanks to everyone's amazing support, our hipster ways have helped to successfully funded our Kickstarter! You can now try out our game in open beta testing at http://casinorpg.com.