Next.js Discord

Discord Forum

Data Grids in Next JS

Unanswered
Karelian Bear Dog posted this in #help-forum
Open in Discord
Karelian Bear DogOP
Hi All,

I want to start the topic of data grids filtering and pagination in Next JS.

In my mind when I'm working with datatables I see two main approaches:

Option 1: Client-Side Filtering
Explanation: Load all data into the browser and perform filtering, sorting, and pagination on the client side.

Pros:

Immediate Filtering and Sorting: Fast operations since all data is in memory.
Simple Implementation: Easier to implement as it doesn't require complex backend logic.
Reduced Server Load: Once data is loaded, no additional requests to the server.
Cons:

High Memory Usage: Not suitable for large datasets due to high memory consumption in the browser.
Long Initial Load Time: All data needs to be fetched at once, leading to longer initial load times.
Browser Performance Issues: Can cause performance issues and slowdowns with large datasets.

Option 2: Server-Side Filtering
Explanation: Only load a subset of data into the browser. Filtering, sorting, and pagination are performed on the server, fetching data as needed.

Pros:

Efficient Data Transfer: Suitable for large datasets as only a small portion of data is transferred to the client at any time.
Low Memory Usage: Reduces memory usage in the browser.
Scalability: Better performance and scalability for large datasets.
Cons:

Complex Backend Logic: Requires more complex backend logic to handle filtering, sorting, and pagination.
Potential Latency: Increased latency due to additional server requests for each data operation.
Network Dependency: Performance is dependent on network speed and server response times.

What is everyones approach to datatable I personaly use ag grid and will adapt to use the server side rows function but wondering if there is a better way to handle data tables and filtering efficiently.

0 Replies