Should I use MongoDB?

103 views
Skip to first unread message

Asad Dhamani

unread,
Oct 31, 2014, 3:06:21 AM10/31/14
to mongod...@googlegroups.com
I am building an application, and I am not sure whether it would make sense to use MongoDB. The application would be write-heavy. 
Don't know how useful this diagram is, but this would be the basic structure of the database:
Basically, each user would have multiple records(which could go into tens of thousands range), and each of those records would have 3 metadata records, say title, description, and tags.  
Most of the operations would be write operations. All of the data would be validated by the backend before being added to the database. Some Googling has led me to believe that a relational database like Postgres or MySQL would make much more sense for my use case[1]. Is that correct, or is Mongo relevant for my use case? 

Asya Kamsky

unread,
Nov 1, 2014, 11:31:03 PM11/1/14
to mongodb-user
Asad,

When evaluating whether mongoDB would be a good fit for the use case
you really want to ask yourself NOT "what data do I have" but "what
questions do I have" or "what do I need to do in the application"?

Depending on the types of reads and writes you will be performing,
MongoDB could be an excellent solution for your application or it
could be a poor solution. I don't think we have enough information to
say either way.

Asya
> --
> You received this message because you are subscribed to the Google Groups
> "mongodb-user"
> group.
>
> For other MongoDB technical support options, see:
> http://www.mongodb.org/about/support/.
> ---
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mongodb-user...@googlegroups.com.
> To post to this group, send email to mongod...@googlegroups.com.
> Visit this group at http://groups.google.com/group/mongodb-user.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mongodb-user/eeda332f-c43c-4f25-9754-e54433ea7ab5%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Asad Dhamani

unread,
Nov 2, 2014, 5:31:48 AM11/2/14
to mongod...@googlegroups.com
I guess a good example of the type of application I'm trying to build would be Pocket
I don't have much experience working with databases, but from a few example applications I've seen, it seems to me that Mongo would fit my scenario well. 
For instance, Meteor.js, which runs on Mongo, has a todo list example app which is pretty similar to the type of reads and writes I will be performing. 
I hope this information is enough to evaluate whether Mongo would be a good fit.

Asya Kamsky

unread,
Nov 2, 2014, 1:30:02 PM11/2/14
to mongodb-user
I think MongoDB could be an excellent fit here - it's easy to structure the data you would be reading and writing - and it naturally fits into probably two collections: users and "things" (as in things they saved to read later).   Each "thing" would have a reference to the user, the date it was saved in addition to already mentioned title, description, and an array of tags.    The important thing for you would be to understand how to index the data for efficient updates and queries.

Asya


aliane abdelouahab

unread,
Nov 2, 2014, 4:25:43 PM11/2/14
to mongod...@googlegroups.com
This is the perfect case where you will use MongoDB, key value, in a bson (json like) file. here is your schema:

User : {
textRecordA:{
[
textRecord1A:{data},
textRecord2A:{data},
textRecord3A:{data},
]
},
textRecordB:{
[
textRecord1B:{data},
textRecord2B:{data},
textRecord3B:{data},
]
},
textRecordC:{
[
textRecord1C:{data},
textRecord2C:{data},
textRecord3C:{data},
]
},

Asya Kamsky

unread,
Nov 2, 2014, 9:41:13 PM11/2/14
to mongodb-user
I think maybe you missed the part where in the original post it was said that 

    "user would have multiple records(which could go into tens of thousands range)"

Your suggested schema would not work well at all.

Asya


--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.

Tim Hawkins

unread,
Nov 2, 2014, 11:15:42 PM11/2/14
to mongod...@googlegroups.com

We have exactly this structure on our mongo based 3d printing news site microfabricator.com

There is a collection of users with a "username" primary key which is unique. There is also a collection of posts which have as one of thier fields the username,  in most cases we just display the posts without reference to the user document, the username is suffient to display thier identity and avatar.   unless somebody wants to do something with the author, like send them a message, or look at thier profile. Viewing all the posts by username is also easy.

Asad Dhamani

unread,
Nov 3, 2014, 6:06:13 AM11/3/14
to mongod...@googlegroups.com
Thanks for the help Asya, glad to know that MongoDB would be a good fit for my use case. 
Thanks for the help, aliane.

On Monday, November 3, 2014 2:55:43 AM UTC+5:30, aliane abdelouahab wrote:
This is the perfect case where you will use MongoDB, key value, in a bson (json like) file. here is your schema:

User : {
textRecordA:{
[
textRecord1A:{data},
textRecord2A:{data},
textRecord3A:{data},
]
},
textRecordB:{
[
textRecord1B:{data},
textRecord2B:{data},
textRecord3B:{data},
]
},
textRecordC:{
[
textRecord1C:{data},
textRecord2C:{data},
textRecord3C:{data},
]
},
}

Le vendredi 31 octobre 2014 08:06:21 UTC+1, Asad Dhamani a écrit :
I am building an application, and I am not sure whether it would make sense to use MongoDB. The application would be write-heavy. 
Don't know how useful this diagram is, but this would be the basic structure of the database:
Basically, each user would have multiple records(which could go into tens of thousands range), and each of those records would have 3 metadata records, say title, description, and tags.  Most of the operations would be write operations. All of the data would be validated by the backend before being added to the database. Some Googling has led me to believe that a relational database like Postgres or MySQL would make much more sense for my use case[1]. Is that correct, or is Mongo relevant for my use case?  
 
Thanks Tim, its good to know that people are using MongoDB in a similar scenario for production sites. 

On Monday, November 3, 2014 9:45:42 AM UTC+5:30, Tim Hawkins wrote:

We have exactly this structure on our mongo based 3d printing news site microfabricator.com

There is a collection of users with a "username" primary key which is unique. There is also a collection of posts which have as one of thier fields the username,  in most cases we just display the posts without reference to the user document, the username is suffient to display thier identity and avatar.   unless somebody wants to do something with the author, like send them a message, or look at thier profile. Viewing all the posts by username is also easy. 

On Nov 3, 2014 10:41 AM, "Asya Kamsky" <as...@mongodb.com> wrote:
I think maybe you missed the part where in the original post it was said that 

    "user would have multiple records(which could go into tens of thousands range)"

Your suggested schema would not work well at all.

Asya


On Sun, Nov 2, 2014 at 1:25 PM, aliane abdelouahab <alabde...@gmail.com> wrote:
This is the perfect case where you will use MongoDB, key value, in a bson (json like) file. here is your schema:

User : {
textRecordA:{
[
textRecord1A:{data},
textRecord2A:{data},
textRecord3A:{data},
]
},
textRecordB:{
[
textRecord1B:{data},
textRecord2B:{data},
textRecord3B:{data},
]
},
textRecordC:{
[
textRecord1C:{data},
textRecord2C:{data},
textRecord3C:{data},
]
},
}

Le vendredi 31 octobre 2014 08:06:21 UTC+1, Asad Dhamani a écrit :
I am building an application, and I am not sure whether it would make sense to use MongoDB. The application would be write-heavy. 
Don't know how useful this diagram is, but this would be the basic structure of the database:
Basically, each user would have multiple records(which could go into tens of thousands range), and each of those records would have 3 metadata records, say title, description, and tags.  
Most of the operations would be write operations. All of the data would be validated by the backend before being added to the database. Some Googling has led me to believe that a relational database like Postgres or MySQL would make much more sense for my use case[1]. Is that correct, or is Mongo relevant for my use case? 

-- 
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
--- 
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.

For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
--- 
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
Reply all
Reply to author
Forward
0 new messages