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

329 views
Skip to first unread message

vaibhav bhalke

unread,
Aug 9, 2011, 7:33:28 AM8/9/11
to google-we...@googlegroups.com
Hi folks,

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 code.

Our server side is sending huge xml (Size in MB/GB) to client side, our client side parses that xml and using parsed data, 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.


--
Best Regards,
Vaibhav Bhalke






mohit ranjan

unread,
Aug 9, 2011, 7:47:09 AM8/9/11
to google-we...@googlegroups.com
Somewhere I read this

binary serialization + compression -> send it to client

Mohit 







--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Sean

unread,
Aug 9, 2011, 8:01:42 AM8/9/11
to google-we...@googlegroups.com
Can you do the parsing on the Server Side, and only send what needs to be displayed? Have the cell table say, we need records 0-500, send those. Then when they hit next page, have it ask for 501-1000 and etc.,etc.,

This way you're never sending that much data over the wire, it should be much quicker and more responsive. 

George Agiasoglou

unread,
Aug 9, 2011, 9:09:54 AM8/9/11
to google-we...@googlegroups.com
Have a look at AsyncDataProvider + SimplePager.

-George

PiotrN

unread,
Aug 9, 2011, 9:16:18 AM8/9/11
to google-we...@googlegroups.com
Transmitting that much data will be problematic. I would first seek a way to avoid such transmissions to the client.

But if has to be done this way and all the data should be displayed in single "page", they still should be transmitted in chunks,
in size of about what one real client screen would show. When one page is parsed, go fetch next one.
If you need it all to make the processing, then you really should do the work on the server.

If the parsing of xml can be done with xslt, check that, it might be faster, as browsers do include xslt parsers.
Also, if you can target modern browsers, try using workers to do you work on the data.

Have You tested how will the browsers behave when feed 1GB xml ?
I would prep such file and such big table before going for the actual code...

There was a project done in GWT, i believe it's somewhere noted on the webtoolkit homepage, that dealt with huge data sets.
It draw a graph of statistical data. Might be useful to see how they handled it.

Srinivasan Raghavan

unread,
Aug 9, 2011, 7:51:54 AM8/9/11
to google-we...@googlegroups.com
Hi

Try lazy loading instead of sending the XML all to together

Regards
R.Srinivasan

Alain Ekambi

unread,
Aug 9, 2011, 10:39:35 AM8/9/11
to google-we...@googlegroups.com
Would not be JSON here better ? 
What about turning that xml into JSON ? 

2011/8/9 Srinivasan Raghavan <srinivasan...@gmail.com>



--


BST

unread,
Aug 10, 2011, 7:01:07 AM8/10/11
to google-we...@googlegroups.com
I had a similar requirement. What I am doing now is getting 300 records at a time, and showing on the cell table. When the user clicks on next and if it is the last page I get another set of records using a RemoteService and update the Cell Table.

Since I required a different kind of pager, I have an implementation of Abstract Pager. What you can do is extend the SimplePager if u r using it. Override the nextPage method, and check whether u r on the last page or not. If you are on the last page then get the data using an RPC call to a service. The service should return you a list of data from a particular index. When you get the list from the RPC just append it to the ListDataProvider of the table.


https://groups.google.com/d/topic/google-web-toolkit/sCJhFYWmmVI/discussion

Steve

unread,
Aug 10, 2011, 1:15:07 PM8/10/11
to Google Web Toolkit
Lazy loading. Send the data over the wire from the server side as
needed in small chunks, and send it pre-processed.

I've even gone as far as delimiting the data server side and then just
running a split on the client side to fill in the table.

If you're dealing with static data, you could also store records
client side in a HashMap. When performing a search I'd just pull back
the IDs to the client side, figure out which records didn't exist in
the map, and then query the server for the missing data.

But if you're pushing Gigs of data, that probably wont work for you.
Split it up into much smaller chunks if you can.

When displaying the data, I also didn't need a lot of functionality. I
just needed to display a table. So I built one using plain old HTML
and StringBuilder. Once the table was built I'd plop the HTML onto the
page. If you use a Grid or (shudder) FlexTable then the DOM
manipulation can take forever. I'm not sure if CellTable solves the
DOM problem or not, but I'd thought I'd mention that one method.

-Steve
> <http://about.me/vaibhavbhalke>
Reply all
Reply to author
Forward
0 new messages