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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:55:31+00:00 2026-05-12T16:55:31+00:00

We are developing the Web App that will have user subscription to a specific

  • 0

We are developing the Web App that will have user subscription to a specific group of events.
For example: User create a comment in the blob and all users subscribed to this blog should have this event in their list.

Currenly, we are searching for the data model to store this data.

Store all events in one table seems a good idea from the usability point of view:

  • Object (in the example: comment reference)
  • Subscribable object(in the example: blog reference)
  • User that spawned the event
  • Event type(like: update, create etc.)

The subscription events for particular user may be gathered by the sql query that will filter events by user subscription.

The problem in this data model is that subscribable objects may may have ‘inheritance’. For example: The user might have a subscription to the blog or to particular posts in the blog.
That means that Blog subscription extends post subscription and this data model doesn’t reflect this behavior. I will have to spawn 2 events in this case: one for blog and one for post.

Is it a good idea to have all events around in one table or split them some how into different tables? Anyway event tables will have a huge amount of data. Is there a better idea to organize event logging?

  • 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-12T16:55:32+00:00Added an answer on May 12, 2026 at 4:55 pm

    Subclasses in one table and subclasses in separate tables is a common question.

    There is no “good idea” answer. Both are good ideas.

    One question is how you will query them.

    If you rarely do a union of all distinct event subtypes, and you have little overlapping functionality, then separate tables may work out well.

    If you often do a union-style query that pulls together several distinct event subtypes, or you have a lot of overlapping functionality, then a single table may work out well.

    Another question is one of polymorphism.

    If all your event subtypes are properly polymorphic, then your application (and database) will be working with mixed collections of event subtypes. This leads you to a single table.

    If your event subtypes are all very different, and cannot be used polymorphically, then they should be in separate tables.

    Consequences

    With all subtypes in one table, you must use NULLABLE columns for those attributes that are not common to all subtypes. You should also have a column which tells which subtype the row represents.

    When putting multiple subtypes in a single table, you must have a discriminator column which tells which subtype the row should be.

    When putting subtypes in separate tables, you have two designs.

    • Repeat common elements in all tables. Do this when there is very little in common.

    • Have subtype tables join to the supertype table, and put common elements in one table. Do this when almost everything is common.

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

Sidebar

Ask A Question

Stats

  • Questions 214k
  • Answers 214k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer var re = /'([^']*)'/g; var input = "'foo' 'bar' 'omg… May 12, 2026 at 10:51 pm
  • Editorial Team
    Editorial Team added an answer For huge joins, sometimes explicitly choosing a loop join speeds… May 12, 2026 at 10:51 pm
  • Editorial Team
    Editorial Team added an answer PHP timestamp is number of seconds since 1/1/1970, and Java… May 12, 2026 at 10:51 pm

Related Questions

We are developing an app that consists of a web server that hosts a
Our team is about to start a SAAS web application geared toward small businesses.
I'm developing a project on google app engine (webapp framework). I need you people
We are working on developing a Java EE based application. Our application is Java

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.