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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:12:42+00:00 2026-05-20T08:12:42+00:00

I am using redis as my web cache, and I want to store those

  • 0

I am using redis as my web cache, and I want to store those activerecord objects to redis directly, but using redis-rb I get an error.

It seems that I can’t serialize it or some what. Is there a lib to do this for me?
Am I have to serialize it to json format?

Which serialization format would be the most efficient?

  • 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-20T08:12:42+00:00Added an answer on May 20, 2026 at 8:12 am

    Redis stores strings (and a few other data structures of strings); so you can serialize into Redis values however you like so long as you end up with a string.

    JSON is probably the best place to start as it’s lean, not overly brittle, works well with live upgrade patterns, and is readable in situ. Later you can add more complexity to meet your goals as needed, e.g., compression. #to_json and #from_json are already on ActiveRecord if you want to use JSON (with YAJL or its ilk that shouldn’t be excessively slow, relatively speaking.) #to_xml is also there, if you’re into S&M.

    Raw marshaling can also work, but occasionally goes horrifically wrong (I’ve had marshaled objects exceed 2MB after LZO compression that were only a few K in JSON.)

    If it’s really a bottleneck for you, you’ll want to run your own efficiency tests for your goal(s), e.g., write speed, read speed, or storage size, with your own objects and data patterns.

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

Sidebar

Related Questions

I'm trying add a tab to my web page that looks like this: Using
I'm using an ORM called Ohm in Ruby that works on top of Redis
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
Using JDeveloper , I started developing a set of web pages for a project
Using C#, I need a class called User that has a username, password, active
I need to check that our visitors are using HTTPS. In BasePage I check
I'm using redis with php (predis at http://github.com/nrk/predis/ ) and am experiencing frequent timeout.
Anyone had success with using Redis as Beaker backend? Can you tell me link
How can I implement an autocomplete using redis? Say for example I have an

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.