1

I have a Meteor API with with a job collection and I want to create a Meteor app to deploy on multiple servers to work as distributed workers. Will minimongo be present on these servers as well? (as my server side app is not using the browser)

Question is basically, will the distributed workers have access to its own mongo instance even if DDP connection is down?

Michel Floyd
  • 18,793
  • 4
  • 24
  • 39
mrlarssen
  • 325
  • 8
  • 19
  • Can you explain the last question in more detail? What's losing connectivity - the servers to the DB? – David Weldon Apr 08 '16 at 19:53
  • @DavidWeldon Lets say the distributed workers are not able to reach the API for some reason. Will they still be able to write their output to a mini mongo instance so this data shoots across the wire whenever the connection comes back up? Did that help? – mrlarssen Apr 08 '16 at 19:56

1 Answers1

2

In Meteor, each client runs minimongo. On the server Meteor communicates with a mongodb instance. Multiple Meteor server instances of the same application would still communicate with the one mongodb instance. You can even have multiple Meteor applications use a single mongodb instance (a common pattern when creating separate admin UIs).

With regards to your question, if DDP is down then the Meteor clients cannot communicate with the Meteor server application(s) but the latter can still communicate with the mongodb server which means that things like cron jobs can still run.

Michel Floyd
  • 18,793
  • 4
  • 24
  • 39
  • Thank you! What I essentially I want is a minimongo instance running on each of my servers that acts as workers. So it is not possible to run a minimongo instance on these servers as they are not clients? – mrlarssen Apr 08 '16 at 23:21
  • "Not possible" is just temptation to make it so. Given that minimongo is js there's no theoretical reason why it couldn't run on the server. I don't know if anyone has tried.You're basically looking for a virtual js client. – Michel Floyd Apr 08 '16 at 23:27
  • Ok, thank you! I will let you know if I make it work :) – mrlarssen Apr 08 '16 at 23:40