Skip to content

Need to manage MongoDB indexes yourself #36

Description

@davidaik

From the Parse Server guide-

When using MongoDB with your Parse app, there are some differences with the hosted Parse database:

You need to manage your indexes yourself. Hosted Parse automatically adds indexes based on the incoming query stream.
You need to size up your database as your data grows.

I don't have any experience with MongoDB, so I would like to know if the requirement for manual management of the db will be hard work or could the Parse Server codes be updated to manage the MongoDB automatically? I'm wondering if this is a thing that can be smoothed out.

Activity

  1. natanrolnik commented on Jan 29, 2016

    @natanrolnik
    Contributor

    +1

  2. wagnercsfilho commented on Jan 29, 2016

    @wagnercsfilho

    +1

  3. kingmatusevich commented on Jan 29, 2016

    @kingmatusevich

    +1

  4. talkaboutdesign commented on Jan 29, 2016

    @talkaboutdesign

    +1 Have zero experience with this. What does this actually mean?

  5. flessard commented on Jan 29, 2016

    @flessard
    Contributor

    +1

  6. rebelchris commented on Jan 29, 2016

    @rebelchris

    +1

  7. davidaik commented on Jan 29, 2016

    @davidaik
    Author

    @talkaboutdesign I don't have much experience with databases but iirc indices are very important for the database performance. If the index management is done automatically by properly implemented code, we'll have less server-side stuff to worry about, which is the reason why Parse is so popular in the first place.

  8. mauran commented on Jan 29, 2016

    @mauran

    +1

  9. skinp commented on Jan 29, 2016

    @skinp
    Contributor

    Automatic indexing is a very hard problem. At Parse, it required hundreds (if not thousands) of engineering hours to build and a sizable dedicated infrastructure... and we still don't believe it's anywhere near perfect. In all cases, the person querying the DB (the app developer in this case) is always the best person to know which indexes are going to be needed and optimal for a particular query.

    The good news is, for anyone migrating their existing app to a different Mongo database using the migration tool, all the existing indexes are also migrated. You will still have to add new ones or remove unused ones yourself though.

    That said, I guess this could be added to parse-server eventually. It was most likely too complex for this version. As always, PR welcome...

  10. davidaik commented on Jan 29, 2016

    @davidaik
    Author

    @skinp hmm I guess I'm gonna have to learn MongoDB and Node.js. With the shutting down of Parse, if I am to continue using the Parse client sdk, it looks like I'm actually gonna have to participate in the development of this project.

  11. kingmatusevich commented on Jan 29, 2016

    @kingmatusevich

    @davidaik We're all in the same boat here, but we have an opportunity to make Parse something even better than it ever was.

  12. davidaik commented on Jan 29, 2016

    @davidaik
    Author

    @kingmatusevich I learnt of the sad news this morning and have been worndering since about whether to keep using the Parse SDK or to move to another service. But now I've decided to stick with it. I'm slowly starting to see Parse Server becoming big and awesome like Wordpress, or at least I hope so.

  13. rawrmaan commented on Jan 29, 2016

    @rawrmaan

    I'd highly recommend deploying your MongoDB instance on http://www.mongolab.com/ if you care about this feature. They have a feature that automatically suggests indexes to add to your DB based on usage patterns and you can add an index with one click.

  14. jamesyu commented on Jan 29, 2016

    @jamesyu

    Yep, if you use Parse Server, you will need to understand MongoDB, and also specifically indexing. Doing this automatically at Parse for each app was a hard problem because we had to solve the general use case, but, managing it for your own app with moderate traffic isn't too difficult (and as mentioned, folks like MongoLab actually suggest indexes for you).

    It is no different than using Rails with MySQL. In that case, you would have to manage your indexes in MySQL. You should understand what queries your app is making, and add the proper indexes to ensure those queries are efficient.

  15. davidaik commented on Jan 29, 2016

    @davidaik
    Author

    @rawrmaan @jamesyu I was thinking that using MongoLab has the possibility of turning out to be the same as with Parse. What if they decide to shut down their service at some point? I know that in such a case, my data can be migrated easily. But then I think that having complete control over the database will be better now that we have to host the server code ourselves anyway.

  16. jamesyu commented on Jan 29, 2016

    @jamesyu

    As you mentioned, migrating from a DBaaS like MongoLab will be much easier than something like Parse, so I wouldn't worry about that so much. However, you can also just host your own MongoDB on your own box or deploy to aws https://s3.amazonaws.com/quickstart-reference/mongodb/latest/doc/MongoDB_on_the_AWS_Cloud.pdf (yes, the AWS instructions are much more daunting, which is why I would recommend a DBaaS at least as a first experience).

  17. kingmatusevich commented on Jan 29, 2016

    @kingmatusevich

    ��@davidaik right there with you, except I found out last night.

  18. davidaik commented on Jan 29, 2016

    @davidaik
    Author

    @jamesyu thanks for the suggestions. I will likely be using MongoLab, but I'll also be looking into hosting my own MongoDB if my use-case doesn't make it too hard.

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