should filter be added on the backend or in the frontend?
Both . Depends on your use case too . But if you have thousands of records , the minimum is to paginate . Return only 100 (or 200 or whatever makes sense to your project ) , but try to limit at some point . This helps in processing time (from database +backend ) and also time to get the records (transfer ) . Even if you use something like "inifine scrolling " , you can load records as you go . if you 're paginating , the filter would need to be in the back end otherwise you would only be filtering the records coming in page by page . That may work for your use case , but in most cases I would do that in the back end . I have filters in my front end for small numbers of records .

.jpeg/public)