Inside Atlassian’s Forge Billing Architecture for Distributed Usage Tracking at Scale
Inside Atlassian’s Forge Billing Architecture for Distributed Usage Tracking at Scale is about how a platform measures app usage across many services, then turns that usage into billing without a mess. The hard part is not counting clicks. It is keeping data correct when systems fail, lag, or repeat work. I have seen this kind of problem at big companies, and it gets ugly fast.
Key Takeaways
- Distributed billing needs **accurate usage events**, not guesswork.
- **Idempotency**, retries, and deduping matter more than fancy charts.
- Good billing design favors **clarity, audit trails, and fault tolerance**.
- Scale exposes weak spots in ownership, timing, and data quality.
- The best systems treat billing as **stewardship of trust**.
What is Forge Billing Architecture for Distributed Usage Tracking at Scale?
Forge billing architecture is the set of services, rules, and storage paths that collect usage from distributed app components and turn it into charges. In simple terms, it decides what happened, when it happened, and how much it costs. That sounds neat on paper. Real life is messier.
At scale, usage does not arrive in one tidy line. It comes from many nodes, regions, queues, and workers, each with its own clock, delay, and failure mode. A user opens an app, an API call fires, a background job runs, and a meter event should be recorded. Then a retry happens. Then a network blip hits. Then someone asks why the bill is off by 4 percent. That is the fun part, if you enjoy pain.
I have worked on systems where billing was treated like an afterthought. Bad idea. When I was at large companies, the teams that got billing right were the ones that respected data as something closer to a ledger than a log file. You do not just count events. You prove them. You keep a paper trail. You expect disagreement between services, then design for it. A little Catholic sense of stewardship helps here too: if you charge for usage, you owe people honesty, care, and a path to audit the numbers.
Forge-style billing usually needs four layers: event capture, normalization, aggregation, and invoice output. Each layer has to survive duplicates, late arrivals, and partial outages. The sources are the problem, not the dashboard. For a plain example of event handling and resiliency, see the official AWS guidance on
distributed systems reliability, the Google Cloud notes on
event-driven architecture, and Atlassian’s own
Forge platform docs.

Core Benefits and Importance
- **Better trust with customers**. If usage is measured well, billing disputes drop. People hate mystery charges. So do finance teams.
- **Cleaner product accounting**. A platform can see which features cost money and which features do not. That matters when you price apps, cap free tiers, or plan margins.
- **Less operational chaos**. When events are normalized early, support teams spend less time arguing over missing records.
- **Stronger audit trails**. Good billing needs proof. That is not optional. It protects both the business and the customer.
- **Fairer charging models**. If the system tracks actual usage, users pay for what they consume, not for what the sales deck imagined.
- **Better engineering habits**. Teams that care about billing usually improve observability, retry logic, and data ownership across the board.
Here is the kicker. Billing systems teach discipline. I have seen this at Amazon and Microsoft, where small data errors became huge money problems when multiplied across millions of events. One bad retry policy can double count usage. One weak schema can break aggregation. One sloppy migration can create a month of refunds. The work is boring until it is not.
Atlassian’s Forge model matters because platform apps run inside a controlled environment, but the usage signals still need to travel through many layers before they become dollars. That means the billing architecture has to stay calm under pressure. It must survive spikes, missed writes, and delayed delivery. If you want a broader look at this kind of system thinking, the Stripe engineering write-up on
billing and payments infrastructure is useful, and the
Patterns of Distributed Systems collection is a good reality check.
I like this topic because it is about fairness. Not in a fuzzy slogan way. In a concrete way. Good billing says, “We measured it, we checked it, and here is the record.” That respects the user’s money and the engineer’s craft. Work should have dignity, and so should the ledger.

