r/learnjava • u/DrMoneylove • Oct 24 '25
Struggling to understand Database architecture
Hey everyone I'm new to learning java + Spring framework. Right now I'm working on a personal project with a many-to-many relationship and I have to admit I'm pretty unsure how to build up the database so it's efficient and expandable.
I can understand Syntax, CRUD etc. but I have to admit I don't know how to build a database in a way that it's well designed for the long term.
How did you learn to build reliable database structures? Especially considering that projects may change in the future. What's your ideal process on building up the database structure? Bonus question: do you use specific software during the process?
View all comments
Show parent comment
1
u/DrMoneylove Oct 24 '25
So on a practical level: right now I'm working on the following (I'm on public transportation now so it's rough information)
User has a storage of Ingredients. Ingredient Has Id, name, amount_name(l, kg,...), amount, price,...
User has a list of recipes. Recipe has Id, name, description, tools_needed, description of step 1-8, time of steps 1-8, plus which ingredients are needed in flexible amounts.
User can create, alter, delete ingredients and recipes. CRUD operations are already set up except the ingredient - recipe connection.
My spontaneous solution would be to set up a conjoined table and foreign keys as it's a many to many relationship?