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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:20:00+00:00 2026-05-25T23:20:00+00:00

I am building a distributed accounting system. In terms of the DB structure and

  • 0

I am building a distributed accounting system.
In terms of the DB structure and requirements, it’s probably easiest to describe the app as a Twitter-like app, but with a hierarchical DB structure of 14 tables.
A company that uses the app may have 1 and more users, all sharing the company information.

Currently, each entity represents a record type, i.e. customers, invoices etc.
All entities have a parent which is the user of the app. (for HRD query consistency reasons)

Each query to the DB consists of 14 AppEngine queries. One for each table.
The query involves property filtering.

A new requirement is that a query of a user may require different property values based on each of the other users.
This means that we need (14 x the number of company-users) AppEngine queries. This seems far too much.

Kindless Ancestor queries that can filter by properties would be really nice, alas, no can do 🙂

My options are:

  1. Set entity kind to User. No parent. This means that all record types are mixed. (The filtered fields exist in all record types).
    This is not pretty. But would you consider that?

  2. Have a fixed entity kind and query by filter only. The result is the equivalent of the Kindless Ancestor queries. However, I fear that it will be slow in a multi user use.

Some numbers:
We plan for 10,000 companies, average of 5 users per company and 1 to 5 million records per record type. (x 14 for total)

Thank you for your patience so far.. 🙂

  • 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-25T23:20:01+00:00Added an answer on May 25, 2026 at 11:20 pm

    Honestly I found it challenging to follow your description, so this may be off base. Seeing your existing code might help. But I get that you want an efficient alternative to propertied kindless ancestor queries, so let’s start there.

    Consider de-normalizing your data model to include a meta-entity just for querying:

    class User(db.Model):
      pass
    
    class OwnedObject(db.Expando):
      object_key = db.StringProperty()
    
    class Customer(db.Model):
      name = db.StringProperty()
      created_on = db.DateProperty()
    
    class Invoice(db.Model):
      amount = db.IntegerProperty()
      created_on = db.DateProperty()
    
    # on write
    customer = Customer()
    customer.name = name
    customer.created_on = date.today()
    customer.put()
    
    user = User(key_name=users.get_current_user().user_id())
    
    owned_object = OwnedObject(parent=user)
    owned_object.object_key = customer.key()
    owned_object.created_on = customer.created_on
    owned_object.put()
    
    # on read
    query = OwnedObject.all()
    query.ancestor(user)
    query.filter('created_on =', date.today())
    
    entities = db.get([x.object_key for x in query])
    

    So here you’re doing more work on write and less on read.

    Each real entity is coupled with an OwnedObject entity that descends from the appropriate ancestor and points to the real entity’s key. OwnedObject is an expando, so you’ll eager-assign any properties that you want to query on (in this example, created_on).

    On read, you can query for any properties that you’ve copied to the expando meta-entity, and you can pull back all of a user’s objects with a fixed overhead of one query and one batch get.

    Edit: You can accomplish something similar without the meta-entity by using PolyModel.

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

Sidebar

Related Questions

I'm looking into building a distributed application and would like some advice on the
I am building a distributed menu system to support the operations side of a
I am building an app which will be distributed using enterprise distribution.So we need
We are building a system that would benefit greatly from a Distributed Caching mechanism,
I am building a distributed system that consists of potentially millions of clients which
i am using solr 1.4.1 for building a distributed search engine, but i dont
I'm building a system for monitoring several large web sites (resources), using distributed web
I'm building a distributed web server in C/MPI and it seems like point-to-point communication
I am building an app and making an ipa file but is not ceated
I am a bit confused about this. If you're building a distributed application, which

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.