40

I am developing a dating website and I am thinking of using a NoSQL database to store the profiles etc. I am currenly looking into the MongoDB and so far I am very pleased. The only worry is that I read on different websites that MongoDB is unreliable and not good.

I looked into the NoSQL alternatives and found no one that fully meets my specific criterias:

  1. Easy to learn and use.

  2. Fully compatible with PHP out of the box.

  3. Fast and well documented.

What do you think, am I doing the right thing to go with MongoDB or is it a waste of time?

Thankful for all input in the matter!

Community
  • 1
  • 1
Mark Denn
  • 2,236
  • 5
  • 22
  • 20
  • 6
    Any software, particularly one about which "religious" sentiment applies (e.g. `vi` vs. `emacs`) will have its share of detractors. How do you know that "different websites" are reliable? (I don't (knowingly) use MongoDB or its kin so have no opinion on the matter). – msw Aug 17 '10 at 17:35
  • 1
    for other easy to learn NoSQL dbs, i like Redis and memcachedb – Javier Aug 17 '10 at 17:41

9 Answers9

28

I researched MongoDB for my social service startup and it is definitely worth considering. MongoDB has a powerful feature set that makes it a realistic and strong alternative to RDBMS solutions.

Amongst them:

  1. Document Database: Most of your data is embedded in a document, so in order to get the data about a person, you don't have to join several tables. Thus, better performance for many use cases.
  2. Strong Query Language: Despite not being a RDBMS, MongoDB has a very strong query language that allows you to get something very specific or very general from a document or documents. The DB is queried using javascript so you can do many more things beside querying (e.g. functions, calculations).
  3. Sharding & Replication: Sharding allows you application to scale horizontally rather than vertically. In other words, more small servers instead of one huge server. And replication gives you fail-over safety in several configurations (e.g. master/slave).
  4. Powerful Indexing: I originally got interested in MongoDB because it allows geo-spatial indexing out of the box but it has many other indexing configurations as well.
  5. Cross-Platform: MongoDB has many drivers.

As for the documentation, there is not deluge but that is because this project only started in 2009; soon there will be plenty more. However there is enough to get started with your project. In addition to that you can check out Kyle Banker's MongoDB in Action, great resource.

Lastly, I had experience only with RDMBS prior to MongoDB, didn't know javascript or json and still found it to be very simple and elegant.

RinkyPinku
  • 410
  • 3
  • 20
rjgonzo
  • 1,761
  • 1
  • 16
  • 29
8

Consider this related question on MongoDB and CouchDB - Fit for Production?

MongoDB has a showcase of Production Deployments as well. Be sure to analyze the uses of MongoDB rather than the size of the company.

Community
  • 1
  • 1
p.campbell
  • 98,673
  • 67
  • 256
  • 322
7

Any software can be reliable or unreliable. MongoDB has replica sets, which give you hardware failover capabilities. You can take backups on a regular basis, which gives you a recovery interval, and you get sharding which can give you some modicum of redundancy, especially when combined with replica sets.

The issue isn't whether or not the technology is reliable, the issue is whether or not you have a well-defined backup and recovery plan that suits your platform of choice.

If MongoDB suits your needs, you're making the right choice. Just make sure to investigate what you can do to increase your reliability.

5

If its good enough for Foursquare it's most likely good enough for you.

Eamonn
  • 838
  • 9
  • 10
4

I come from a RDBMS background (12 years) and have spent the last 6 months looking at NoSQL options. For your scenario, MongoDB, sounds like a good choice. What I am hearing from those who have worked with MongoDB in production for some time, is that you should follow these best practices:

  1. Keep key size small
  2. Evaluate (and possibly add) indexes to speed up queries
  3. Pay attention to schema (I know seems strange for a 'schemaless' database, but I have heard this several times
  4. Use replica sets

Here's a video of a best-practices talk from the MongoDB LA User Group that I find useful

Beryllium
  • 12,808
  • 10
  • 56
  • 86
Lynn Langit
  • 4,030
  • 1
  • 23
  • 31
2

That depends on what you need reliability for. Mongo is very reliable for reading - it have strong availability and sharding features.

OTOH, Mongo writes are not reliable. While most go through, it is never guaranteed that update succeeds or not and you have to manually query database to check if it did.

Thus, Mongo is best used when you have more reads than writes you absolutely need to succeed.

Oleg V. Volkov
  • 21,719
  • 4
  • 44
  • 68
2

10gen, the company behind MongoDB provide official PHP driver. As Jeremiah says, they implement replica sets in the last version (1.6.0) and they have already debug it (1.6.1 and next version in some weeks: 1.6.2).

Mostover, the free support by the company and communities is very fast and efficient (by 'free' I mean question on the google groups: http://groups.google.com/group/mongodb-user?pli=1)

Aurélien B
  • 4,590
  • 3
  • 34
  • 48
2

Well, another points about reliability :

  • The community reacts extremely fast if you meet any critical issue.
  • You need to worry about your expectations about "reliability" : Do you need a guarantee on storing your data safely, never getting corrupted ?
    • In this case, you will have to compare the cost of buying reliable hardware and deploying MongoDB replica-sets
  • Do you mean having a highly available service ?
  • MongoDB has some youth issues, I can't say the opposite. But this is definitely NOT a waste of time, and perhaps a long-time solution.
Adrien M.
  • 313
  • 1
  • 3
  • 9
0

MongoDB would be a good choice.We evaluated and started using MongoDB for our business usecases. MongoDB is giving us better performance than Oracle and also it is easy to scale horizontally.

Java Guy
  • 3,391
  • 14
  • 49
  • 55