英文:
Should data for table filter be filtered in backend or frontend?
问题
For a table that has pagination and a filter that contains the distinct value of the column, should the data be paginated and filtered at backend or frontend?
在具有分页和包含列的唯一值的筛选器的表格中,数据应该在后端还是前端进行分页和筛选?
Initially, I wanted to filter the data at backend with pagination where we filter with pageNo, pageSize. But after adding a distinct value filter, I am faced with two issues, first is that frontend will require the distinct value for each column, and second is that the repository layer will require to allow having a filter for all the columns.
最初,我希望在后端使用分页对数据进行筛选,其中我们使用 pageNo 和 pageSize 进行筛选。但在添加唯一值筛选器之后,我面临两个问题,第一个是前端将需要每列的唯一值,第二个是仓库层需要允许为所有列设置筛选器。
Filtering on frontend however will require getting the entire dataset, which could go to millions of records.
然而,在前端进行筛选将需要获取整个数据集,可能会涉及数百万条记录。
The API is using springboot querying on mariaDB.
API 使用的是在 MariaDB 上查询的 Spring Boot。
英文:
For a table that has pagination and a filter that contains the distinct value of the column, should the data be paginated and filtered at backend or frontend?
Initially, I wanted to filter the data at backend with pagination where we filter with pageNo, pageSize. But after adding a distinct value filter, I am faced with two issues, first is that frontend will require the distinct value for each column, and second is that the repository layer will require to allow having a filter for all the columns.
Filtering on frontend however will require getting the entire dataset, which could go to millions of records.
The API is using springboot querying on mariaDB.
Example of the table:
答案1
得分: 2
如果需要处理数百万条记录,那肯定是后端。数据在互联网中传输需要很长时间,你知道的。
英文:
If it needs to go through millions of records, then definitely backend. The data takes long time to travel in internet, you know.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论