"Triggers" in MongoDB

Wednesday 12:50PM-1:40PM

@ Room F


50 minutes conference


Developer, Business / Case Studies

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.


Antonios Giannopoulos

Antonios Giannopoulos (ObjectRocket)

Database Administrator


I am Database Administrator at ObjectRocket supporting MongoDB and Cassandra. I have 15 years experience in databases and system engineering. I really enjoy challenges in sharding and schema design and love migrations from Relational to NoSQL world.

Jason Terpko

Jason Terpko (ObjectRocket)

Database Administrator


Jason has over 10 years working on various database technologies, which include relational, columnar, and NoSQL platforms. He is currently focused on MongoDB at ObjectRocket by Rackspace supporting customers with existing MongoDB implementations or those just entering the NoSQL space. Before that, Jason worked as a MySQL and Vertica DBA for various firms in Manhattan that were in the financial reporting/investment management industries. He enjoys solving complex problems that involve data distribution, chunk management, and scripting in both Python and Javascript. When not busy with databases, he also spending time outdoors.


  Download Slides  

Connect with Percona

Stay Connected on:

Percona Live Conferences

The Percona Live Open Source Database Conferences are the premier event for the diverse and active open source database community, as well as businesses that develop and use open source database software.

Contact Us

For general information about the event/expo/conference, including registration, please contact us at:

  • info(@) percona.com
  • +1-888-401-3401
  • +1-919-948-2863