Description
Is this a new feature request?
- I have searched the existing issues
Wanted change
To de-couple the Unifi Controller from its dependency on MongoDB 4.x, provide a configuration that supports FerretDB, which is protocol-compatible with MongoDB clients, but implements the database as either SQLite or PoestgreSQL.
Reason for change
This removes a dependency on a version of Mongo that will not be supported much longer (Feb 2024 for MongoDB 4.4). Newer versions are not officially supported by Ubiquity, and it's possible they never will be due to licensing changes. Additionally, newer Mongo versions require CPU instruction extensions not present on some devices (Raspberry Pi, Atom/Celeron) that may be in use by users of this container. Building a version of Mongo without this requirement is possible, but the licensing disparity remains.
FerretDB would allow use of the established architecture to continue without the above issues, provided it can provide feature-equivalence for the unifi controller client and suitable performance.
It's not clear what approach Ubiquity will take to solve this issue, if any, so this is an attempt to solve this issue regardless of what they may or may not release in the future.
Proposed code change
Introduce configuration options and examples for using a FerretDB backend instead of MongoDB, and do testing to ensure reliability and indicate performance expectations.
I have started this myself with an experimental fork of this project, but wish to seek input via a feature issue before crafting a branch suitable for a PR. My changes are not yet aligned with the PR requirements, but you can compare to see the fundamental changes which are mainly in environment variable handling.
So far I have successfully instantiated a controller against SQLite and PostgreSQL backends with FerretDB, and restored backup configuration and telemetry into said backends and verified operation through the unifi dashboard. However, I have not yet switched over control of my APs to any of these instantiations, and I have noted that performance with SQLite may be problematic.
Metadata
Metadata
Assignees
Type
Projects
Status