0

The constellation of actors I am working with shares a hierarchical structure. Each of those actors needs to save data in a mongodb database. Rather than creating a link to the database for each actor, I thought it would be better if there was a method to inherit this aforementioned link from the top actor to its children.

Is there a way to do that in lieu of the actors inheriting the database name and rebuilding the link each time?

wipman
  • 581
  • 6
  • 22

1 Answers1

1

Another option is to create an actor (or pool of actors behind a router) who are responsible for communicating with the MongoDB, and have your other actors communicate their needs to that actor/pool.

mattinbits
  • 10,370
  • 1
  • 26
  • 35
  • What I did not say is that I encounter this error: `com.mongodb.MongoException$Network: Exception opening the socket`. After some researches, I found that my problem appears because of Linux seeing each connection as an open file (see http://stackoverflow.com/questions/15419325/mongodb-insert-fails-due-to-socket-exception). Your alternative seems a good method to avoid increasing the os `limits`. Thanks. – wipman Sep 16 '15 at 07:50