-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NEW BONUS GUIDE + REESTRUCTURE] PostgreSQL + other related #93
Conversation
Linking LND's PR to unleash the power of concurrent access for PostgreSQL, aimed to be merged in next release 0.18: lightningnetwork/lnd#8644 |
Uhm...interesting...one more reason to use PostgreSQL as the database backend for LND, but I'm not sure they include it on v0.18, I can't see anything on the milestone or roadmap of v0.18, yet: https://github.com/orgs/lightningnetwork/projects/6 |
You're right! The replaced PR was planned for 0.18: lightningnetwork/lnd#7992 |
Ready for the merge! Let's go to the main! |
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 and Nostr relay. 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 and for Nostr relay, SQLite.
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/