Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

Support FoundationDB Document-Layer store, as an optional alternative to MongoDB #656

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kreinecke
Copy link

The purpose of this feature is to provide an alternative document-based DB option to the current MongoDB backend.
We're replacing MongoDB with FoundationDB in one of our own projects where we leverage the chart-repo and chartsvc components from Monocular - so decided to offer to contribute this feature back to the Monocular project as a configurable option.

FoundationDB combined with its Document Layer https://foundationdb.github.io/fdb-document-layer/ provides a similar DB backend to MongoDB, and is compatible with the official MongoDB drivers. FoundationDB was released under the Apache2 OSL, and offers an alternative to MongoDB, which is now under the SSPL.

Major Changes:
Additional packages have been added to accommodate both foundationdb document-layer and mongodb backend implementations under both cmd/chart-repo and cmd/chartsvc. Code that is common to both implementations has been factored out into separate packages. All pre-existing unit tests for chart-repo and chartsvc have been replicated and ported over to the foundationdb packages to enable consistency in testing of both backends.

The Delete and Sync commands have been modified to accept a "db-type" parameter that is used at run-time to direct handling to the appropriate package. MongoDB is always the default handler if this parameter is not specified.

A local Helm sub-chart has been added to provision the FoundationDB backend deployment and service, if configured through values.yaml. Running the FoundationDB document layer in this way, requires a FoundationDB server container, with a secondary Document-Layer container that acts as a client to it. The application then communicates with the Document Layer only. Both of these containers are configured and coupled appropriately in the subchart. The official FoundationDB Docker images for both the FoundationDB server and the Document Layer did not function correctly on Kubernetes, as the way the components test connectivity between them at runtime was not compatible with Kubernetes networking. We have therefore modified the official foundationDB images for Kubernetes compatibility. The new Helm chart currently pulls these images in from Docker Hub. For now, the chart-repo and chartsvc images as customised by this feature, are also hosted on Docker Hub, and the main Helm chart has been modified to pull from there. A current limitation of the modified images is that at present, the foundationDB instance cannot be internally scaled into a larger cluster. However, we do not currently see this as an immediately limiting factor for Monocular.

The FoundationDB document Layer backend is configured by setting fdbserver=true in values.yaml, (or passing at deployment time). By default, current behavour is preserved and MongoDB is used.

Since we were already developing this for our own purposes, we did not open a feature request in advance. Happy to do so if required. We welcome your thoughts, comments and suggestions, in the PR discussion. Many thanks!

Signed-off-by: Kate E. Reinecke 50168367+kreinecke@users.noreply.github.com

Signed-off-by: Kate E. Reinecke <50168367+kreinecke@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants