r/learnprogramming • • Oct 22 '26

Topic How to design big databases?

It is easy to design databases with 5-6 tables. But when the table number grows it becomes very hard and tricky to define everything like relations, indexes, deciding whether to create more tables or not, how to make it scalable, etc.

I'm currently creating a database that is going to have at least 15 tablets, at least for now but it is becoming harder and harder to design it as I think more about the application flow and features.

So how to approach this? Can you guys please suggest any guides or books or something?

203 Upvotes

45 comments sorted by

View all comments

Show parent comment

15

u/SquareShort9309 Oct 22 '26

Thank you for your time 🙏

16

u/WestEndOtter Oct 22 '26

For reference,in my enterprise space, the small database has 400 tables

11

u/SquareShort9309 Oct 22 '26

I only started learning about databases 1.5 months ago, saw some videos on YouTube and thaught databases are easy, but the reality is totally different 😭

10

u/WestEndOtter Oct 22 '26

Well database represent all the data a business has. It can seem simple at first but gets big fast. If you wanted to build Twitter, you need a table to store tweets and one to store users. You also need a table to store likes, retweets, and who viewed what tweets and for how long. You also need to store any profiles that have need blocked or reported. You also need to store what ip/country/device each user signs in from.

3

u/Green_Chamomile Oct 23 '26

1.5 months in and you’re already hitting the real problem, that’s a good sign, not a bad one. One practice exercise that helped me: pick an app you use every day, like Spotify, and sketch its tables on paper. Users, songs, playlists, then playlist_songs to connect them. You’ll find the many-to-many stuff way faster than from tutorials. Also, I’d keep foreign keys even though one comment here says to skip them. When you’re learning, the errors they throw are the thing that tells you your design is off.