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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:49:54+00:00 2026-06-17T20:49:54+00:00

I have a Django website with a PostgreSQL database. There is a Django app

  • 0

I have a Django website with a PostgreSQL database. There is a Django app and model for a ‘flat’ item table with many records being inserted regularly, up to millions of inserts per month. I would like to use these records to automatically populate a star schema of fact and dimension tables (initially also modeled in the Django models.py), in order to efficiently do complex queries on the records, and present data from them on the Django site.

Two main options keep coming up:

1) PostgreSQL Triggers: Configure the database directly to insert the appropriate rows into fact and dimensional tables, based on creation or update of a record, possibly using Python/PL-pgsql and row-level after triggers. Pros: Works with inputs outside Django; might be expected to be more efficient. Cons: Splits business logic to another location; triggering inserts may not be expected by other input sources.

2) Django Signals: Use the Signals feature to do the inserts upon creation or update of a record, with the built-in signal django.db.models.signals.post_save. Pros: easier to build and maintain. Cons: Have to repeat some code or stay inside the Django site/app environment to support new input sources.

Am I correct in thinking that Django’s built-in signals are the way to go for maintaining the fact table and the dimension tables? Or is there some other, significant option that is being missed?

  • 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-17T20:49:55+00:00Added an answer on June 17, 2026 at 8:49 pm

    I ended up using Django Signals. With a flat table “item_record” containing fields “item” and “description”, the code in models.py looks like this:

    from django.db.models.signals import post_save
    
    def create_item_record_history(instance, created, **kwargs):
        if created:
            ItemRecordHistory.objects.create(
                title=instance.title, 
                description=instance.description, 
                created_at=instance.created_at,
                )
    post_save.connect(create_item_record_history, sender=ItemRecord)
    

    It is running well for my purposes. Although it’s just creating an annotated flat table (new field “created_at”), the same method could be used to build out a star schema.

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

Sidebar

Related Questions

I'm developing an online website (using Django and Mysql). I have a Tests table
I have a Django application that defines a one-to-many model relationship. The models look
Our website uses a PHP front-end and a PostgreSQL database. We don't have a
I have a corporate website with django-cms and with a SQLite database that has
I have a postgres 9.1 database that is used by both a django website
we have just started using a git account of our Django website project so
I am looking for displaying Forecast information in my Django Website. Do you have
I have a website i'm putting together with python and django. I have a
I have django model which consist of parent child relationship filed I want to
I have a django website that is spilt depending on what user type you

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.