Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT Best practice to send huge amount of data from server to client

Which are the Best practices to send huge amount of data from server to client in GWT?

Right now we are facing performance issue in GWT 2.3.0.

Our server side is sending huge xml (Size in MB/GB) to client side, our client side parses that xml and using parsed data, list of beans are formed for populating data in Celltable grid.

We are filling 1k + / 10k+ records in CellTable grid.

Is there any effective way/ Best practices followed while dealing with such a huge data? If we parse the data at server side and formed the beans at server side, Is this good? or any alternative way..

Any help or guidance in this matter would be appreciated.

like image 681
StackOverFlow Avatar asked Aug 09 '11 11:08

StackOverFlow


3 Answers

Basically you only request as much data (and a little more) than is currently viewed by the user, not the whole data set.

See Adding Paging Controls for further details.

like image 72
helpermethod Avatar answered Nov 17 '22 20:11

helpermethod


Two practices when dealing with large data for your case:

1) Use JSON instead of xml, that way the client doesn't need to parse the data but can directly use the data. In GWT via the GWT-JSNI interface you can write data objects accessing these JavaScript objects, see: http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsJSNI.html. With a JSON REST library you can generate the JSON on the server instead of sending xml to the client. But you can also use GWT-RPC on both client/server, which makes programming easier because the whole data conversion to and from JSON is handled by GWT, but adds some type information to the objects send.

2) Use paging: only get data that is visible to the user and cache it in the client. If you have a table presentation it's not likely the user needs all the data at once. GWT cell panels have support out of the box (see the link Oliver mentions about Adding Paging Controls)

like image 45
Hilbrand Bouwkamp Avatar answered Nov 17 '22 20:11

Hilbrand Bouwkamp


As in the other answers, return only the data that can usefully be used by the user and lazily fetch other data when the user requests it (or Predictive Fetch).

See AsyncDataProvider section here: http://code.google.com/webtoolkit/doc/latest/DevGuideUiCellWidgets.html#data-provider

like image 3
MattR Avatar answered Nov 17 '22 20:11

MattR