Skip to main content

A Reactive Game Stack: Using Erlang, Lua and VoltDB to Enable a Non-Sharded Game World

Henning Diedrich (IBM), Robert Virding (Erlang Solutions Ltd.)
Databases & Datastores
Portland 256
Average rating: ***..
(3.67, 3 ratings)

This session will examine a powerful reactive server architecture that uses Open Source dark horses Erlang, Lua and VoltDB to implement a highly concurrent, scalable, analyzable and secure simulation stack.

Attendees will learn how to easily script composable entities using a server environment, purpose-built for event-driven programming, which is scalable under load, resilient in the presence of failures – allowing for modeling of organic behavior – and enables evaluation of huge data sets in real-time.

Erlang is a battle-tested telecoms workhorse language, co-created by co-speaker Robert Virding, which is successfully used for game servers. Lua is a friendly, small language that is big in game scripting. And VoltDB is a high speed, highly secure ACID database from PostgreSQL inventor Mike Stonebraker. The bridge between Erlang and VoltDB was implemented by co-presenter Henning Diedrich.

The stack offers a more scalable and clean alternative to the widespread Java + MySQL / PostgreSQL architectures, specifically for online entertainment. It uses Luerl, Robert’s alternate Lua VM implementation, on top of Erlang to script game logic and VoltDB to persist and share state with a complementary, informational and sales web front-end, as well as to analyze simulation state in real-time. This is all orchestrated by Erlang to provide the concurrent, reactive glue to the stack, showing off the famed concurrency strength of the Erlang VM. The presentation will provide a quick introduction to Erlvolt, the native Erlang VoltDB driver that was benchmarked at up to 2.5 million operations (877k transactions) per second.

This talk will highlight the research and results from the work on this very high-throughput game server concept which aims to maximize robustness, throughput and ease of scripting. Its special feature is a linearly scaling, secure ACID store with a goal of a million transactions per second, while being easy on the game logic scripter. It even allows for hot changes of the game logic, while the game is running—a feature that game programmers have to appreciate when using Unity 3D for front end scripting.

The stack is being created to allow for a unified, non-sharded game world experience, thus for a unified storyline to transcend current, sharding MMO conventions. Players will be enabled to share stories, rather than live in parallel, separate worlds, while at the same time, be empowered to leave a stronger imprint on their environment. Interaction with other players is taken beyond the limitations currently seen in MMOs, as these technical challenges are asking for the fastest possible data access and better data integrity guarantees. Since many game worlds contain paid-for items that can easily be worth hundreds of dollars, data security deserves special attention.

Robert and Henning will describe a triple asynchronous server-side architecture that communicates non-blocking with a light JS/HTML5 demo client. They will also provide a brief overview of the capabilities of new databases and why VoltDB was specifically chosen for the task; among other things, how its use eliminates chores and unsatisfactory workarounds of the past that tried to make things work without true ACID, or even any kind of reliable, fast locking.

The presenters will show benchmarks, provide a live demo and share source samples to explain how to set things up and use the demonstration as a starting point for developers’ own experiments. Robert and Henning will share anecdotes and stupid mistakes to enlighten and entertain the audience, while highlighting the individual strengths and remaining challenges of the Open Source packages (also in the VMs) that they have lined up. In closing, they will say a word about the communities driving the language development of Lua and Erlang, and where and how to get help fast.

Henning Diedrich


Henning is an entrepreneur, programmer and game designer. He is the Lead Software Engineer / Berlin at SumUp, a European mobile POS company. Henning is the creator of the Erlang VoltDB driver Erlvolt and a maintainer of the Erlang MySQL driver Emysql. His Open Source contributions for Erlang, Lua, MySQL and VoltDB are direct results of what pieces he found missing for a better game server stack.

Henning wrote his first games on the C64, develops for the web since Netscape 1.0 and produced his first game server with Java 1.0. He created a language to describe tariffs for AXA and programmed and produced browser games. He founded Eonblast to create a more immersive online game experience and as official cover for the Time Tuner mission.

Starting out on a 1MHz CPU, Henning’s special interest tends to be speed as an enabler. He has talked about evil performance hacks at the annual Lua Workshop, about his record setting Node.js VoltDB benchmark, and was elected to explain ‘Why Erlang?’ to the game developer community at the GDC Online 2012 (15.000 hits on slideshare.) He also contributed the underrated sed script markedoc to the OTP stack, which converts markdown to edoc.

Photo of Robert Virding

Robert Virding

Erlang Solutions Ltd.

Robert is Principal Language Expert at Erlang Solutions Ltd. He was one of the early members of the Ericsson Computer Science Lab, and co-inventor of the Erlang language. He took part in the original system design and contributed much of the original libraries, as well as to the current compiler. While at the lab he also did a lot of work on the implementation of logic and functional languages, as well as garbage collection.

Robert’s passion is language implementation and he created a Lisp Flavored Erlang (LFE) and Luerl, leveraging his intimate knowledge of the Erlang environment, compiler and VM. He did reactive programming long before it became a buzz word. He is also rumored to be the best Erlang teacher on this planet.

Robert has worked as an entrepreneur and was one of the co-founders of one of the first Erlang startups (Bluetail). He worked a number of years at the Swedish Defence Materiel Administration (FMV) Modelling and Simulations Group. And he co-authored the first book (Prentice-Hall) on Erlang, and is regularly invited to teach and present throughout the world.