Hacker News new | ask | show | jobs
by polishdude20 1151 days ago
One of the reasons we use database triggers is that we have a legacy system running on Rails and a new system in Typescript. The old system has an entity that is similar to the new systems entity but a bit different. While in this limbo of sunsetting the old system, we have triggers on the old entity when it changes to update the new entity. The thing is, these triggers invoke a lambda which does the business logic for migrating old row to new row. We could also have the old system maybe make an API call to the new system and skip triggers altogether.
1 comments

Using a trigger to kick off a lambda seems like the way to go. You're essentially doing what the NOTIFY command does.