Astraea API Server 0.6.1
An XRP Ledger API server with history you can check.

Astraea and Clio

Astraea answers like Clio 2.8, field for field, and it can stand in for it. Inside they are built differently, each difference has a cost, and in some tests Clio is still ahead.

§How they are built

ClioAstraea
LanguageC++Rust, with unsafe forbidden across the workspace
StorageA separate database server (Cassandra or ScyllaDB)Files on disk, read by the server itself
TransactionsOne row per transaction, compressed by the databaseBlocks in a codec built for XRPL binary objects
StateA row per object version, plus tables to walk keys in orderAn embedded LSM store, kept only from a chosen snapshot onward
Trust in the nodeThe node’s word for what was validatedTrees and hash chain rebuilt before writing, validator quorum checked independently
What you can take awayAn answerAn answer, or a package of evidence you can check offline

The columnar codec is what makes the history small. A ledger’s fields are split into streams of similar values, repeated values go to a dictionary shared by the block, hashes that can be derived from other data are not stored, and state changes that the metadata already gives are rebuilt on reading instead of being kept. The result has to come back byte for byte: a segment is decoded and compared with its input before it is kept.

§Measurements

Sizes were measured on one host with the same mainnet data. Clio 2.8.0 held ledgers 107,245,125 to 107,971,338 in ScyllaDB.

ClioAstraeaNotes
History per ledger on disk99 KB31 KBSee below
Main binary44.8 MB10.7 MBClio also needs its database server
Source, with tests5.9 MB of C++1.4 MB of RustNot the same features: Astraea adds proofs, Clio has more storage backends

History per ledger. For Clio this is everything it keeps for transactions and ledgers (transactions, ledger_transactions, account_tx, ledgers, ledger_hashes), 72.2 GB over 726,214 ledgers, after the database’s compression. For Astraea it is the cold segments that lie fully inside the same range, 18.6 GB over 629,058 ledgers, plus about 9 bytes per transaction for indexes. The two ranges are not identical, and the Astraea figure also includes the state patches that Clio keeps in other tables, so the comparison is on the cautious side, but it is an estimate of about three times, not a benchmark.

Astraea’s whole history, 5.18 billion transactions from ledger 32571, takes 1.08 TB.

§Where Clio is ahead or even

Speed depends on what is being read. These runs are from version 0.2, on one machine, and are recorded in the changelog. The denser blocks of astraea-cold/2 have since added about 7% to reading one uncached transaction.

TestClioAstraea
account_tx, p99, mixed history and state requests7.2 to 8.8 ms5.3 ms
account_tx, p99, pages of 200 from cold history106 ms128 ms
Requests per second, 16 clients, same pages453433

Deep pages of old history are slower on Astraea: it has to decode blocks to read them, which is the cost of the smaller disk. Clio also has years of production behind it and scales out with its database.

§What 0.4 removed

Version 0.4 brings the smaller segment format described in the changelog, and it removes research code that was never part of the server. The cleanup itself changes no format and no answer. The figures below compare the code just before and just after it.

BeforeAfter
Rust, lines including tests46,71637,092
Binaries built by cargo build257
Packages in Cargo.lock282277
Duplicated packages2620

The codec arrived as a copy of a research package, with experiments and measuring tools that were never connected to the server. They are gone, and the codec now follows the same lint rules as the rest of the code.

To check that the cleanup changed nothing, builds from before and after it read seven mainnet segments from different years, 2.42 million transactions, ledger by ledger, and rewrote them. The digests of what each build read were identical, and each rewritten segment came out byte for byte the same as the file on disk.

§How to repeat this

scripts/astraea-clio-bench.py measures latency and throughput of both servers on the same requests, and running.md lists the other comparison scripts. Sizes come from du on the database’s table directories and from the bytes fields in the cold segment manifests.