How Public Grid migrated its billing system from Postgres to Blnk
In 2022, Public Grid set out to make it easier for households to track bills, find savings, and access renewable energy programs. They sit between users and their existing utility providers, helping people understand usage trends, connect to renewable energy programs, and identify opportunities to reduce costs. That model worked well as the customer base grew, but it also increased the variety of billing scenarios the system needed to support.
With tens of thousands of customers across 22+ states in the United States, the team wanted to add more providers, apply credits and incentives, and expand into new markets. The system could issue invoices, collect payments, and record transactions in Postgres, yet it couldn’t maintain a running balance after credits, penalties, or corrections.
“It wasn’t really a ledger per se,” the team said, “we just took transactions as is—one in, another out—and we didn’t really keep a balance.”
Growing beyond bills and invoices
For 4 years, the billing system held up.
“Before, it was just: you have a bill, you pay a bill, and that’s largely it.”
But as the product expanded with more providers and more adjustments, the cracks started to show: every credit, penalty, or correction meant adding more logic to something that was already getting harder to change.
I don’t think it would have lasted particularly long. What we had was just bad, for lack of a better word.
It was just getting in the way of what Public Grid wanted to build next.
The natural fix was to build a proper ledger in-house, and the team scoped it out: persisting balances, queuing transactions, supporting more than one currency, building recovery processes, and introducing the controls needed to keep financial records correct.
The team estimated that a first production version would take roughly the same engineering time as integrating an existing ledger, but they wouldn’t have achieved the same depth of features. It would also make the engineering team responsible for operating and extending the ledger as the product changed. For a lean team, it wasn’t economically advisable.
By the time Zack Schmitz, Public Grid’s founder and CEO, contacted Blnk, the company was actively looking for another option.
A ledger the team could inspect
Public Grid’s engineers wanted infrastructure they could control, inspect, and debug themselves. They also wanted a ledger that could support the workflows they had already designed, without constraining the billing product with a fixed model or technology that would be hard to investigate.
With these requirements, Public Grid evaluated Blnk, TigerBeetle, Formance, Modern Treasury, and a couple other options. Some introduced trade-offs around self-hosting, pricing, or developer experience, while others depended on technology the team did not feel equipped to debug.
“If something went wrong, we wouldn’t know how to debug it,” the engineer said.
Zack first spoke with Blnk about what Public Grid was trying to build, reviewing detailed questions about their balance structure, transaction workflows, money movement design and how Blnk stored its data, as the team was evaluating Blnk against requirements already defined internally. Blnk ticked every box.
We were excited about seeing that the ledger database is in Postgres. It makes it easy for us because we use Postgres as well.
“There wasn’t really any mystery of how it was doing things,” the engineer said. “You can see everything in the ledger and validate yourself that it’s actually doing what it needs to be doing.”
Public Grid found fit with Blnk’s building blocks for their hard requirements: persistent balances, queued transactions, multiple billing services, and multiple currencies.
Once we found Blnk, the conversation became just a lot easier. It handled all of our hard requirements better than anything else.
Three months to production
Public Grid completed the implementation in about three months, largely because the team already had a clear view of the workflows they needed and could handle most of the integration independently. They provisioned a balance for each customer, wired those balances into the new transaction flow, and then focused on the more delicate part of the rollout: migrating historical transactions without losing the context behind any entry.
To get that migration right, the team spent roughly three weeks refining the pipeline with the Blnk team and iterated through several versions before settling on the final process. Once the pipeline was ready, the full history moved over in about four hours without dropping a transaction, and Public Grid switched its billing flow to the new ledger shortly after.
In the end, the implementation took about as long as the team had estimated their in-house ledger would take. The difference: this one was production-ready and had all of the features they wanted.
During the migration, Public Grid monitored errors across its stack, transaction throughput, queue utilization, and end-to-end traceability. But the clearest success signal was simple: whether every dollar in the system could be explained.
After the cutover, the team was able to reconcile without gaps, and each entry could be traced back to its source and forward to the exact balance change it produced.
There haven’t been cases where we had money go missing. Everything is always accounted for. Everything is auditable.
That audit trail changed day-to-day support and operations. When a customer questions a payment, the team could pull up the original transaction and show exactly what happened, without reconstructing a timeline from disconnected tables.
Expanding into new features & a new market
The new ledger gave Public Grid room to evolve the product without accumulating one-off billing logic. The team could easily apply credits and incentives directly to customer balances. Complex money workflows like penalties and corrections were no more edge cases that need workarounds. Blnk easily handled it.
Public Grid’s total transaction count has also tripled since the migration.
The company later expanded from the United States into Canada, while also expanding its fleet of payment providers and utility companies. Public Grid launched in Canada seamlessly, using the same ledger for both USD and CAD balances and transactions.
“I think it’s less about more customers and more about unlocking the ability to scale well.”