PricingBlog

should filter be added on the backend or in the frontend?

  • shiva_46019-1280471467804594187

    shiva

    1 year ago

    Try to figure out what iss best practice should a filter code be added in the backend or frontend if we have 1000s of records
  • mighty.13-1280472642125828147

    Mighty

    1 year ago

    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.
  • neville9288-1280473398627143703

    Neville

    1 year ago

    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.