Antonios Giannopoulos (ObjectRocket), Jason Terpko (ObjectRocket) delivers the talk, "'Triggers' in MongoDB", on DAY 2 of the Percona Live Open Source Database Conference 2018, 4/25, at Santa Clara, CA.

A database trigger is a stored procedure that is executed when specific actions occur within a database. Triggers fit perfectly on a relational schema (foreign keys) and are implemented as a built-in functionality on popular relational database like MySQL.

MongoDB does not have any support for triggers, mainly due to the lack of support for foreign keys. Even if it usually considered an antipattern, there are use cases in MongoDB that benefit from a partially-relational schema. The lack of triggers is an obstacle for a partially-relational schema but there can be workarounds for simulating trigger behavior.

This presentation will guide you through different ways to implement triggers in MongoDB. We will cover the topics streams, tailable cursors, and hooks. We will demonstrate coding examples for each topic and we will explain pros and cons of each implementation.


Related Videos: Percona Live Sessions, MongoDB

MongoDB Atlas vs Managed Community Edition
Converting MongoDB to Percona Server for MongoDB
Moving MongoDB to the Cloud: Strategies and Points To Consider
Using MongoDB with Kafka - Use Cases and Best Practices - Antonio Giannopoulos - Percona Live ONLINE
In and out of the weeds with MongoDB 4.4 Hedged Reads - PLO October 2020
The State of MongoDB, Its Open Source Community, and Where Percona Is Going With It
Percona: a solid and compatible alternative to MongoDB