database - Observer pattern in Oracle -


can set hook on changing or adding rows in table , notified someway when such event araised? discover web , stuck pipes. there no way pipe message when send. periodical tries receive.

implementing observer pattern database should avoided.

why? relies on vendor proprietary (non-standard) technology, promotes database vendor lock-in , support risk, , causes bit of bloat. enterprise perspective, if not done in controlled way, can "skunkworks" - implementing in unusual way behaviour commonly covered application , integration patterns , tools. if implemented @ fine-grained level, can result in tight-coupling tiny data changes huge amount of unpredicted communication , processing, affecting performance. cog in machine can breaking point - might sensitive o/s, network, , security configuration or there may security vulnerabilities in vendor technology.

if you're observing transactional data managed app:

  • implement observer pattern in app. e.g. in java, cdi , javabeans specs support directly, , oo custom design per gang of 4 book perfect solution.
  • optionally send messages other apps. filters/interceptors, mdb messages, cdi events , web services useful notification.

if users directly modifying master data within database, either:

  • provide singular admin page within app control master data refresh or
  • provide separate master data management app , send messages dependent apps or
  • (best approach) manage master data edits in terms of quality (reviews, testing, etc) , timing (treat same code change), promote through environments, deploy , refresh data / restart app managed shedule

if you're observing transactional data managed app (shared database integration) or use data-level integration such etl provide application data:

  • try have data entities written 1 app (read-only others)
  • poll staging/etl control table understand what/when changes occured or
  • use jdbc/odbc-level proprietary extension notification or polling, mentioned in alex poole's answer or
  • refactor overlapping data operations 2 apps shared soa service can either avoid observation requirement or lift data operation higher level soa/app message
  • use esb or database adapter invoke application notification or ws endpoint bulk data transfer (e.g. apache camel, apache servicemix, mule esb, openadaptor)
  • avoid use of database extension infrastructure such pipes or advanced queuing

if use messaging (send or recieve), application(s). messaging db bit of antipattern. last resort, possible use triggers invoke web services (http://www.oracle.com/technetwork/developer-tools/jdev/dbcalloutws-howto-084195.html), great care required in coarse fashion, invoking business (sub)-process when set of data changes, rather crunching fine-grained crud type operations. best trigger job , have job call web service outside transaction.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -