An idle night went from 12,222 database reads to 115

How Peexsell's apps stopped asking the database whether anything had changed, and started being told.

Reads between 01:00 and 06:00: 12,222 struck out, 115 after, beside Admin’s API usage page
Client
Peexsell
Year
2026
Services
Internal toolsWeb
Type
In-house product

Peexsell's apps share one Firestore database, and Firestore bills by the document read. In October 2026 we measured what the platform cost to keep open overnight, with nobody using it, and found it reading more than twelve thousand documents between 01:00 and 06:00. This is how that number became 115.

Every screen kept asking the same question

Has anything changed? Admin's bell, its badges and its overview each asked on a timer, and again whenever a tab came back into view. Every API request read the person's own record to check who they were. Scheduled jobs woke on the hour to find nothing due. None of it was wrong on its own. Together it came to more than fifteen thousand reads on an ordinary day, almost all of them answered with no.

We turned the question around

Now the API says when something changes, at the moment it changes. It writes a small signal to the Realtime Database: a counter for a badge, a beacon for a list. Each app listens to the signals it shows and reads Firestore only when one moves, and then only what changed since its last look. A list is read when someone opens it, never because a clock ran out.

One write, one read: a change goes from the API to a Realtime Database signal to the app
One write where the record changes; one read where it is shown.

Polling became a build error

Good intentions drift, so the rule lives in the tooling. A lint rule, peexsell/no-polling, fails the build on any interval or refocus refetch in app code across every app. The rare timer that only moves the interface opts out on its own line, with the reason written beside it. Admin shows reads a day against a budget of 10,000, so a day over budget is a bug to find, not a bill to pay.

What changed

The change went live on 11 October 2026. Between 01:00 and 06:00 the platform read 12,222 documents the night before, then 113 and 115 on the two nights after. A full working day in Admin the next day came to 8,352 reads, under the budget, where the day before had been 17,212.

Reads on three nights: 12,222 before, then 113 and 115
The same five hours, before and after.

Start a project

Ready to start your project?

Let's work together to bring your vision to life. Tell us what you're trying to build and we'll come back with a scope, a price and a date.