How would you approach building this table?

How would you approach building this table?

Hiebs915Hiebs915 Posts: 14Questions: 3Answers: 0

Hi folks,

I'm going to be using DataTables to display some data on a page. The data will be produced using a stored procedure through SQL Server. With default params, the table is 58k rows and 24 columns. After selecting some params, the table could reach 240k rows and 24 columns. I know server-side processing exists but I have no experience using it. At first thought, I was thinking I could using client-side processing and paginate the data so it doesn't take too long to load the page.

Here's some technical details of the project that might be useful:
DB: SQL Server
Frontend: C#'s Razor. Almost all of our frontend is rendered from C# on the server.
Backend: C# .NET

Questions/discussion items for you:
1.) If we paginate the data and I add a PDF download button, would the PDF include ALL data, not just what's being shown on the first page?
2.) Would server-side or client-side better suite this page? Could our tech even support client-side processing.

Happy to hear from you guys!

Replies

  • allanallan Posts: 62,524Questions: 1Answers: 10,273 Site admin

    The correct answer entirely depends upon the data. If your 24 columns are all boolean values for example, then 240KB download (plus JSON overhead probably) isn't bad at all. But let's say each row, on average is 20KB - Then you are talking about a 4MB+ download just to display data, which is likely unacceptable (unless you are working LAN only).

    I would say with that many rows then you really should use server-side processing (which is basically what you mention about using Ajax to load the paginated data).

    The biggest downside to server-side processing and export data is that you need to create the PDF on the server. The client-side only has the data that is currently visible, so it wouldn't be able to create a PDF with the full data set (see this FAQ).

    That said, even if you downloaded 240k rows to the client-side, I'm not sure how performant the pdfmake library used for the PDF creation would be - it isn't something I've tried!

    Personally I wouldn't even attempt client-side processing for this case. But there is no hard limit in DataTables that would stop you making a quick prototype to see what the performance is like. Just make sure you Ajax load the data and enable deferRender.

    Allan

  • Hiebs915Hiebs915 Posts: 14Questions: 3Answers: 0

    The table is made up of people's names, DOB's, address information, school they attend, typical student information.

    I was able to test things out today and I don't think DataTables is going to be able to handle the data. It can handle ~20k rows but but its slow and the user experience probably isn't up to par.

    I'll have to look into server-side processing. Like you said though, I'll have to come up with something to produce the PDF :S

  • allanallan Posts: 62,524Questions: 1Answers: 10,273 Site admin

    If you are using .NET, PHP or Node.js, we provide ready made libraries for server-side processing.

    Allan

Sign In or Register to comment.