[NEW BONUS GUIDE + REESTRUCTURE] PostgreSQL + other related #93
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
One of the reasons for using PostgreSQL in LND is to address the inconvenience caused by the current bbolt database. With bbolt, node operators need to restart the node to compact the database, which can take up to 3 hours, particularly in cases with a large number of active channels. This downtime negatively impacts node uptime. By switching to PostgreSQL, this issue can be mitigated, as it offers more efficient database management capabilities without the need for node restarts, ensuring better uptime and operational efficiency.
Regarding this, PostgreSQL will no longer be used in MiniBolt solely by NBXplorer and BTCPay Server, but also by LND. Therefore, the installation/update/uninstallation process will be separated into a bonus guide, and the LND guide will be modified to include the use of PostgreSQL instead of bbolt. The BTCPay Server bonus guide will be restructured too, according to this change.
Why
General reasons to use PostgreSQL:
Several advantages to using PostgreSQL over the default bbolt backend on LND reasons:
Furthermore, the SQL platform opens up possibilities to improve lnd's performance in the future. Bbolt's single-writer model is a severe performance bottleneck, whereas Postgres offers a variety of locking models. Additionally, structured tables reduce the need for custom serialization/deserialization code in lnd, saving developer time and limiting the potential for bugs.
How
bitcoin.conf
file extra Bitcoin Core sectionScope
Test & maintenance
All changes tested by me ✅
Refs:
https://github.com/lightningnetwork/lnd/blob/master/docs/postgres.md
lightningnetwork/lnd#5366
https://github.com/lightningnetwork/lnd/blob/master/docs/release-notes/release-notes-0.14.0.md#postgres-database-support
https://github.com/lightningnetwork/lnd/releases/tag/v0.18.0-beta
Thanks to @blckbx for clarifying the way with this amazing guide: https://blckbx.github.io/lnd_postgres/