[GH-ISSUE #1473] external database for self-hosted netbird #2506

Closed
opened 2026-08-05 00:47:31 -04:00 by saavagebueno · 2 comments
Owner

Originally created by @TSJasonH on GitHub (Jan 16, 2024).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/1473

Is your feature request related to a problem? Please describe.
slow performance for user logins/activity viewing and sqlite locking on larger environments
see #1470

Additionally, the events.db file seems to grow quite large very quickly. This could serve to minimize bloat on the docker host.
I have only 11 users and 10 peers. The events.db file is already nearly 1GB in size.

Describe the solution you'd like
a method to define an externally usable database server in the StoreConfig section
postgresql seems like the most viable candidate

additionally a migration tool akin to the one which moves existing data between json and sqlite options

Describe alternatives you've considered
mariadb or mysql could be possible solutions as well

Additional context
Having an external DB would also simplify backups and migrations of the base docker host.

Originally created by @TSJasonH on GitHub (Jan 16, 2024). Original GitHub issue: https://github.com/netbirdio/netbird/issues/1473 **Is your feature request related to a problem? Please describe.** slow performance for user logins/activity viewing and sqlite locking on larger environments see #1470 Additionally, the events.db file seems to grow quite large very quickly. This could serve to minimize bloat on the docker host. I have only 11 users and 10 peers. The events.db file is already nearly 1GB in size. **Describe the solution you'd like** a method to define an externally usable database server in the StoreConfig section postgresql seems like the most viable candidate additionally a migration tool akin to the one which moves existing data between json and sqlite options **Describe alternatives you've considered** mariadb or mysql could be possible solutions as well **Additional context** Having an external DB would also simplify backups and migrations of the base docker host.
saavagebueno added the feature-requestself-hostingstore labels 2026-08-05 00:47:31 -04:00
Author
Owner

@MrChenhtlss commented on GitHub (Jan 16, 2024):

Yes, I also think so. If there is a good solution, please

<!-- gh-comment-id:1894873239 --> @MrChenhtlss commented on GitHub (Jan 16, 2024): Yes, I also think so. If there is a good solution, please
Author
Owner

@TSJasonH commented on GitHub (Apr 3, 2024):

I would like to add, that the ability to scale-out the database to a separate host seems like a good capability.
I have 370 Users and 141 Groups in my self-hosted instance. Most of them work during the 9-5 hours. The management service struggles to keep up during this time.
(The VM has 16 cores and 16GB of RAM and it looks like it will need more RAM soon)

Offloading all the i/o related to the DB would help at least a little in freeing up resources.

I am also happy to report that after the fix in #1470 the db files have not grown huge:

[root@netbird _data]# ls -lah
total 74M
drwxr-xr-x 2 root root  102 Apr  3 15:54 .
drwx-----x 3 root root   19 Dec 22 15:00 ..
-rw-r--r-- 1 root root 2.9M Apr  3 15:46 events.db
-rw-r--r-- 1 root root  60M Mar  1 07:02 GeoLite2-City.mmdb
-rw-r--r-- 1 root root 9.1M Mar  1 07:02 geonames.db
-rw-r--r-- 1 root root 1.5M Apr  3 15:54 store.db
<!-- gh-comment-id:2035500559 --> @TSJasonH commented on GitHub (Apr 3, 2024): I would like to add, that the ability to scale-out the database to a separate host seems like a good capability. I have 370 Users and 141 Groups in my self-hosted instance. Most of them work during the 9-5 hours. The management service struggles to keep up during this time. (The VM has 16 cores and 16GB of RAM and it looks like it will need more RAM soon) Offloading all the i/o related to the DB would help at least a little in freeing up resources. I am also happy to report that after the fix in #1470 the db files have not grown huge: ``` [root@netbird _data]# ls -lah total 74M drwxr-xr-x 2 root root 102 Apr 3 15:54 . drwx-----x 3 root root 19 Dec 22 15:00 .. -rw-r--r-- 1 root root 2.9M Apr 3 15:46 events.db -rw-r--r-- 1 root root 60M Mar 1 07:02 GeoLite2-City.mmdb -rw-r--r-- 1 root root 9.1M Mar 1 07:02 geonames.db -rw-r--r-- 1 root root 1.5M Apr 3 15:54 store.db ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#2506