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 465209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:21:11+00:00 2026-05-12T23:21:11+00:00

I have an issue with manipulating large number of record objects of type ActiveRecord

  • 0

I have an issue with manipulating large number of record objects of type ActiveRecord model(Records are extracted from a complex operation but from the same table) and I want to pass that object set around between controller actions. So I have couple of solutions but is wage about which way to choose. Simpler but uglier solution is to save it in sessions. But as I know saving large object set in sessions clearly slows down application performance because of frequent serialization and de-serialization process(Serialization is time consuming I guess from Web services – SOAP and binary formatting). Second option which seems to be promising is saving all these ActiveRecord model objects as a blog in the database, and with one query we can retrieve all and can do the necessary operations with that dataset. But I don’t know how to iterate through all objects after retrieving it from the database because it is still in binary object format. Calling inspect method shows all attributes and values but I am totally perplexed. Can anyone tell me how to save ActiveRecord model type objects as a single record binary obejct and retrieve it and go through the dataset. Do I need encoding like Base64 ?. Finally would memcached yield desired result?? or at least any links that can follow to solve this ?

And sorry for the lengthy question and thanks in advance.

  • 1 1 Answer
  • 1 View
  • 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-12T23:21:12+00:00Added an answer on May 12, 2026 at 11:21 pm

    The answer, and I hate saying this, is that probably the method is flawed. Is it going to take more time to query for this exact data again or to load up a BLOB row and unserialize it? My guess is that it takes roughly the same time without indexes but with indexes you may be able to get your entire resultset from the DB faster than even loaded the BLOB without even the unserialize call.

    Now maybe I’m wrong about that, but certainly the amount of data coming back is about the same so a large chunk of the db time is exactly the same.

    Memcached would certainly prove helpful here but only in the same way that the query cache (assuming you’re using MySQL) would be helpful. Repeated queries for the same thing should be returned laser fast by either method assuming the cache in either case is large enough to fit the object.

    But you are correct that storing in the session is a bad way and BLOB is probably also at best about the same as just doing the query again and letting the query cache return it.

    But just to cover all the bases, how big is the total dataset vs how much is coming back and how long are you seeing the queries take? I’m guessing this post is really about performance but is clouded by implementational details.

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

Sidebar

Related Questions

I have a TextArea in LWUIT that I am having an issue manipulating. I
I have issue that is reproduced on g++. VC++ doesn't meet any problems. So
We are new to ROR, We have issue in creating Login/Logout process in ROR
Share your ideas please! I have issue to check the folder and convert a
I have an issue and I have looked long and hard over the Internet
I have an issue with dynamic, runtime controls. I create a group of controls
i have an issue i could use some help with, i have python list
I have an issue with how to organise the the screen layout for my
I have an issue with php where code works on on computer but wont
I have an issue using jquerys selectors when it comes to a page I

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.