I’m developing a social networking website as a hobby project to improve my programming skills.
This a normal social networking website not a hi-fi stuff.
What I’ve done until now is:
- You can register/login (I’m using Relational DB)
- You can find friends. (All the users except your email because email is unique in the database)
The problem is:
-
Adding friends (A user can have many friends) and that’s a problem with database design.
Because next time when you click find friends it will show users except your email and your current friends email (and that’s expensive). -
So what should be the database design to make it less expensive.
-
What kind of SQL queries should I learn to reduce my I/O(Bandwidth) usage.
-
I’m aware of JOINS and Foreign Keys but don’t have a clue for applying these in many-to-many relationships.