Connecting from an admin Interface?

So let’s say I have a Music app running, and I am trying to create a backend(another app) that can perform CRUD on the database.

I am thinking of connecting with DDP and use methods for that or

Connecting directly to the MongoDB of the Music app

Thoughts?

Yes you can. We have multiples apps connecting to the same database. It’s common, especially before code-splitting.

Okay there two ways to do that too , off DDP new Mongo.Collection or Mongo-Node-driver.

Are Collections created off DDP subjected to allow/deny rules of that connection or otherwise (create a new one) ?

sorry I don’t really understand the question. We have multiple Meteor apps connected to the same database. Some collections are shared between them, and are fully reactively (DDP). Those subscriptions are publications are managed by the applications, so they are completely independent. Try it.

As in, instead of having:

App 1 -> MongoDB  // App 1 accesses DB directly
App 2 -> App1 -> MongoDB // App 2 accesses DB via App 1

You can have both talk to the same db:

App 1 -> MongoDB  // App 1 accesses DB directly
App 2 -> MongoDB // App 1 accesses DB directly

By setting the same MONGO_URL in their environment variables.

Because Meteor watches the DB for changes, App 1 will pick up when something changed in the db, regardless of who did it (ie App 2)

1 Like

Yeah , I understand this way . let’s say App2 has its own MONGO_URL . Its like another app . It will control other Apps(i.e connect to there DB and perform CRUD )