In the world of software development, memory is precious. But what if there was a database table designed specifically to forget? That is the essence of Pinba, a storage engine for MySQL born in 2009 inside Badoo, the dating platform. Pinba is not a traditional database: it is a monitoring server disguised as a database. Its proposal is radical: it stores real-time statistics of web requests from the last 15 minutes and then discards them forever. Restart MySQL and the data disappears without anyone caring. This programmed amnesia is precisely its greatest strength.
The story of Pinba begins with Andrey Nigmatulin, the creator of PHP-FPM, and Antony Dovgal, a veteran PHP core developer. Both worked at Badoo, an environment with hundreds of PHP servers and continuous deployments. Existing monitoring tools, like Zabbix, indicated that a server was saturated, but not what specific code was causing it. The solution was an engine that receives metrics via UDP packets, without establishing a connection, without waiting for a reply. If the packet is lost, it does not matter: millions are aggregated. If the monitoring server fails, the website does not even notice. That architecture is what makes Pinba inherently safe: a monitoring system that can take down production is worse than no monitoring at all.
Everything lives in RAM, in pre-allocated circular buffers. No disk writes, no I/O operations that could become bottlenecks. Aggregations are computed on the fly as packets arrive. Querying report_by_script_name does not need to scan millions of rows; the answer is already in memory. Thus, with a few simple lines of SQL, a developer can know which pages are consuming the most resources right now, not in yesterday's logs.
However, time takes its toll. The original project stopped receiving updates around 2016. The MySQL storage engine plugin API changed drastically with versions 8.0 and 8.4 LTS. The 2009 code would not compile with modern compilers. Companies relying on Pinba faced a tough choice: freeze their databases on MySQL 5.7 or lose the tool. Until 2024, a backend engineer with two decades of experience, who had used Pinba daily for over ten years, decided that such an end was not acceptable for a tool so well conceived. The fork that revives the project today was born.
The resurrection was not simple. The build system had to be updated from autoconf to CMake, the code migrated to C++23, protobuf handling cleaned up (reusing the runtime MySQL already ships), and the same source tree had to generate separate plugins for MySQL 8.0, 8.4, MariaDB 10.11 and 11.8. Modern tools were added: clang-format, clang-tidy, cppcheck, AddressSanitizer, UndefinedBehaviorSanitizer, CodeQL. It was a work of reverse engineering and adaptation that, according to the author, would have been impossible without artificial intelligence assistance. AI models helped modernize threading code, protobuf handling, and memory management written for a fifteen-year-old database. Every few months the AI tools became smarter and the roadmap expanded.
The result of that effort is an engine that not only works on modern databases but has also revealed bugs hidden for fifteen years. For example, a bug in the initialization of a next pointer in the thread pool's job list caused random crashes in MariaDB, but never in MySQL, because of a coincidence in glibc's memory allocator. LeakSanitizer discovered a slow memory leak when overwriting keys in the report map. CodeQL found unchecked snprintf arithmetic that could overflow buffers. Each of these bugs was small, old, and now covered by tests. If you maintain old C code and have not run it under sanitizers, you likely have unpleasant surprises waiting.
The final part of the resurrection is not code but logistics. A storage engine plugin must match the exact server version. Patch versions are released on their own schedule. To avoid chasing those updates manually, the fork implemented a CI workflow that watches for new MySQL releases, opens automatic pull requests, and after passing tests publishes multi-architecture Docker images (x86_64 and ARM), DEB packages in an Ubuntu PPA, and RPM packages in Fedora COPR. The Docker images are pulled about 3,100 times a month. A tool designed to monitor production is now monitored by robots.
What lessons can we extract from this story for enterprise software development? First, that architectural choices matter more than popularity. Pinba survived because its design decisions — connectionless UDP, circular RAM buffers, in-memory aggregations — were intrinsically robust. Second, that maintaining legacy software is a real challenge requiring investment in modern tools and often in artificial intelligence to accelerate migration. Third, that monitoring should never be a single point of failure. And fourth, that companies need technology partners who understand both legacy and innovation.
At Q2BSTUDIO, we specialize in this kind of transformation. We help organizations modernize their legacy systems, migrate to the cloud (AWS or Azure), strengthen their cybersecurity, and leverage artificial intelligence to automate processes and gain business intelligence with tools like Power BI. If your company uses old databases, monolithic applications, or needs custom software that evolves over time, we can help you make the leap without losing functionality. The story of Pinba shows that even the most abandoned code can be reborn when the right techniques and talent are applied.
For developers who want to try Pinba, the modern fork is available on GitHub. Just run a Docker container with the image xolegator/pinba-engine:8.4, expose UDP port 30002, and point the Pinba PHP extension to that port. In less than a minute, your application will be sending metrics and you can query them with SQL. It is an incredibly simple way to gain real-time visibility into your code's performance without adding operational complexity.
The case of Pinba reminds us that sometimes the best database is the one that forgets. And that, with the right combination of engineering, artificial intelligence, and strategic vision, we can rescue tools that seemed lost forever. At Q2BSTUDIO we believe in that approach: solutions that work today, tomorrow, and ten years from now.





