We are using events to keep our systems simple and use the full power of denormalized data in MongoDB. Denormalization is a database optimization technique in which we add redundant data to one or more tables. It can help us avoid costly joins in a database. You can find a simple example of this technique below.

Denormalization

The picture below shows the ‘events part’ of a sample API implementation: Event handlers

In Ship, every resource produces events on create, update and delete database operations. As a result, we have all events in one place and these events describe system behavior. Stripe has an event for any change that happens in their system. We do pretty much the same.