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

  • Home
  • SEARCH
  • 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 8385855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:46:22+00:00 2026-06-09T17:46:22+00:00

I am considering enabling compression (setting compressed = True ) on some big LocalStructuredProperty

  • 0

I am considering enabling compression (setting compressed = True) on some big LocalStructuredProperty properties.

However, those are entities that will be often read and written, so I am concerned about the additional CPU required to encode/decode these properties.

I am wondering if ndb’s built-in caching system would alleviate this? Does ndb cache the compressed or uncompressed data for these properties? I realize that compression will always occur on every write, but if I can at least bypass decompression when reading a cached entity, it would probably be worth it.

  • 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-06-09T17:46:23+00:00Added an answer on June 9, 2026 at 5:46 pm

    NDB uses lazy decompression and compression, and if you have an entity that is cached in memory (in the Context object) it will only decompress when you actually access the property for the first time. Also if you read an entity and write it back without ever accessing the compressed property, it won’t be decompressed and compressed at all (regardless of caching).

    However the values are written to memcache in compressed form, so if you actually access the compressed properties, the caching won’t help you much.

    My recommendation: use compression only if the data would be too big to fit without it (the limit is ~1MB for the entire entity) and then only if it is the kind of data that compresses well (e.g. text, but not images or other media, since those formats already have their own media-specific compression). Log lines compress very well. English text or computer source code compresses pretty well.

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

Sidebar

Related Questions

Considering a project where will work more than one developer and that will receive
I am considering enabling Memcache support for my large-scale REST service. However I have
Considering that simple java code which would not work: public class Bar extends AbstractBar{
Considering that I have a Schema named SBST I want to find all empty
Considering that the two machine's time settings are not synced, is it still possible
Considering the fact that openmp uses simd model i.e. each instruction is executed by
Considering that I use code like (with or without using (considering that using(??) may
Considering that this prints something like [E] [F] [A] [C] [A] [B] [F] [B]
Considering that everyone is always worried about User Data (And Rightly So), would it
considering that fairly static data should not be re-evaluated but cached instead, I wondered

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.