Tau Station’s Tech Stack
People have been asking about our technology stack, so this post will be a bit “tech heavy.” Further, it will be opinionated tech-heavy. You’ve been warned!
When I started Tau Station, I knew that I was primarily looking for a robust Web framework, a flexible ORM (object-relational mapper), and a strong database. Due to my having been heavily involved in open source for years, only open source products were considered.
The Back End
As for the programming language, I was pretty sure from the start that it was going to be Perl 5. I’ve programmed in quite a few languages and, to be honest, I was tempted to start Tau Station in a different language just for fun. However, I knew I wanted Tau Station to be successful and not just an experiment, so I decided to use Perl and all of the powerful and awesome tools that come with it. We’re currently targeting Perl 5, version 24, which was released in May of 2016. There are new versions of Perl 5 released every 12 to 13 months and we’re eagerly anticipating some of the new features, so we expect to be upgrading again soon.
I chose Catalyst for a powerful Web framework based on the MVC (model-view-controller) pattern. Template Toolkit was chosen for managing the HTML templates and DBIx::Class for the ORM (object-relational mapping) we would use in our model. This combination allows for incredibly fast development. If we need to change the database, we just run the DBIx::Class::Schema::Loader and it rebuilds much of our model code for us, rather than the tedious and error-prone manual updating of the ORM to match the data model. In fact, the schema loader is so powerful that it’s caught database design flaws for us.
Aside from the great libraries available in Perl, most of which are available on the CPAN, Perl has been around long enough to have a fantastic community. We’re pleased to have attracted a great team of very talented developers with different backgrounds and a fantastic depth of experience. As a result, Tau Station’s missions are varied, the gameplay is thoughtful, and the code itself is a pleasure to work with.
For the database, it was primarily a matter of MySQL versus PostgreSQL and frankly, when you have serious database needs, PostgreSQL beats MySQL hands down. A good database still makes it easy to insert incorrect data (like a misspelled name), but it makes it very hard to insert invalid data (such as an item with a negative weight). In PostgreSQL, we have custom data types, useful check constraints, and non-broken triggers, all things which MySQL has lacked for years. Also, as part of our database development work, we need the DDL (data definition language) to be rolled back if transactions fail, something MySQL does not offer (curiously, Oracle doesn’t either). In fact, there are plenty of things which PostgreSQL offers that MySQL does not. The trade-off is that PostgreSQL is harder to administer, but we feel that data integrity is worth it.
The Front End
Second, we believe in accessibility. If we’re writing a text-based MMORPG and a blind person can’t play it, we’ve failed. If we use colors to convey information within the game and don’t plan for players who are color-blind, we’ve failed. If we don’t support gamers who rely on switch access rather than using a keyboard or mouse, we’ve failed. Simply put, we want everyone to have fun playing Tau Station and we’ve chosen front-end tools that support that goal.
There are, of course, plenty of other technologies involved. We’ve tried to ensure the software can be run on just about any operating system, but Microsoft Windows does not support the fork-exec model of running subprocesses so try as we might, our only developer who worked on a Windows box found that he couldn’t get it to work. Fortunately, the game runs in a Web browser so this is a back end issue that players will never notice.
We use Redis for caching because Redis is wicked fast and just awesome. Nginx was chosen for the Web server for similar reasons. Fluentd is our logging layer due to its incredible flexibility and the fact that we have very heavy logging needs (this is a common issue with MMORPGs: you must know what your players are doing). Most of our database migration needs are handled by sqitch but we’ve had to do some custom work because, like many database migration tools, sqitch is better with DDL than with DML and we have extensive amounts of game data. We also use Markdown for the formatting of player posts and blogs, Plack as a lovely middleware layer between the application and the Web server, and a host of other tools.
A Final Word
So that’s our tech stack, more or less. I’ve been asked “why not C++” or some other, faster language. Many MMORPGs are written in C++, with Python or Lua as a scripting language. However, the reason they use C++ is generally because they’re graphic MMORPGs. We don’t need something like the Unreal Engine, or Unity. In fact, the reason why dynamic languages like Perl are so popular for Web sites is because the performance bottlenecks in Web sites are often I/O (the database) or network latency. For those times we find ourselves CPU-bound, we throw more servers at the problem.
In fact, our primary concern with Tau Station is that the game is “write-heavy” on the database. That’s less common with Web sites, so the database is where we anticipate much of our performance issues will be. Given that many very heavily trafficked Web sites run on Perl, we’re not worried about its performance. C++ would merely have slowed down our development time with no clear gain.
Originally published at taustation.space on August 26, 2016.