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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:00:16+00:00 2026-05-20T19:00:16+00:00

Background I have a couple of projects that use a SQLite DB for data.

  • 0

Background

I have a couple of projects that use a SQLite DB for data. The data stored in the databases are obviously stored across several tables, linked by key/foreign key values.

The thing is that in these databases, if something changes to one record I have to update several other tables. The best example off the top of my head is deleting a record. I have to make sure all other records related to the one being deleted are deleted as well. Now, this example can be solved using key/foreign key values, I believe, but what about more complicated updates?

Now I’m no pro DB admin, but I know that there needs to be data integrity in the DB or things get ugly.

The Question

So, my question. I know that I have greater control when updating related tables programmatically, but at the cost of human error and time. I may miss something or not implement the tables updates correctly and it takes a lot longer to code in the updates. On the other hand, I can put in triggers and let the DB handle the updates to other tables, but I then lose a lot of control.

So, which one is better? Is each better in different situations?

  • 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-20T19:00:16+00:00Added an answer on May 20, 2026 at 7:00 pm

    On the other hand, I can put in
    triggers and let the DB handle the
    updates to other tables, but I then
    lose a lot of control.

    What control do you think you’re losing? If data integrity requires that “such-and-such an update here requires additional updates there and there“, you’re not losing control by coding that in a trigger. You’re centralizing control, and delegating it to the dbms, which is the only piece of software that can guarantee every application follows those requirements.

    I know that I have greater control
    when updating related tables
    programmatically, but at the cost of
    human error and time. I may miss
    something or not implement the tables
    updates correctly and it takes a lot
    longer to code in the updates.

    You’re thinking like a programmer, not a database designer. (That’s an observation, not a criticism.) Don’t think, “I might miss something”. That way of thinking really misses the mark.

    Instead, when you’re tempted to delegate data integrity to application code, think “Every programmer and every new or changed application that hits this database from now until the end of time has to get it perfectly right.”

    Now, honestly, does that really sound like a good idea to you?

    (The last Fortune 500 company I worked in had programs written in at least two dozen different languages hitting their OLTP database.)

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

Sidebar

Related Questions

Background: I have a WebPart that makes use of the SPCalendarView control and in
I have a couple of ANT projects for several different clients; the directory structure
Background I have a function that takes a config object as an argument. Within
Background I have a dimension table that has a single record for each day.
Background information: I presently have a hardware device that connects to the USB port.
In Salesforce I have an account. On that account I have a couple of
Background: There are a couple of concerns that are not core business for us.
I have a couple un-ordered lists on my page. Both lists use list-style: disc
Some background: I working on some java packages that need to take data, divide
Background I have a personal project that I've been trying to build for around

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.