Modern Treasury has acquired Beam.Build for what's next →

Learn

What is Ledger Sharding?

Welcome to Learn, where we provide straightforward, easy-to-understand definitions of the payments industry.

Follow us

Sharding means dividing your database into horizontal partitions, called shards, which can each store a subset of data. to reduce latency; this often happens when data scales. Within a ledger, sharding is used to split transactions or accounts so that each shard holds a portion of the total ledger.

Some examples of ledger sharding include:

  • Geographic sharding: When partitions are based on geographic datamarkers (e.g., sharding for APAC vs EMEA, or across time zone regions of the US) .
  • Account ID-based partitions: When a certain prefix or key determines which shard to send the data to.

Why Teams Choose To Shard a Ledger

Typically, organizations choose to shard their ledger for:

  • Performance scaling: By distributing transactions, a ledger database can process more transactions simultaneously, improving throughput.
  • Storage management: With each shard holding less data, there is reduced pressure on any single database.
  • Reliability: Sharded databases can be more reliable, helping isolate faults. If one shard goes down, it doesn’t necessarily cause system-wide outages.

The Challenges of Sharding a Ledger

Sharding can also produce challenges, which may include:

  1. Atomicity maintenance: When debits and credits span shards (e.g., in geographic sharding where money movement is international and possibly cross-currency), there is a risk of partial failures. The result is broken all-or-nothing guarantees.
  2. Balance aggregation: Querying total balances across shards can be difficult because of asynchronicity. The risk is not being able to maintain accurate balance checks for compliance or reporting reasons.
  3. Balance drift detection: The standard operating procedures that run checks for balance drifts, or mismatches, are hard to apply across partitions. The risk is subtle mismatches going unnoticed for longer, leading to issues in drift.
  4. Operational complexity: Schema management and migration across shards is harder than if you use a single ledger. The risk is that it’s harder to debug a distributed ledger state, creating a potential for a major operational burden.

To Shard or Not To Shard

Not all ledgers use sharded databases. When to use a sharded ledger vs. when not to will depend on the context of a business. In general:

  • Shard when:
    • A single ledger database hits performance ceilings
    • Accounts are naturally partitionable (e.g., split by region or business unit)
  • Don’t shard when:
    • Transaction volume is still manageable on a single node or database without sharding in place
    • Cross-account atomicity is core to the product and isn’t able to tolerate distributed complexity.

Ledger sharding is powerful, but it doesn’t come without risks. While you can scale and have higher throughput with a sharded ledger database, it also introduces some risks, like partial failures or delayed balance aggregation. Teams need to balance performance needs against consistency and operational complexity.

Try Modern Treasury

Build quickly with a unified API for fiat and stablecoin payments.

Talk to sales
More from

Learn

Ledgers are foundational to any company that moves money at scale. Explore the accounting fundamentals behind the ledgering process, the differences between application ledgers and general ledgers, and more.

A chart of accounts (COA) is an index of all the different accounts within a company’s ledger.

Read more

A Ledger Database is a database that stores accounting data. More specifically, a ledger database can store the current and historical value of a company’s financial data.

Read more

Pessimistic locking and optimistic locking are types of concurrency controls designed to handle concurrent updates in a ledger system, helping prevent race conditions and maintain immutability in financial ledgers.

Read more

Learn the difference between Single-Entry Accounting and Double-Entry Accounting

Read more

Data immutability is the idea that information within a database cannot be deleted or changed. In immutable—or append-only—databases, data can only ever be added.

Read more

GAAP, or Generally Accepted Accounting Principles, is the US system for preparing financial statements. It lays out the rules for how companies measure, present, and disclose their financial performance. The goal is to make reports reliable and easy to compare across businesses.

Read more

ACID stands for Atomicity, Consistency, Isolation, and Durability—the four rules that keep database transactions running smoothly. Together, they ensure every transaction is reliable, predictable, accurate, and intact.

Read more

Every Account in a double-entry ledger is categorized as debit normal or credit normal. Debit-Normal Accounts represent uses of funds (assets, expenses); Credit-Normal Accounts represent sources of funds (liabilities, equity, revenue).

Read more

Balance caching means storing the latest known account balance outside the core ledger for faster reads.

Read more

In the context of software, concurrency control is the ability for different parts of a program or algorithm to complete simultaneously without conflict. Concurrency controls in a database ensure that simultaneous transactions will be parsed appropriately.

Read more

Cryptographic immutability is a powerful tool for securing data, which requires encryption methods on each transaction to guarantee immutability. It’s often used for blockchains and distributed ledger systems to mitigate fraud.

Read more

An API call is idempotent if it has the same result, regardless of how many times it is applied. Inadvertent duplicate API calls can cause unintended consequences for a business, idempotency helps provide protection against that.

Read more

Sharding means dividing your database into horizontal partitions, called shards, which can each store a subset of data. to reduce latency; this often happens when data scales. Within a ledger, sharding is used to split transactions or accounts so that each shard holds a portion of the total ledger.

Read more

A digital wallet (also sometimes called an electronic wallet) is an application that securely stores digital payment information and password data for a user.

Read more

A ledger API allows companies who need to move money at scale quickly and easily access, track, audit, and unify all of their financial data in one place.

Read more

The ledger balance, also called the current balance, is the opening amount of money in any checking account every morning. The ledger balance should remain the same for the duration of the day.

Read more

A ledger (also called a general ledger, accounting ledger, or financial ledger) is a record-keeping system for a company’s financial transaction data.

Read more

A subsidiary ledger is used to keep track of the details for a specific control account within a company’s general ledger.

Read more