Company
Date Published
Author
Nikita Shamgunov
Word count
788
Language
English
Hacker News points
None

Summary

Scaling databases can make even simple tasks, such as counting, seem difficult. However, advances like in-memory storage have made it possible to handle high-throughput tasks at scale without the need for specialized, single-purpose databases. Counters are records that store the count of events by type and time bucket, allowing for fast querying and aggregation. A counter database can be designed using a simple schema, with tables for counters and event types, and can be populated with data using an upsert query. The database can then be queried to retrieve counts of events by type and time bucket, with various SQL queries providing different levels of summary and analysis. In testing, the database demonstrated impressive performance, achieving throughputs of 1.6 million increments per second in a simulated workload, making it suitable for high-throughput applications.