1. #1
    Sencha User Zyclops's Avatar
    Join Date
    Jul 2007
    Location
    Adelaide, South Australia
    Posts
    154
    Vote Rating
    0
    Zyclops is on a distinguished road

      0  

    Default Data Stores - Local, Remote.. when to switch between.

    Data Stores - Local, Remote.. when to switch between.


    I'm currently writing a wrapper for the data store to interface with ruby on rails and I was pondering whether to dynamically switch between local and remote sorting depending on the number of rows required. Specifically for when your not loading the entire data set (i.e. when your using some sort of pagination).

    For example:
    Lets say we've got 20,000 rows in our table and we're only looking at sets of 100, we'd setup using remote sort, remote filtering so everything is done server side.

    If we've got 200 rows in our table, there's probably no need to hit the server for sorting and filtering so we might as well load everything into the data store and do everything client side.

    So my question is, what do you guys reckon the sweet spot is for the number of rows for when you should switch to server side filtering?

    Additionally do you think it's a good idea?

  2. #2
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Or, you could let the user pick the number of records per page via a combo on the paging toolbar and switch to local when the records are less than the total. I guess you could set a max based on your discretion if you wanted.

    More generally your question seems like it might be application/user specific to some degree.

  3. #3
    Sencha User Zyclops's Avatar
    Join Date
    Jul 2007
    Location
    Adelaide, South Australia
    Posts
    154
    Vote Rating
    0
    Zyclops is on a distinguished road

      0  

    Default


    Or, you could let the user pick the number of records per page via a combo on the paging toolbar and switch to local when the records are less than the total.
    Ah i'm not talking about user options, more of speed optimisations that transparently occur in the background.

    So lets take a ridiculous example... I go to say a widget (like the grid), and I have 101 records but I'm only displaying 100 records per page. Surely it would be better to fetch the entire 101 records into the data store, do all the filtering and sorting client side and not have to send any requests back to the server.

    More generally your question seems like it might be application/user specific to some degree
    I'd expect the logic to work something along the lines of:
    a) I'm fetching 100 rows at a time, but there's only 200 rows in total.. I might as well get the whole lot.

    b) I'm fetching 10 rows at a time, but there's 1000 rows, I should probably filter and sort server side

    c) your displaying 100 rows, you've only got 80 rows from the result. there should be no reason you need to go back to the server and make an additional request.

    My current idea is to send back a "complete data set" flag with the request and if it is complete then the datastore modifies itself to load and filter locally.

  4. #4
    Ext User
    Join Date
    Feb 2008
    Posts
    22
    Vote Rating
    -1
    outrage is an unknown quantity at this point

      0  

    Default


    I agree with one of the other comments that it is rather application specific, in that it depends on the amount of data returned.

    In deciding how many rows to send to the client, I would be thinking of how much data is present in each row. If the rows only have a Name, Created Date and Status for example, I could probably afford to do it all in one hit.

    I like the idea though, I just think you need to look at the amount of data you expect, before deciding on the number of rows to display and ultimately, the method (remote vs local) used.

  5. #5
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Only other comment that comes to mind in your case is maybe you evaluate the records obtained by percentage. So if your js sent limits that would have resulted in getting say 90% of the records, then go ahead and get all of the records.

    I can also think of scenarios where the decision logic might be affected if there's filtering present.

  6. #6
    Sencha User Zyclops's Avatar
    Join Date
    Jul 2007
    Location
    Adelaide, South Australia
    Posts
    154
    Vote Rating
    0
    Zyclops is on a distinguished road

      0  

    Default


    So if your js sent limits that would have resulted in getting say 90% of the records, then go ahead and get all of the records.
    That's a great idea.

    I can also think of scenarios where the decision logic might be affected if there's filtering present.
    I think that's if the filtering is applied from the beginning, and will always be applied to that data store.

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi