Document the Galexie data lake storage format - #2827
Conversation
Add a Data Lake Storage Format page for readers who consume a Galexie data lake directly instead of through the ingest SDK or Stellar RPC. The page summarizes SEP-54 (Ledger Metadata Storage) and links to it as the specification: object key layout, the reversed-sequence hex prefix, the zstd-compressed LedgerCloseMetaBatch payload, the .config.json manifest and the per-object metadata. It also shows the layout of the public AWS Open Data lake with a worked read of one ledger. Link the new page from the Galexie overview, from the Data Organization settings in the Galexie admin guide and from the RPC data lake integration guide. Refs #1605
There was a problem hiding this comment.
Pull request overview
Adds documentation for directly consuming Galexie data lakes, aligned with SEP-54.
Changes:
- Documents object layout, manifests, compression, metadata, and integrity considerations.
- Adds a public AWS data lake example.
- Links the guide from Galexie and RPC documentation.
- Five code fences need
textlanguage identifiers (data-lake-format.mdx:20,30,36,88,107).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
routes.txt |
Registers the new route. |
galexie/README.mdx |
Links to the storage guide. |
galexie/data-lake-format.mdx |
Adds the SEP-54-based guide. |
admin_guide/configuring.mdx |
Connects storage settings to the guide. |
rpc/admin-guide/data-lake-integration.mdx |
Links direct consumers to the guide. |
Suppressed comments (4)
docs/data/indexers/build-your-own/galexie/data-lake-format.mdx:30
- This code fence is missing a language identifier. Mark the partition-name example as
textso syntax handling is explicit.
**docs/data/indexers/build-your-own/galexie/data-lake-format.mdx:36**
* This code fence is missing a language identifier. Mark these batch filenames as `text` to satisfy the docs fence convention.
docs/data/indexers/build-your-own/galexie/data-lake-format.mdx:88
- This code fence is missing a language identifier. Mark the S3 paths as
textso the fence declares its content type.
**docs/data/indexers/build-your-own/galexie/data-lake-format.mdx:107**
* This code fence is missing a language identifier. Mark the worked object key as `text` to comply with the documentation convention.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| ## Configuration file | ||
|
|
||
| Every data store holds a JSON configuration object at `<ledgers-path>/.config.json`. A client reads it to learn the batch and partition sizes before it builds any object key. |
There was a problem hiding this comment.
🤖 Automated message from Kaan's Automated Triage Bot.
Correct, and fixed in 5885d29. LoadSchema in support/datastore/configure.go falls back to the client's own ledgersPerFile and filesPerPartition when readManifest returns os.ErrNotExist.
The section now says SEP-54 requires the file, and adds a line for older stores that do not have it.
|
🤖 Automated message from Kaan's Automated Triage Bot. Verified against SEP-54, the go-stellar-sdk All checks are green at 5885d29. Ready to merge. |
ElliotFriend
left a comment
There was a problem hiding this comment.
this is a pretty good start. i've left some comments throughout the new page. i also want to get the eyes of someone from the data team on this, so our bases are covered.
| sidebar_position: 10 | ||
| --- | ||
|
|
||
| # Data Lake Storage Format |
There was a problem hiding this comment.
this line isn't actually necessary. it's the exact same text as the frontmatter's title field. in the absence of any <h1> tag (or the equivalent in markdown), docusaurus will automatically place an h1 element with the title's value.
| <ledgers-path>/<partition>/<batch>.xdr.zst | ||
| ``` | ||
|
|
||
| Galexie omits the partition directory when [`files_per_partition`](./admin_guide/configuring.mdx#data-organization-optional) is 1. |
There was a problem hiding this comment.
| Galexie omits the partition directory when [`files_per_partition`](./admin_guide/configuring.mdx#data-organization-optional) is 1. | |
| Galexie omits the partition directory when [`files_per_partition`](./admin_guide/configuring.mdx#data-organization-optional) is `1`. |
| s3://aws-public-blockchain/v1.1/stellar/ledgers/pubnet | ||
| ``` | ||
|
|
||
| Testnet resets. Each reset starts a new data store, in a directory named after the reset date: |
There was a problem hiding this comment.
this line has a sentence fragment to begin it. this should be rephrased to maximize clarity.
| The Pubnet configuration file holds one ledger per batch and 64,000 batches per partition: | ||
|
|
||
| ```json title="v1.1/stellar/ledgers/pubnet/.config.json" | ||
| { | ||
| "networkPassphrase": "Public Global Stellar Network ; September 2015", | ||
| "version": "1.0", | ||
| "compression": "zstd", | ||
| "ledgersPerBatch": 1, | ||
| "batchesPerPartition": 64000 | ||
| } | ||
| ``` | ||
|
|
||
| With those sizes, ledger 50000000 falls in the partition that starts at ledger 49984000, so its object key is: | ||
|
|
||
| ```text | ||
| v1.1/stellar/ledgers/pubnet/FD054DFF--49984000-50047999/FD050F7F--50000000.xdr.zst | ||
| ``` | ||
|
|
||
| Download that ledger and print it as JSON with [`stellar xdr decode`](../../../../tools/cli/stellar-cli.mdx#stellar-xdr-decode): | ||
|
|
||
| ```sh | ||
| curl -s https://aws-public-blockchain.s3.amazonaws.com/v1.1/stellar/ledgers/pubnet/FD054DFF--49984000-50047999/FD050F7F--50000000.xdr.zst \ | ||
| | zstd -dc \ | ||
| | stellar xdr decode --type LedgerCloseMetaBatch --input single --output json-formatted | ||
| ``` |
There was a problem hiding this comment.
it feels like the testnet information above interrupts part of this configuration file section. the details about the AWS public lake could be its own section, but the config info here feels like it's more at home in the config section
sydneynotthecity
left a comment
There was a problem hiding this comment.
Overall I think it would be helpful for us to add when you should read directly from the data store yourself versus using RPC or ingest SDK. In this guide we don't make it clear when that would be the recommendation or preferred solution over other data services. Couple nits to improve readability of the page
|
|
||
| Galexie stores ledger metadata in an object store as compressed XDR files. | ||
|
|
||
| Most applications never read those files directly. Read them through the [ingest SDK](../ingest-sdk/README.mdx) or through [Stellar RPC](../../../apis/rpc/admin-guide/data-lake-integration.mdx) instead. Both hide the layout described here. |
There was a problem hiding this comment.
I think this could be written to something that is clearer, like:
Unless you are building for a highly specialized edge case, use the ingest SDK or Stellar RPC rather than reading these files directly. Both tools abstract away the underlying layout described here so your application doesn't have to manage it.
| A data store does not necessarily hold the whole ledger history. List the oldest partition to find where its history starts. | ||
|
|
||
| ::: | ||
|
|
There was a problem hiding this comment.
It would be helpful if there was a full example of the full path + filename so a reader could see how all keys work together
|
|
||
| Every batch in one data store holds the same number of ledgers. Refer to the [XDR](../../../../learn/fundamentals/data-format/xdr.mdx) documentation for more information on the encoding. | ||
|
|
||
| Older data stores use the `.xdr.zstd` suffix instead of `.xdr.zst`. Both suffixes mean Zstandard. A client reads the suffix from an existing object rather than assuming one. |
There was a problem hiding this comment.
I would delete this, idk of any data stores with that standard and we updated all code to use the new zstd suffix
| | `ledgersPerBatch` | integer | The number of ledgers in each batch file. | | ||
| | `batchesPerPartition` | integer | The number of batch files in each partition directory. | | ||
|
|
||
| The Galexie configuration file names the last two values [`ledgers_per_file` and `files_per_partition`](./admin_guide/configuring.mdx#data-organization-optional). |
There was a problem hiding this comment.
This hyperlinking is confusing. I would link file instead
|
|
||
| The Galexie configuration file names the last two values [`ledgers_per_file` and `files_per_partition`](./admin_guide/configuring.mdx#data-organization-optional). | ||
|
|
||
| Older data stores do not hold this file. A client that reads one must get the batch and partition sizes from its own configuration. The Go `datastore` package does that when the file is absent. |
There was a problem hiding this comment.
I would rephrase to reference the old versions of Galexie that do not include the config.json to make this less confusing. Something like "Data stores that are created by operating a version of Galexie X.X or earlier do not use a config.json file...."
🤖 Automated message from Kaan's Automated Triage Bot.
This adds a Data Lake Storage Format page for readers who consume a Galexie data lake directly, instead of through the ingest SDK or Stellar RPC. It summarizes SEP-54 and links to it as the specification: the object key layout, the reversed-sequence hex prefix, the zstd-compressed
LedgerCloseMetaBatchpayload, the.config.jsonmanifest and the per-object metadata. Three existing pages now link to it: the Galexie overview, the Data Organization settings in the Galexie admin guide, and the RPC data lake integration guide.Every fact came from a primary source or a live read:
ecosystem/sep-0054.md, status Draft, updated 2026-01-07.DataStoreSchema.GetObjectKeyFromSequenceNumberingo-stellar-sdk/support/datastore/schema.go..config.jsonand the field names matchDatastoreManifestandmanifestFilenamein the same package..xdr.zst(ZstdCompressor.Name()returnszst);.xdr.zstdis the legacy form the code still reads.LedgerCloseMetaBatchis in stellar-xdrStellar-exporter.xand in stellar-xdr v28.0.0, which the Stellar CLI depends on.Refs #1605 (and not
Closes), because SEP-54 is still status Draft. Please close the issue when you are satisfied with that half.