support MongoDB
See original GitHub issueHi there, do you have any plan to add MongoDB support? if not, i would like to do it by myself, but seems the lib/service/README
document is out-dated, so is there any updated guide?
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
MongoDB Support Hub
With enterprise-grade support from MongoDB, you get access to a technical support experience that is engaged, authoritative, and comprehensive.
Read more >Technical Support — MongoDB Manual
For technical support questions, please log into your MongoDB Cloud account and open a support ticket. MongoDB Enterprise or Ops Manager. For technical...
Read more >Contact Us
Have a general question? ; United States, +1 844-666-4632 ; Europe, the Middle East, and Africa, +44 203 930 0584 ; Australia &...
Read more >MongoDB Support Policies
Whichever MongoDB product you're using, find the support policy quickly and easily.
Read more >Technical Support — MongoDB Manual
For technical support questions, please log into your MongoDB Cloud account and open a support ticket. MongoDB Enterprise or Ops Manager¶. For technical...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@xbill82 and kuzzle team thanks for the such detailed response! It is the same cool as your documentation. I have some thoughts (and maybe suggestions) about kuzzle database layer. I will give a full answer later.
I’ll start from the abstract things. This should help to understand my point of view. And I’m sorry about my bad english 😅
Kuzzle has real nice features. Events and hooks, build-in auth and permissions, transport agnostic, pub/sub with server filters, client libraries, plugins, scaling and very good code quality can help to make awesome things.
It might give the impression that it is very easy to develop you own backend based on kuzzle. Unfortunately this is not true. Kuzzle is very egocentric. What do I mean? Kuzzle allows you to extend himself but it makes you suffer.
How can you extend some backend frameworks? It’s simple in most cases:
What should you do to extend kuzzle with new controller? I didn’t try to create controller yet so steps are from documentation:
package.json
with plugin options inpluginInfo
(yes controller must be npm package)controllers.js
with configuration (mappings?)routes.js
with routescontroller.js
with controller codeSo, what if I need 10 controllers with different behaviour? So much boilerplate code.
Kuzzle looks monolithic from outside. Just like big square with “KUZZLE” from your answer. You don’t use kuzzle but kuzzle uses you code with many configs you must provide.
Main idea is Kuzzle should be more flexible for using and extending. It should not be blackbox running inside docker!
Ok, now lets return to databases.
You wrote
ElasticSearch is not meant to be used as a so-called "master" database
. But what do kuzzle keep inside ES? Users and roles. Is it important data? I think so and I don’t want to keep this data inside search engine only. I can copy it to my own database but kuzzle will still use ES for auth. Yes I know I can rewrite passport strategy. And I am not sure what to do with roles.What is about writing my own controller to other database? Yes it’s possible. And of course I would like to get all kuzzle features. So I need to notify kuzzle about document modifications and send events to plugins. In result 99% of my controller will be same as your
read
andwrite
controllers except engine calling. And if you will change some internal kitchen (renamekuzzle.notifier.notifyDocumentCreate
tokuzzle.notifier.notifyDocumentCreated
for example) I will need to modify my controller.Can I use client libraries out of the box with my controller? No.
write
andread
controllers are hardcoded inside code.Ok, so what I need to use my own database?
storage controller
(with complex connecting to kuzzle)storage engine
passport strategy
(to keep users inside my own database)client library(es)
And as result I will get 3 running databases! Is it all ok? Maybe ElasticSearch is good database but kuzzle is too hard depends on it.
My suggestion is to develop database abstraction layer.
First of all
read
andwrite
controllers should be combined intostorage
controller. They perform one function to provide access to persistent storage. Some actions (likenow
andserverInfo
) should be moved out fromread
controller toinfo
orserver
controller.In simple case
storage
controller should use some internal component to select storage backend based on collection name. In more complex cases it should has ability to select backend with dynamic function (just like permission system works). We can keep part of data in one storage, part in another storage and part in both for example.Also it need to add new plugin type (
storage
for example) to provide access to different databases. Common interface for such plugins should be designed.Also it’s need to remove
internalStorage
and add ability to choose any database storage. As optionredis
can also bestorage
plugin and support part of this interface.Thank you for attention!