Database expert runs Doom in SQL with just 5,900 lines of code

AI-rewritten: This is a summary of an article from Tom’s Hardware, rewritten by AI (Qwen, running locally) to make it easier to read. The facts come from the original article – read it for the full story.

Tom’s Hardware • Bruno Ferreira • October 4, 2026

In 2026, Lukas Vogel of the SQLDoom project ported the 1993 game Doom to CedarDB, a performance-focused database compatible with PostgreSQL. While the visual display and sound are handled by Python acting as peripherals, all mathematical logic runs inside the database. The original game’s data structure was already highly relational, requiring only 1,000 lines of Python to convert entities from the WAD package into database tables.

The core gameplay loop consists of 5,900 lines of SQL, which is shorter than the original C source code’s 9,000 lines. This reduction occurs because SQL allows parallel updates through a single "UPDATE… WHERE" statement rather than traditional loops. The graphical renderer uses just 1,300 lines but queries 89 tables to handle Binary Space Partitioning (BSP), a method for sorting walls front-to-back using simple sorting commands.

Multiplayer functionality benefits significantly from the database architecture. Maintaining synced states across many tables with complex interdependencies is naturally supported by database transactions. By using "START TRANSACTION," running the logic, and "COMMIT," the system ensures everything synchronizes automatically without extra effort for snapshots or access control.

Source: Tom’s Hardware • Bruno Ferreira • October 4, 2026

Read the original article at Tom’s Hardware →

Leave Comment

Your email address will not be published. Required fields are marked *