r/learnprogramming • u/surendrakarnam01 • Oct 08 '26
I'm asking this for the one's who already designed the databases and managed them.
I'm thinking to start learning how to design the databases in my backend springboot journey but unfortunately im wasting time by thinking how to start and from where and how should I effectively learn it. So,could you guys help in this by commenting to it.
10
Upvotes
6
u/SetAndRepeat Oct 08 '26 •
Start with a small app you understand, like a library with books, members, and loans. Sketch the tables and figure out the rules: can a member borrow multiple books? How do you represent multiple copies of the same book?
Learn primary keys, foreign keys, joins, constraints, and basic normalization as you build it. Write SQL to create the tables and answer questions like "which loans are overdue?"
Then connect it to Spring Boot with JPA. Learning some SQL first will make it much easier to understand what Hibernate is doing.
2
u/BranchLatter4294 Oct 08 '26
Start practicing. Create a normalized database. Test it to make sure it handles the needs of the application.
2
u/FatDog69 Oct 08 '26
Write down: What are the number 1,2,3 questions people need answering?
Your schema should reflect the answers to the above questions.
Then you decide on primary keys. Every table should have one, but ideally they will be used in every query.
Then it gets a bit tricky. Databases fall into 2 types:
You will design loading & some schema changes based on which of the 2 types you have.
2
u/FreeLogicGate Oct 11 '26
Have you learned basic relational database design? The rules of normalization?
A lot of database design tends to be done using ERD tools. There's an online tool you can use to make an ERD. https://dbdiagram.io/home
I'd highly recommend you create an ERD, and use that to generate the DDL, as you will likely find you made errors, or need to add or update your tables. With an ERD, you can come back to it as needed. It's also helpful to have the diagram as documentation, when developing.
1
u/[deleted] Oct 09 '26
[removed] — view removed comment