Database Expert Runs Doom in SQL with Just 5,900 Lines of Code
How SQL Powers a 1990s Shooter
A database specialist has successfully recreated the classic video game Doom entirely within SQL, using only 5,900 lines of code. The project, named SQLDoom, runs at 60 frames per second with full graphics, sound, and multiplayer capabilities. It was announced on October 4, 2026, by developer Lukas Vogel through the CedarDB platform, marking a significant technical achievement in unconventional software implementation.
Breaking news:
SQLDoom builds upon an earlier prototype called DoomQL, evolving into a fully functional version that leverages 89 distinct database tables for its graphical renderer alone. The renderer spans 1,300 lines of SQL code, demonstrating how complex visual processing can be mapped onto relational database operations. Game logic, physics, and audio are similarly encoded using standard SQL queries and stored procedures, allowing the game to run on any SQL-compliant system without external dependencies.
The implementation treats each frame as a database transaction, updating player position, enemy AI, and environmental interactions through iterative queries. Textures are stored as pixel arrays in table cells, while shaders are simulated using mathematical functions within SELECT statements. Multiplayer functionality relies on shared database states, enabling synchronized gameplay across multiple users via standard SQL isolation levels. Vogel emphasized that the goal was not practicality but proving the expressive power of SQL: „We wanted to see how far you could push declarative logic before hitting limits.” Can SQL Really Handle Real-Time Graphics? Despite SQL’s traditional role in data management, SQLDoom achieves real-time performance through query optimization and indexing strategies tailored to spatial data patterns. Frame rates remain stable at 60 FPS on mid-range hardware due to precompiled execution plans and minimized write operations.
The project does not modify SQL engines but works within existing standards, using features like recursive CTEs and window functions to mimic game loops. Critics note high storage overhead, but Vogel argues that modern columnar databases mitigate this concern effectively.
Frequently Asked Questions
How does SQLDoom handle user input without traditional event systems? Input is captured through temporary tables updated by external drivers, which the SQL game loop reads each cycle to adjust player actions in real time.
Is SQLDoom playable on any database system? It runs on any SQL:2016-compliant engine, including PostgreSQL, MySQL, and CedarDB, though performance varies based on query optimizer sophistication.
What inspired the shift from DoomQL to SQLDoom? DoomQL was a minimal proof of concept lacking rendering and sound; SQLDoom expands it into a complete experience using lessons learned from initial table-based sprite experiments.
More stories: