Gao
Gao

Reputation: 942

Is it suitable for a large SNS site 's database entirely using mongodb?

I never really used mongodb, but it lacks relationship between tables, makes me feel uncomfortable. Before, when it comes multi-tables query, I will use join, but if I'm using mongodb, it seems all multi-collection query need using this way: query a collection, then query another using objectid. I don't know which one is better for suiting this situation, RDB or mongodb?

Upvotes: 0

Views: 164

Answers (1)

Gates VP
Gates VP

Reputation: 45287

... it seems all multi-collection query need using this way: query a collection, then query another using objectid.

This is pretty common in big RDBMS systems. if you have one computer filled with Customers and another computer filled with Orders, then you end up using this same pattern.

Both systems are using Btree indexes to lookup the appropriate data. From the servers perspective the JOIN method is just as expensive as the "query collection A / query collection B" method.

Honestly, most big systems put Memcache in front of the query. So you can end up doing a few Memcache queries followed by some SQL queries.

I never really used mongodb, but it lacks relationship between tables, makes me feel uncomfortable.

The world's largest social network is currently operating on SQL technology, so it can obviously be done. Of course, IGN wrote their whole social framework on MongoDB.

So both technologies are suitable and both will have their trade-offs.

Upvotes: 1

Related Questions