Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7681425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:20:19+00:00 2026-05-31T18:20:19+00:00

I’m building an ajax application and I have a choice to make on how

  • 0

I’m building an ajax application and I have a choice to make on how to structure a data paging functionality. Basically, the user is going to work with 1,000 – 2,000 records but only 20 records are loaded simultaneously from the DB, sent to the client, and then cached in the local session storage. These records are json strings that contain an object’s property (basically, a customer record).

Here are the two choices, let’s assume we’re working with 1,500 records and that each page is 20 records long. The dilemma is where to store the 1,500 IDs of the records.

Option 1:
The IDs of the 1,500 records are stored as a list of int on the server session, and serialized and deserialized for each request. The client is unaware of the record IDs of each page and just requests a page number. On the server, when the user requests page X, we look at the list of int and determine the IDs of the records for page X, load those records and send the client the json strings with these IDs. The downside here is that we’re carrying a list of 1,500 ints on the server session. The upside is that when we’re requesting a page, we’re only sending the server an int.

Option 2:
The IDs of the 1,500 records are sent to the client when the user logs in and then that list is stored in the local storage session. When the user requests page X, a javascript function determines which record IDs are on page X and sends the server a json serialized list of 20 ints. The server then returns the records with those IDs. The upside is that the server side session is much lighter and that should increase performance (no need to read/write/serialize that list at every request) and probably more scalable. The downside is that we’re sending the server a list of 20 ints every time we’re requesting a page.

I’m leaning for option 2: is this the best way to do it?

Note 1) that I’m requiring users to support HTML5 local storage and 2) the server-side implementation will be azure and WCF.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T18:20:20+00:00Added an answer on May 31, 2026 at 6:20 pm

    Perhaps I am misunderstanding but I don’t really understand your approach. If you know the page length and you know the page number that is desired, why can’t you send these along as parameters to the server in your ajax call and then limit it to this in your sql statement for the db. What I mean to say is what is the point of knowing these IDs in the first place. For example look at how the jquery datatables plugin performs pagination here:http://www.datatables.net/examples/server_side/server_side.html . As you can see they use the method of posting the page number and page location to the server. Then, its pretty easy to limit the rows you want returned based on this (at least in Oracle, MySQL, and MS SQL). Unless I am completely missing the point in which case please let me know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.