Server-side processing, but using local data storage?

Server-side processing, but using local data storage?

ty_rexty_rex Posts: 4Questions: 0Answers: 0
edited February 2014 in General
Hi there,

I'm looking into DataTables to provide a UI across a very large data set. The users require the ability to filter and sort any column of data on demand. Datatables definitely fits the requirements for the UI aspect.

Given the amount of data (>100k rows and in some cases over >200k rows), it would seem to make sense to set Datatables to use server-side processing to offload all the filtering & sorting to our servers. The problem is that we're hosting using IBM Domino which is great at the searching part, but very slow at sorting, particularly when the back-end data is changing regularly which ours is.

So my next approach was looking at bringing the data down onto the browser and do the filtering and sorting locally (the users don't mind a few minutes of loading time, so long as the screen is fast once it is being used). Using the JS library YDN DB, I have successfully tested bringing down lots of data, indexing the relevant columns and proving it can return rows as quickly as my users require.

However, I can't see how I can make Datatables offload all of its sorting/filtering functionality using server-side processing (bServerSide=true)but not actually doing the external AJAX call. Ideally I'd like to build a custom handler code that intercepts the AJAX requests from Datatables, searches the local YDN DB for results and then returns them for display - I've tried using fnServerData but this only allows me to handle the AJAX result, not prevent the call itself.

Any ideas I might be able to use to get me started?

Thanks in advance,
Ty

Replies

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    fnServerData is the way to go here. It allows you to completely control where DataTables gets the data to draw from. Typically this will be an Ajax request, but by no means does it need to be - you can very easily make a call into a Web SQL database or anything else rather than calling `$.ajax` . You'd need to implement all of server-side processing with YDN - limit, where, order by etc - is that doable?

    Allan
  • ty_rexty_rex Posts: 4Questions: 0Answers: 0
    Ahh - I didn't realise that 'sAjaxSource' parameter could be overridden by simply ignoring it in the 'fnServerData' function.

    I noticed that you don't even need to specify sAjaxSource at all - as long as bProcessing is true and fnServerData has a valid function it will work.

    Now recreating the server-side processing in YDN. This part is complicated!

    Thanks for your help :)
  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Interested to hear how you get on with it!

    Allan
This discussion has been closed.