vaadin / vaadin/framework

Grid/DataCommunicator should align data queries to a page size

Open
#9,289 3 comments 13 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
1.8k
Forks
717
Avg merge
2d 6h
Merged PRs (30d)
3

Description

In order to make it possible to create an efficient data provider based on a paging data source (many many data sources are page based, e.g. Spring Data), grid should define and provide a page size it will be used when querying the data provider. Queries to the data provider should then always be for a full page of the same page size to reduce backend traffic.

Potentially the developer wants to affect the page size, but the most important is to be able to GET the page size used and being able to rely on queries being aligned to page boundaries.

If the request data in #8982 still holds true, i.e.:
offset 0 limit40
offset 40 limit50
offset 50 limit40
offset 80 limit19
offset 95 limit5

then it would be quite inefficient to use a paging data provider unless you happen to guess a suitable page size. If you guess based on the intial query, you would do requests for:
0-40
40-80
40-80-120
80-120
80-120

This is quite far from the optimal of requesting each of the three pages once

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Grid/DataCommunicator query behavior and the request described in #8982. Determine how page size and page-boundary alignment should work, including whether developers can configure it; done means data-provider queries consistently request aligned full pages and expose the page size.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.