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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:17:23+00:00 2026-05-11T03:17:23+00:00

Suppose I have some application A with a database. Now I want to add

  • 0

Suppose I have some application A with a database. Now I want to add another application B, which should keep track of the database changes of application A. Application B should do some calculations, when data has changed. There is no direct communication between both applications. Both can only see the database.

The basic problem is: Some data changes in the database. How can I trigger some C# code doing some work upon these changes?


To give some stimulus for answers, I mention some approaches, which I am currently considering:

  1. Make application B polling for changes in the tables of interest. Advantage: Simple approach. Disadvantage: Lots of traffic, especially when many tables are involved.
  2. Introduce triggers, which will fire on certain events. When they fire they should write some entry into an “event table”. Application B only needs to poll that “event table”. Advantage: Less traffic. Disadvantage: Logic is placed into the database in the form of triggers. (It’s not a question of the “evilness” of triggers. It’s a design question, which makes it a disadvantage.)
  3. Get rid of the polling approach and use SqlDependency class to get notified for changes. Advantage: (Maybe?) Less traffic than polling approach. Disadvantage: Not database independent. (I am aware of OracleDependency in ODP.NET, but what about the other databases?)

What approach is more favorable? Maybe I have missed some major (dis)advantage in the mentioned approaches? Maybe there are some other approaches I haven’t think of?


Edit 1: Database independency is a factor for the … let’s call them … ‘sales people’. I can use SqlDependency or OracleDependency. For DB2 or other databases I can fall back to the polling approach. It’s just a question of cost and benefit, which I want to at least to think about so I can discuss it.

  • 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. 2026-05-11T03:17:24+00:00Added an answer on May 11, 2026 at 3:17 am

    I’d go with #1. It’s not actually as much traffic as you might think. If your data doesn’t change frequently, you can be pessimistic about it and only fetch something that gives you a yay or nay about table changes.

    If you design your schema with polling in mind you may not really incur that much of a hit per poll.

    • If you’re only adding records, not changing them, then checking the highest id might be enough on a particular table.

    • If you’re updating them all then you can store a timestamp column and index it, then look for the maximum timestamp.

    • And you can send an ubber query that polls multiple talbes (efficiently) and returns the list of changed tables.

    Nothing in this answer is particularly clever, I’m just trying to show that #1 may not be quite as bad as it at first seems.

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

Sidebar

Ask A Question

Stats

  • Questions 69k
  • Answers 69k
  • 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
  • added an answer If you are using Powershell V2 or later, you can… May 11, 2026 at 12:35 pm
  • added an answer db.GetChangeSet().Inserts May 11, 2026 at 12:35 pm
  • added an answer It's possible that you have a nonzero receive timeout set… May 11, 2026 at 12:35 pm

Related Questions

Suppose I have some code that would, in theory, compile against any version of
Suppose I have some XAML like this: <Window.Resources> <v:MyClass x:Key=whatever Text=foo\nbar /> </Window.Resources> Obviously
Suppose I have some code: let listB = [ 1; 2; 3 ] Using
Suppose I have some per-class data: (AandB.h) class A { public: static Persister* getPersister();
I've been a web developer for some time now, and have recently started learning
I'm looking for some suggestions on how to go about this. Any input is
I want to ask a question about how you would approach a simple object-oriented
Unchecked exceptions are alright if you want to handle every failure the same way,

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.