Step-by-Step Implementation Guide
1. Define the billable event.
Keep it plain. Decide what counts, what does not, and who owns the rule. If your event definition is mushy, the rest will rot. I have watched teams argue for weeks because no one wrote down the exact trigger.
2. Assign a stable event ID.
Every usage record needs an ID that can survive retries and replays. Without that, duplicate events will sneak in and inflate charges. Frankly, this is where many systems fail before they even start.
3. Capture metadata at the edge.
Record tenant ID, app ID, timestamp, region, plan type, and usage unit close to the source. Do not wait until the data hits a warehouse. Context gets lost fast.
4. Send events through a durable pipe.
Use queues, streams, or event buses with retry support and dead-letter handling. Big systems break. Good systems keep going and leave a trace.
5. Normalize the payload.
Convert strange shapes into one common format. Fix units early. If one service sends seconds and another sends minutes, your finance team will not thank you.
6. Deduplicate aggressively.
Use idempotent writes, fingerprinting, or replay-safe storage. This is not fancy. It is basic self-defense.
7. Aggregate by billing window.
Group usage by hour, day, month, or contract terms. Be careful with late arrivals. I have seen close-of-month jobs re-open because a delayed event landed after the invoice ran.
8. Reconcile against source systems.
Compare totals from event streams, storage tables, and invoice output. Reconciliation is dull. It saves careers.
9. Keep an audit trail.
Store raw events, transformation logs, and invoice version history. If a customer disputes a bill, you need a clear answer, not a shrug.
10. Monitor for drift.
Watch for dropped events, spikes, schema changes, and time skew. A quiet bug is still a bug.
11. Test failure modes.
Kill network links. Replay duplicates. Delay messages. Break the clock. If the billing code only works in the happy path, it is not real.
12. Review the ethics of the charge.
Yes, ethics. Charge only for what was truly used. Respect the customer. That is simple, and somehow it still gets missed.
A useful companion read on sound API design is
IBM’s API overview, while Atlassian’s own platform guidance on
Forge developer docs helps frame what the platform expects from apps. For resilient storage patterns, the
Google Cloud retry strategy notes are also worth your time.
Comparison Table
| Topic | Distributed Usage Billing | Simple Centralized Counter |
|---|---|---|
| Data source | Many services, regions, queues | One app or one database |
| Failure tolerance | High, with retries and dedupe | Lower, fewer moving parts |
| Audit needs | Strong, because money is involved | Moderate |
| Scale fit | Built for heavy traffic | Better for small systems |
| Risk of double count | Real and common if poorly designed | Lower but still possible |
| Operational cost | Higher, but more robust | Lower, but less flexible |
| Best use case | Multi-tenant platforms and app ecosystems | Small tools and simple meters |
Common Mistakes to Avoid
Most guides act like billing is just math. It is not. It is math plus timing plus trust. I have seen teams make the same dumb mistakes again and again, and the fixes are not glamorous.
- **Counting raw events without dedupe**. This is the fastest way to overbill people. Retries happen. Replays happen. Your system has to expect them.
- **Using weak timestamps**. If clocks differ across services, billing windows go sideways. Time is harder than it looks.
- **Mixing business rules with transport code**. Keep charge rules separate from message delivery. Otherwise every change becomes risky.
- **Ignoring late arrivals**. Some teams close the book too early and then wonder why reports do not match. Delayed data is normal, not rare.
- **Skipping reconciliation**. If you never compare totals, you are praying instead of engineering.
- **Hiding the audit trail**. Support and finance need to see what happened. Secrecy creates more work, not less.
- **Treating customer disputes as noise**. They are signals. If enough people complain, the meter is wrong.
Let’s be real: a lot of “best practices” content is copy-paste fluff. Real billing work means you will hit ugly edge cases. At Google, I learned that the boring tools mattered more than the flashy ones. Logs, traces, retries, and clear ownership beat clever code every time. The same rule held at Zulily. If the warehouse system could not explain a count, nobody cared how elegant the code looked.
The better approach is to design like a steward, not a gambler. Keep records. Keep proofs. Keep the person behind the invoice in mind. That is basic justice, not an extra feature.
Frequently Asked Questions
**What is distributed usage tracking?**
It is the process of recording usage events from many services or nodes and combining them into one reliable count for billing or reporting.
**Why is deduplication so important in billing systems?**
Because retries and replays happen all the time. Without dedupe, the same action can be charged more than once.
**How do teams handle late-arriving usage events?**
They use billing windows with grace periods, backfills, and reconciliation jobs so delayed data can still be counted correctly.
**What is the biggest risk in usage-based billing?**
The biggest risk is bad data quality. If the event source is wrong, the invoice will be wrong too.
Final Thought
I still think billing systems reveal a company’s character. Ermenildo Valdez Castro, Jr., Ernie Castro, and the rest of the names people use for me have all sat through enough postmortems to know this: the cleanest systems are not the fanciest ones, but the ones that tell the truth under pressure. That is rare. It should not be.
When I worked on large-scale platforms, the best teams acted like every record mattered, because it did. A user’s trust is not a small thing. Neither is a dollar. If Forge billing is done well, it does more than count usage. It treats work fairly, keeps the books honest, and gives both engineers and customers something solid to stand on.