Cover Image for Thinking in Database-Driven Notifications

Thinking in Database-Driven Notifications

4 min read
Andrew
Andrew

Notika is taking product notifications to the next level.

Gone are the days of writing code just to send notifications. Notika is the only tool that lets you manage your product notifications based on changes in your database.

You can build and manage entire workflows from start to finish in Notika. You can keep things as simple or as complex as you need, and we have AI assistance to help you along the way.

To understand what that means, let's dive a little deeper.

The advantages of a database-driven approach

Your database is your source of truth. Whenever you use an external email service (or any service like analytics or a CRM), you run into a state synchronization problem.

You have to write code to either send the latest data to that service or keep your data in sync. You need to tell that service what is true. This synchronization is often annoying, messy, and error-prone.

What if you could just read directly from your database? Did a user just sign up, or update their email address? Ultimately, your database knows the answer.

If you're writing a scheduled script to send emails, most of the time the first thing you do is query your database.

If you start with your database, you can drop all the glue code around synchronizing state. That's where Notika comes in.

We build on top of your database

Notika builds lightly on top of your database. We use a small corner of your database (in its own Notika schema), and our UI takes care of the rest.

We use an event-driven architecture to watch for changes in your database. We then use that data to drive your notifications. Check out our docs for more information: notika.ai/docs

Currently, we support Postgres, and we're working on expanding that list soon.

Event-driven architecture

Our editor lets you specify which tables and columns to watch. Notika leverages database triggers to write changes to a Notika table in your database. This ensures that no change is ever lost. It also means your data stays on your own database.

No more stale data

One massive advantage of a database-driven approach is that you don't need to worry about stale data. Let's go back to the idea of state synchronization. Let's say you want to create a flow where you wait several days and do another data check. This is very difficult to do with an external service where you need to send all the relevant information at event time.

If you wanted to wait 5 days and see if a user signed up, you need some way to check if that user signed up sometime in the last 5 days. This has now grown from a simple one-off API call to a complex query that goes back and forth between your database and the external service.

With Notika, you can simply query your database again after the wait to see the latest data! Similarly, if you wanted to use the data that was queries 5 days ago, you can ignore querying your database again.

The possibilities are endless

Once you understand that everything is database-driven, the possibilities are endless. The best part is that you don't need any APIs to build your workflows. Your codebase does not need to have any knowledge of Notika. And since your database has all the data, you can build entire workflows from start to finish in Notika.

Let's look at a common workflow and watch how it grows with Notika.

Examples

Version 1: New user sign up

  1. User creates an account - watch for a new row in the users table
  2. Send a welcome email

Version 2: New user sign up with re-engagement

  1. User creates an account - watch for a new row in the users table
  2. Send a welcome email
  3. Wait 5 days
  4. Check if the user has done anything - watch for a row in the users table with an updated last_login column
  5. If the user has not done anything, send a reminder email

Version 3: New user sign up with re-engagement, follow up, and discount code

  1. User creates an account - watch for a new row in the users table
  2. Send a welcome email
  3. Wait 5 days
  4. Check if the user has done anything - watch for a row in the users table with an updated last_login column
  5. If the user has not done anything, send a reminder email
  6. If the user has done something, but hasn't purchased anything, send a discount code.

This is just one simple workflow, but you can see how Notika can express both simple and complex workflows. Moreover, it scales with your application needs.

What else does Notika do?

We are an AI-native product that helps you build workflows. Notika can read your database and use that data to help you build.

Notika also helps you test and simulate your workflows so you can follow specific paths and see what happens. You can use one trigger to drive multiple branches of logic across many different channels, or you can build one workflow per use case. The choice is yours.

We take care of all the plumbing, including reliability, deliverability, and scalability.

What's next?

We are just getting started. We plan to add more databases like MySQL. We also plan to add more channels such as SMS and in-app notifications.

Sign up for Notika at notika.ai and help inform what we build next.