数据表格的筛选数据应该在后端还是前端进行筛选?

huangapple go评论78阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年5月10日 22:43:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/76219787.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定