I'm going to build a social network app. Each user will have photos, videos, details, posts etc.

My question is when a new user registers, should I generate many new tables for that user or have one table for all users which may be contain billions of rows?

And which is best database for social network system: MySQL or CassandraDB?

Please help me!

  • Maybe you have a good idea, but I really recommend that you hire someone else to implement. May 5, 2015 at 4:11
  • But i don't have much money right now! So i'm trying to do it by myself :)
    – Jack Lee
    May 5, 2015 at 4:31
  • Product recommendations are usually off-topic for this site. That said, Cassandra has better sharding than MySQL. I'd commend graph databases, such as Neo4j, for your investigation, too. May 5, 2015 at 4:34

1 Answer 1


One table for all users. Period. End of discussion. (This is a common question; the answer is always the same.)

When you get to a million rows, we can discuss some other issues and solve them before you embark on the road to a billion.

What is best for project X? If it will have a billion rows, you will need a database expert to tweak whatever underlying system you are using. Any system can do it. But it won't be trivial.

Focus on getting to a million rows. Reconsider all of your design decisions at that point. Any decisions made today will not survive to 1 billion.

Would you like me to repeat myself all over again?

  • Thanks you so much :) But if i want to separate my database into many server, which database is best for doing that?
    – Jack Lee
    May 5, 2015 at 4:16
  • I can only speak for MySQL. I have seen several "sharded" mysql installations doing things similar to what you plan. It does, however, require programming on your part to implement the routing. Hashing userid is a common sharding technique. I could talk further, but it is a big topic.
    – Rick James
    May 5, 2015 at 15:39
  • I recommend not embarking on sharding until you get closer to needing it. By then, you will have fleshed out many of the other schema issues and can focus on sharding.
    – Rick James
    May 5, 2015 at 22:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.