Software DevelopmentOctober 3, 2026· 4 min read

Executing Hell: How a Developer Got Doom Running Entirely Inside an SQL Database

Aziz Kerkeni
Aziz Kerkeni

The Endless Ticking Clock of Retro Porting

For decades, the developer community has shared an unspoken, whimsical challenge: if a device has a processor and a screen, it must eventually run Doom. Over the years, this has birthed an eccentric lineage of hardware ports running id Software's seminal 1993 masterpiece on everything from digital cameras and smart thermostats to pregnancy tests and oscilloscope screens. Yet, pushing the boundaries of what constitutes a 'computer' has taken a delightfully absurd turn into the realm of enterprise software and data management systems.

Rather than relying on raw silicon clock cycles or physical embedded hardware, a recent project has achieved the unthinkable by squeezing the chaotic corridors of Hell into a relational database. By leveraging the expressive power of standard database querying languages, this feat highlights both the extreme dedication of modern tinkerers and the surprisingly robust computational capabilities hidden deep inside software environments that were never meant to render graphics.

Rewriting the Engine in Pure Queries

At the heart of this accomplishment lies a compact script of roughly 1,300 lines of SQL. Rather than writing procedural code that tells a machine step-by-step how to advance through memory, the author had to frame the state machine, rendering pipeline, and game loop inside the declarative paradigm of database queries. Relational databases are optimized for retrieving, filtering, and organizing tables of data, not for performing real-time frame buffer updates or managing spatial audio.

To bypass these structural limitations, the database engine essentially treats game states, pixel buffers, and raycasting calculations as relational datasets. Every tick of the game loop becomes an iterative query execution, transforming rows and columns into geometry, walls, and enemies. Achieving a playable framerate—reported at an impressive 35 frames per second—required meticulously optimizing queries to avoid heavy performance penalties typically associated with complex relational joins and unindexed table scans.

Why Relational Databases Make Terrible Game Engines

From an architectural standpoint, relational databases and game engines sit on opposite ends of the software design spectrum. Databases are built for ACID compliance, transactional integrity, and massive concurrent data storage, prioritizing consistency and durability over raw, volatile frame-rendering speed. A traditional game loop, conversely, demands predictable milliseconds of execution time, direct memory access, and fine-grained control over hardware interrupts and GPU pipelines.

Forcing a database to act as a graphics engine exposes the inherent Turing completeness of modern query languages. While SQL is designed to retrieve data, extensions and recursive Common Table Expressions (CTEs) grant it enough computational weight to simulate complex state transitions. However, doing so requires contorting the query engine into ways database administrators would likely classify as a performance nightmare. It is a brilliant exercise in bending a tool far beyond its intended design specifications.

The developer community's fascination with these esoteric ports is far more than a simple meme. It serves as a masterclass in deeply understanding system constraints, memory management, and algorithmic optimization. When a developer attempts to run Doom inside an unexpected environment, they are forced to deconstruct a complex software system down to its mathematical fundamentals and rebuild it using unconventional primitives.

This kind of deep hacking encourages engineers to look past the surface abstractions of modern tech stacks. It demonstrates that with enough creativity, seemingly rigid boundaries imposed by language design or infrastructure architecture can be creatively bypassed. While running a video game inside a database query tool has virtually no practical enterprise applications, the mental muscles flexed during such an endeavor frequently translate into better problem-solving skills for everyday software engineering challenges.

The Broader Impact on Developer Culture and Esoteric Computing

Esoteric programming and unconventional hardware ports occupy a cherished space in hacker culture, bridging the gap between high-level computer science theory and pure creative expression. Projects like this inspire junior and senior developers alike to experiment without the pressure of commercial viability or performance benchmarks. They remind the industry that software development can still be a playful, exploratory art form rather than just a commercial production pipeline.

Furthermore, these projects occasionally shed light on overlooked capabilities within mature technologies. By pushing an SQL engine to its absolute limits, the project tests the efficiency of the underlying query optimizer, memory allocation strategies, and execution planning algorithms. Database maintainers themselves often look at these extreme edge-case stress tests with a mix of amusement and genuine technical curiosity about how their software behaves under bizarre workloads.

Looking Ahead at the Limits of Computation

As long as there are query languages, virtual machines, and computing layers left to explore, engineers will continue finding inventive ways to port classic titles to places they never belonged. While a database-driven Doom will not replace traditional game development pipelines or modern cloud architectures, it stands as a testament to human ingenuity and the sheer joy of digital tinkering.

Ultimately, this project cements a wonderful truth about modern technology: if software is flexible enough, you can turn just about any system into a playground. As developers continue to push the envelope of what is possible with declarative languages, we can only wait to see what unexpected environment hosts the next iteration of id Software's legendary creation.

Source: arstechnica.com