Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sraines's avatar

Back end vs front end filtering

I have a small Laravel / Vue project I'm working on. It's a streaming site, like Netflix, that will be filled with content from my blu-ray and DVD collection. The 3 big tables I have in my MySQL database are the movies, shows, and episodes tables. The biggest table is episodes, with 649 records, with movies being the next largest table with 242 records. Shows is just a measly 22 rows. Those numbers will keep going up, but it will happen slowly as I've uploaded most of my collection. Also the data virtually never changes once it's in there. The only thing I might do is correct a typo in a movie or show title, or something like that.

With all that in mind, would it make sense to do any filtering for things like searching, or getting all content of a certain genre in the front end, instead of making very specific endpoints in the back end? Like right now I have an endpoint to get all recent movies, it takes a limit and an offset and it simply returns things from the movies table ordered by the created_at field in descending order. But it would be nice if I could simplify my web and API routes and do that work on the front end.

0 likes
1 reply
devfrey's avatar

If you want quick and easy searching in Laravel, consider using Scout. Back-end filtering and searching will scale better (especially when using a third-party service like Algolia) than front-end filtering – eventually.

Please or to participate in this conversation.