0

Use case: I need an user frontend, staff admin (like django-admin), android app,(all Meteor apps). How i can share the same database (and data obviously) through the differents apps. Is DDP the best way?

P.D: I want keep all apps in separated projects, is the correct way?. Can a well app structure fix this?

RodixPy
  • 363
  • 3
  • 15

1 Answers1

0

You could use a single Mongo database for more than one Meteor apps. Usually, with no extra options provided, Meteor runs a Mongo instance locally (if it is not running already) and works with a database in it that's been dedicated to this particular app. What you want to do is to provide your own Mongo connection string to every app you run. For example, when you run an app on Modulus server, you can do it this way:

$ MONGO_URL=mongodb://username:password@someserver.modoulusmongo.net:27017/somedatabase meteor run

Meteor will receive the environment variable and substitute its own Mongo connection string with the one you provided. Use it with different apps to connect them to the same database and enjoy shared storage, identical pub/subs and reactivity out of the box.

rishat
  • 8,206
  • 4
  • 44
  • 69