Database Expert Runs Classic Doom Entirely Within SQL Database
A database specialist has achieved a monumental feat by running the classic first-person shooter Doom entirely within a SQL database using just 5,900 lines of code, challenging conventional wisdom about database capabilities.
✨ This content was summarized and interpreted by AI; it may contain errors — please verify accuracy with the original sources. Learn more
Listen to this story

A database expert has achieved a monumental feat, running the classic first-person shooter Doom entirely within a SQL database using just 5,900 lines of code, a project dubbed "SQLDoom" that represents a significant leap from its embryonic predecessor, DoomQL. This audacious undertaking, developed by database specialist Fabian Keller, is not merely a technical curiosity but a profound demonstration of the unexpected computational elasticity and often-underestimated processing power inherent in relational database management systems (RDBMS). The fully featured SQLDoom goes beyond a simple proof of concept, complete with a 1,300-line graphical renderer that intelligently spans 89 distinct database tables to manage game states, rendering, and logic.
This development matters deeply, challenging conventional wisdom about the role and capabilities of SQL databases. Traditionally seen as passive data repositories, SQLDoom redefines them as active computational environments, capable of executing complex, real-time logic previously thought exclusive to general-purpose programming languages and dedicated game engines. For users and developers, this project underscores the often-untapped potential within existing infrastructure, suggesting that with innovative approaches, databases could perform more sophisticated, integrated functions directly, potentially reducing the need for middleware or external processing layers in certain applications. Imagine business intelligence dashboards that not only query data but also simulate complex scenarios or render interactive models entirely within the database, offering unprecedented speed and coherence by eliminating data transfer bottlenecks. The industry impact is equally significant, prompting a re-evaluation of database design principles and optimization strategies. If a database can handle the ray-casting and sprite rendering necessary for Doom, albeit at lower frame rates than a dedicated engine, it suggests a frontier for highly optimized, in-database analytics, simulations, and even specialized graphical applications where data locality is paramount. It forces database vendors and architects to consider enhancing SQL's procedural capabilities and optimizing its execution engine for more dynamic, stateful computations, moving beyond its traditional declarative paradigm.
The journey to SQLDoom began with DoomQL, Keller's earlier, more rudimentary attempt to run Doom in SQL. While DoomQL laid the groundwork, demonstrating the theoretical possibility, SQLDoom represents a matured, more robust implementation. The earlier version likely focused on basic game state management and simple rendering, akin to an ASCII art version, whereas SQLDoom integrates a full graphical renderer, showcasing a far greater command over SQL's procedural extensions and data manipulation capabilities to simulate a 3D environment. This evolution highlights a significant improvement in both the complexity of the SQL code and the ingenious use of database structures to represent game elements and rendering pipelines. Compared to traditional game engines like Unity or Unreal, or even bespoke C++ engines, SQLDoom is orders of magnitude slower and less efficient for real-time graphics. However, the comparison is fundamentally flawed; SQLDoom isn't trying to compete on performance but on demonstrating computational universality and pushing the boundaries of what a database can fundamentally *do*. Other unconventional "engines" like running Doom in Notepad or an oscilloscope exist primarily as novelty acts, showcasing the ingenuity of individuals but rarely hinting at broader practical implications. SQLDoom, by contrast, operates within a structured, widely adopted enterprise technology, lending it a unique gravitas and potential for cross-pollination of ideas back into mainstream database applications.
Looking ahead, SQLDoom is unlikely to usher in an era of SQL-powered gaming consoles, but its true legacy will lie in accelerating the development of more sophisticated in-database analytics and computational frameworks. The techniques employed to manage complex state, render graphics, and execute game logic within SQL could directly inform new approaches to data visualization, real-time fraud detection, complex event processing, and even machine learning inference directly within the database. Database architects might explore enhanced indexing strategies for spatial data or temporal sequences, inspired by how SQLDoom manages its game world. We could see a push for more powerful, standardized procedural extensions to SQL across different RDBMS platforms, allowing developers to build more intricate, data-centric applications without constantly shuttling data between the database and external application layers. Furthermore, SQLDoom serves as an extreme stress test and a fascinating case study for database optimization, prompting research into how database engines can be made even more efficient at handling highly iterative, stateful, and computationally intensive workloads that deviate from typical transactional or analytical queries. The project fundamentally alters the perception of SQL from a query language to a surprisingly versatile computational substrate, opening new avenues for innovation in how data is processed, analyzed, and even presented.