Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple servers share data mongo database #1419

Closed
r2DoesInc opened this issue Apr 7, 2016 · 2 comments
Closed

Multiple servers share data mongo database #1419

r2DoesInc opened this issue Apr 7, 2016 · 2 comments

Comments

@r2DoesInc
Copy link

Check out this issue for an ideal bug report. The closer your issue report is to that one, the more likely we are to be able to help, and the more likely we will be to fix the issue quickly!

For implementation related questions or technical support, please refer to the Stack Overflow and Server Fault communities.

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!

Parse server(s), dashboard, and mongo database running via docker.

Everything works fine with one server. I added another server for a new app, linked the same mongo database container to the bother parse-server instances, and when i got to my dashboard, the apps are sharing data. I would have expected the parse-server to be using some sort of unique identifier allowing multiple apps to share a database, but i am not that familiar with how mongo works.

I can "fix" this easily enough by having each server use its own mongo instance, but I just want to make sure Im not doing something wrong with my current implementation.

@flovilmart
Copy link
Contributor

use the collection prefix or a different mongoURL

mongodb://my.server.com/appId_1
mongodb://my.server.com/appId_2

This will use the same server but different databases

The other option is to use the collectionPrefix option with a single mongoURL:

// first app
new ParseServer({
  collectionPrefix: appId1,
  databaseURI: "mongodb://my.server.com/parse"
});

// other server, second app
new ParseServer({
  collectionPrefix: appId2,
  databaseURI: "mongodb://my.server.com/parse"
})

@r2DoesInc
Copy link
Author

Coolio, I knew there had to be something. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants