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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:56:17+00:00 2026-05-22T12:56:17+00:00

Is it best to (1) cache records from a table, or (2) a full

  • 0

Is it best to (1) cache records from a table, or (2) a full object graph, or (3) a multiple partial object graphs depending on the use case?

Let me clarify:
Let’s say I have an Order system with workflow. It contains objects like: Order, OrderLine, Items, Customer, Workplan, Phase, Milestone, Activities etc.

(1) I can put all records from the Order table into cache, and all records from the OrderLines table into cache, and all records from the Items table into cache etc. Probably a terrible idea, because you can’t query the cache very well.

(2) I can put Order objects, including it’s OrderLines, OrderItems, Customer, Workplan, Phases, Milestones etc., into the cache. I don’t like this because I have to update the cached Order object if somethings changes in it’s Orderlines, Orderitems, Items, Customer, PHases, Milestones etc. Another thing is that I don’t know how big the cached object will be of an Order has relations with 10 or 15 other objects and these are all loaded into the cached Order.

(3) I can ‘split’ the object in a part for the Orderdetails, and a part for the wokrflow. This way I have a cached Order object with all relevant Order details. And I have another Cached Order object, with all relevant Workflow details.

Do you guys have any suggestions about how you cache these things?

(I hope it’s clear, otherwise please let me know)

  • 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-22T12:56:17+00:00Added an answer on May 22, 2026 at 12:56 pm

    You need to find a balance, between the information that is viewed the most and the information that changes the most.

    The order header for example, is likely accessed on every page, for example a basket view? In this case cache it as it’s going to be hit a lot. But milestones on the other hand, how often is that viewed? If you’re only going to view it perhaps once per session if that, then its less likely to need caching as you gain no real benefit.

    If you were to cache the whole object model, then you would be constantly updating the cache with data I imagine, for no real benefit, and the overhead of storing it for the session.

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

Sidebar

Related Questions

Best recommendations for accessing and manipulation of sqlite databases from JavaScript.
For best performance, is it better to use a virtual IDE HDD or virtual
As best-behaved as I try to be about keeping my unit tests disconnected from
What is the best way to use an embedded database, say sqlite in Python:
What's the best way to cache a paginated result set with rails and memcached?
How best to make the selected date of an ASP.NET Calendar control available to
How best can I convert instances of double backslashes to a single backslash in
What best practices should be observed when implementing HDL code? What are the commonalities
The best I can come up with for now is this monstrosity: >>> datetime.utcnow()
The best that I have been able to come up with is: strlen(preg_replace('/^([\\*]*)\s(.+)/',$1,$line)); ^^That

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.