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

The Archive Base Latest Questions

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

I am wondering what your thoughts are on maintaining relationship constraints within a MS

  • 0

I am wondering what your thoughts are on maintaining relationship constraints within a MS SQL DB.

I am migrating a system into a .NET environment from ASP. This brings with it business objects and other tiered-coding techniques, which work to abstract the database from the user/API. The new application has a definite API above an Entity Framework DAL.

The application DB in the old database is large and the purpose of some of the tables will be changing to start containing binary data, in the form of files, etc. I’m keen to split these off into separate DBs to ease management at the client sites where disk space is at a premium.

Is there any value in retaining relationship constraints between tables?

Assumptions:

  • Code is tested
  • Where relations are important, execution is performed under a Transaction
  • Access to the DB is via the API only, other access by third parties is unsupported.

Reasons to keep constraints:

  • Enforces the data structure
  • JOINs are faster?
  • Query Plan assistance?

Reasons to remove constraints in new .NET version:

  • One can assume that the API/BIZ logic would manage relations such as Parent/Child.
  • Reduces opportunity to hive off sections of the DB into other catalogs (the system is built using a Plug-in architecture, most tables may operate in isolation)
  • Am I correct in believing that SQL has to do additional checks during INSERT on constraints, which may be unnecessary when an API above the DB is managing this?
  • 1 1 Answer
  • 2 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:46:52+00:00Added an answer on May 11, 2026 at 4:46 pm

    I don’t support the assertion that constraints “are indexed automatically”. Only Unique and Primary Keys do. Foreign keys don’t, although in most cases I would recommend having an index on the “child” matching the FK’s columns.
    Nevertheless I would still recommend FKeys as they

    1. will enforce your data integrity (I’ve bitten too many times by the BL having bugs and failing to do the job).
    2. Give the optimizer more information on the pattern of your data, which in turn might lead to better and faster execution plans.

    But most of all, have you thought about keeping your data in a single database, but separating it in multiple filegroups? You could achieve your goal a more flexible disk space management without the hassles of Foreign Keys spanning multiple DBs

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

Sidebar

Related Questions

I was wondering how you can recover data from your logfile. I'm using sql
I am wondering is this normal when you add this into your web.config <location
I am wondering what everyone thinks the best method of handling results from your
I was wondering if I could get your thoughts and advice as to what
I was wondering what your thoughts are on having a ViewModel containing a collection
I was wondering how you find it most easy to setup your controllers. Do
I was wondering, when making your own static library, is it a good idea
thanks in advance for your help. I am wondering if there is a (design)
I was wondering how you guys actually develop large applications when you are your
I'm just wondering what do you use for managing visitor requests on your website?

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.