Browsing through src code, saw below line in https://github.com/stellar/stellar-core/tree/master/src/database:

The Database object manages connections to an SQL database, in which the current ledger state and several auxiliary tables are stored.

Am trying to understand requirements realted to sharding, load-balancing, failover, backups and other database related adminstrative tasks for a basic/full validator node.

Post How big is the ledger? lists ledger count as of Jan 18 as 15734806

Will each transaction in stellar, result in a row in the SQL database table?.

Any thoughts on database adminstration requirments related to stellar?

1 Answer 1


The SQL database can be thought of as a simplified view of the ledger state stored in the bucket list. As such the only data that stellar core relies on is account based not transaction based.

Now there are a couple tables (txhistory and txfee) that contain transactions and their related metadata for the purpose of being exported to Horizon.

As you can imagine those tables grow pretty fast if not managed properly.

In versions up to 9.1 of Stellar core (the current version) database maintenance was delegated to the operator of the nodes, but it turned out that most people were not doing it, so in the next release (9.2) we’ve added this “automatic maintenance” as part of stellar-core that will automatically clean things up.

The idea is that after Horizon has ingested ledger data it can safely be deleted from stellar-core tables.

This will drop the size requirement significantly: I imagine that with a 2TB node you’ll have enough space for years to come.

The relevant pull request if you’re curious is Automatic maintenance

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.