DEV Community

Cover image for Should you sync your customer data to your notification platform?
Damien Cosset for Notifizz

Posted on

Should you sync your customer data to your notification platform?

Introduction

Sending notifications is a vast subject. Many questions and architecture decisions that have a huge impact on your product. Sending too many notifications, the wrong type, to the wrong people can shatter your company's reputation.

One crucial process about notifications is data. What to do when an event triggering a notification doesn't contain all the data necessary to prepare the message? How do I retrieve the extra information? Where does that information live? There are two approaches to this problem.

In this article, we'll look at the pros and cons of syncing your customer data to your notification platform or keeping your data on your side to access it on demand.

Approach A: Synchronize your data

This approach means that the notification platform holds a copy of your customer data on their side. The notification platform usually doesn't need to make extra external calls to retrieve data, and you can create segments easier on their side. On the other end, it means that your customer data is duplicated elsewhere and you have to implement processes to guarantee data integrity and the data could be obsolete compared to the real data.

Pros

  • Availability: Your app fails, the data could still be available on the notification platform if they are synchronized.

  • Segmentation: Easier to create segments on the stored profiles.

  • Performance: No external calls, we read the data from the local attributes.

Cons

  • Privacy: You have to duplicate your customer data in an external provider, creating another point of failure for that data to be stolen.

  • Data Freshness: Data could be out of sync between the copy and the real data.

  • Integration: You need to implement mechanisms to keep your data in sync or update it.

  • Maintenance: You need to maintain data integrity.

Approach B: Retrieve it on demand

This approach means that you keep your data in one place: your own systems. It means that there is only one source of truth and you don't need to worry about being in sync with other providers. However, performance might be a bit slower because the notification platform will need to make external calls to retrieve the data. It's also your responsibility to provide the endpoints necessary to retrieve the data and create the segments.

Pros

  • Data Freshness: You get the freshest data from the one source of truth used, depending of availability and cache strategies.

  • Privacy: Possibility to limit the data exposed to the external service providers

  • Segmentation: Depends, could be more difficult to implement but you have complete control of your filters and criteria.

Cons

  • Availability: Depends on the availability of your API to retrieve business data

  • Integration: Need to implement endpoints and/or enrichment functions.

  • Performance: More latency to call external services.

  • Maintenance: Need to maintain API contracts, their performances and their errors.

A concrete example

To revisit what I talked about in this article, we'll talk about invoice creation.

I create an invoice and I want to notify my customer that a new invoice is available for him. I trigger an event invoice.created that contains the invoice's id and an organisation's id.

Notifications must be sent to that organisation's billing managers and include the amount, due date and name of the organisation.

Approach A — Synchronisation

The platform already possesses the necessary attributes to identify the billing managers and personalize the message.

Question: Has this information been correctly synchronized?

Approach B — Fetch on demand

The system calls the application to get the recipients and fetch the missing data.

Question : What happens if the API is slow, unavailable or throws an error?

What we chose at Notifizz

At Notifizz, we went straight to approach B. We believe that your data should stay on your side and avoid duplication. We feel like it's better to limit the amount of data stored by a third party.

This approach allows our clients to define their endpoints on their API and their enrichment functions as they wish. Doesn't matter how complex their business logic might be, if they can implement it in their code and expose it, we can use it. We believe it allows for lot of possibilities when it comes to retrieve data or creating segments.

To tackle certain performance issues, we allow clients to use a cache for their enrichers data. That way, you choose if you want Notifizz to keep in cache data that you know won't change too much and avoid unnecessary calls or call your API every time to make sure you get the freshest data. The choice is yours.

How does your team handle notifications? Are you closer to approach A or B?


We built Notifizz using Approach B to retrieve customer data on demand and avoid data duplication. Check it out if you're looking for an event-driven notification architecture!
Explore Notifizz

Top comments (0)