> ## Documentation Index
> Fetch the complete documentation index at: https://developers.stellar.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Ledger Backends

> A ledger backend is a source of Stellar network ledger data. The ingest SDK supports two primary ledger backends, both implementing the ledgerbackend interface. This interface always returns ledger data as LedgerCloseMeta, which is XDR-encoded ledger metadata object.

1. **[Captive Core](https://developers.stellar.org/docs/data/indexers/build-your-own/ingest-sdk/developer_guide/ledgerbackends/captivecore.md)** – Invokes the `stellar-core` binary as a subprocess which connects to the live Stellar network and fetches network data (i.e., ledgers).
2. **[BufferedStorageBackend](https://developers.stellar.org/docs/data/indexers/build-your-own/ingest-sdk/developer_guide/ledgerbackends/bufferedstoragebackend.md)** – Retrieves ledger metadata from cloud storage.
3. **[RPCLedgerBackend](https://developers.stellar.org/docs/data/indexers/build-your-own/ingest-sdk/developer_guide/ledgerbackends/rpcledgerbackend.md)** – Retrieves ledger metadata from an RPC server.

Each backend has its own setup and configuration requirements, which are covered in the following sections.

### LedgerCloseMeta Structure

`xdr.LedgerCloseMeta` captures a detailed record of all state changes during the closing of a Stellar ledger. It includes:

* `LedgerHeader` – Metadata about the ledger, including:
  * Ledger sequence number
  * Previous ledger hash
  * Close time
  * Bucketlist hash

* `TxSet` – The set of transactions included in the ledger.

* `TxProcessing` – Execution results of each transaction, including:
  * Success or failure of operations within transactions
  * `OperationMeta`, which tracks `LedgerEntryChanges` caused by transactions

* `UpgradesProcessing` – Any protocol upgrades applied in this ledger.

* `ScpInfo` – Details of the consensus process that finalized this ledger.

* `EvictedLedgerKeys` – Keys of ledger entries removed due to expiration.
