r/SpringBoot • u/delusionalbreaker • Jul 05 '26
Question Need advice to implement history/recent viewed
Hi everyone! Im a beginner in springboot and building a blogging app (similar to Reddit/LinkedIn) using Spring Boot and MySQL. I need to implement a "User History" feature to track the last 100-150 posts a user has viewed.
The requirements are if a user views Post A, then Post B, then Post A again, the order should update to [B, A] instead of [A, B, A]
The problem im facing is because im using MySQL so to create an history i would need to create an new schema and then design the relationship b/w the post and user and would require constant insert and deletions which would not keep the history intact correctly and also wouldnt remove the history after last 100 post
My qn is there an efficient way to handle this in Springboot? how is it generally implemented?
Repo link:- https://github.com/Yearis/Blog-Application/tree/main/Blog%20Application%20Backend
P.S. Please excuse the messy repo and the outdated README; this is still a work in progress.
View all comments
Show parent comment
1
u/delusionalbreaker Jul 07 '26
Ah I see wow that makes sense but I dont really think my project would grow that much that I would require to worry about space im just making this project as an way to learn and for my resume.
If you dont mind could just take a look at my current project and give me advice as to what more I can add or how can I make it better for resume. I was thinking I could add an chat feature where I could learn about websockets and 2 way connection and then eventually upgrade this project to an microservice full stack project with react/next js as it's frontend.