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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:30:41+00:00 2026-05-11T16:30:41+00:00

I have the following setup for my Blog Data Model: Blog Articles Categories —–

  • 0

I have the following setup for my Blog Data Model:

Blog               Articles             Categories
-----              --------          1  ----------
ID  \ 1         *  ID            /----- ID
Name \------------ BlogID       /       Name 
Owner              Name      * /      
                   CategoryID-/

I’m worried about how this data model matches the ‘best practices’ for Blogs. If a Blog is deleted, should all the articles for that blog be deleted? If a Category is deleted, what should happen to the Articles?

Is there a better way? Is there something I’m missing? What do ‘best-practices’ suggest to do?

  • 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-11T16:30:41+00:00Added an answer on May 11, 2026 at 4:30 pm

    This really depends on your use case. A lot of blog applications use tags with a many-to-many relationship instead of categories with a one-to-many relationsip because it makes more sense to see an article as related to (possibly) many tags than to see an article as “contained” within a category.

    If the logic of your blog is that an article is strictly contained in a category, then the one-to-many relationship is justified. And in some circumstances a cascading delete would also be justified. After all, where would the orphaned articles even exist.

    This is just a case where you must anticipate your user-base’s intuition. What would they assume is natural.

    Incidentally, it’s a lot more work, but if it were me, I wouldn’t do a cascading delete. I would mark articles as orphaned and hide them from most views. I would also provide some interface for restoring orphaned articles. And I would consider providing a script that deletes anything that’s been orphaned for more than some period of time. That way, if you were wrong about what your users expected to happen, you can fix the problem.

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

Sidebar

Related Questions

I have the following setup: Code on my local machine (OS X) shared as
How do you setup a multi-developer XDebug PHP environment? I have the following setup:
I have the following set-up. BlogPosts BlogToCategory Category One blog post can have many
I have the following post-commit hook setup and running: #!/bin/bash /usr/bin/svn update /var/www/html/dev >
I have a form partial current setup like this to make new blog posts
Have following setup: MainActivity class - extends activity MyLayout class - extends View Prefs
I have the following setup: MainApp.exe checks for updates, downloads latest updates. The problem
I have the following setup (which works fine). Using CodeFirst (CTP4). A template has
So, I have the following setup in Eclipse (Java): I have a project (lets
I'm struggling to model a particular relationship with ActiveRecord. I currently have the following

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.