Skip to content
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

MongoDB Database Connector #141

Open
hongkongkiwi opened this issue Nov 29, 2019 · 2 comments · May be fixed by smallstep/nosql#52
Open

MongoDB Database Connector #141

hongkongkiwi opened this issue Nov 29, 2019 · 2 comments · May be fixed by smallstep/nosql#52

Comments

@hongkongkiwi
Copy link

What would you like to be added

I would love to have a MongoDB database connector.

Why this is needed

All our other services use MongoDB and I would love to keep everything unified in one database system.

Failing that, is it possible to provide a pluggable webhook that we can have and then enter into our own database?

@dopey
Copy link
Contributor

dopey commented Dec 2, 2019

Hey @hongkongkiwi, thanks for opening an issue / feature-request! Unfortunately, I don't think we'll have time in the very near term to work on this, however we would welcome a contribution if you (or anyone else reading this) were so inclined.

The interface to the storage backend is very simple (https://github.com/smallstep/nosql/blob/master/database/database.go#L79-L103). We've got implementations for 2 databases in that same repo (badger and mysql).

I'm not sure how a pluggable webhook would work here. I assume that's the function that the interface is serving, but I might be misunderstanding your suggestion.

@TheSecMaven
Copy link
Contributor

this would be a good feature! mongodb is much more common than mysql and more friendly in enterprise use cases

@dopey dopey added the area/db Databases label Nov 18, 2020
elasticspoon added a commit to elasticspoon/nosql that referenced this issue Jan 11, 2024
This commit adds a MongoDB connector.

A couple of things to note:
- To enable transactions the database must a replica set,
I made the connection fail if the condition was not met.

MongoDB is a document database, thus concepts translate as:
bucket/table = collection
key = document
value = document value

Note: mongo will automatically create a collection
if a operation is attempted on one that does not exist.
For example: if you delete a table, then call list to
check for the contents of the table it will be recreated.

closes smallstep/certificates#141
elasticspoon added a commit to elasticspoon/nosql that referenced this issue Jan 11, 2024
This commit adds a MongoDB connector.

A couple of things to note:
- To enable transactions the database must a replica set,
I made the connection fail if the condition was not met.

MongoDB is a document database, thus concepts translate as:
bucket/table = collection
key = document
value = document value

Note: mongo will automatically create a collection
if a operation is attempted on one that does not exist.
For example: if you delete a table, then call list to
check for the contents of the table it will be recreated.

closes smallstep/certificates#141
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants