Skip to content

Multiple servers share data mongo database #1419

Closed

Description

@r2DoesInc

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.

Activity

  1. flovilmart commented on Apr 7, 2016

    @flovilmart
    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"
    })
    
  2. r2DoesInc commented on Apr 7, 2016

    @r2DoesInc
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions