Have you backed up your business events? Here is why you should do it
Blog
July 22, 2024

Have you backed up your business events? Here is why you should do it

While most organizations recognize the importance of backing up databases, they often overlook the need to back up event hubs like Kafka. Yet, this is crucial for several reasons. In this blog, we discuss the importance of backing up business events.

Despite their importance, many organizations neglect to back up business events. This oversight is often due to a perception that backups are unnecessary. Typically, queuing systems process data sets asynchronously, allowing entire processes to restart without data loss if something goes wrong. Event hubs are also used for point-to-point integrations between different systems, with the source system producing events from its database and the other system processing them at its own pace. In case of an issue, data can always be reproduced from its original source.

Another reason is the deployment of event hubs over multiple zones with data replication across these zones. If a problem occurs in one zone, other cluster nodes take over seamlessly. When the affected node is available again, the system ensures all data is replicated before reactivating that part of the cluster. This setup prevents failures when a single zone goes out for a certain amount of time. For additional redundancy, extra clusters can be deployed in active-passive or active-active setups, albeit at a significant cost. Switching applications to a passive cluster during primary cluster failures can also be challenging, even within a microservice environment.

Key Reasons to Back Up Your Events

So why do you need to back up your events? Below, we discuss four important reasons.

1. Protection Against Human Errors

Consider a scenario where someone accidentally updates the retention setting on a topic configuration to one day. Even in an Infrastructure as Code (IaC) setup, this mistake might go unnoticed by a reviewer, leading to data compaction and loss across all replicated clusters. Replication and server linking replicate topic configurations, so in this case, data would be deleted from all clusters after just one day.

2. Disaster Recovery

No one can guarantee that a cluster will always be operational or that it can be restarted after a failure. In a worst-case scenario, you need a plan to recreate the cluster from scratch. Disasters rarely occur in isolation; other databases and applications are often affected simultaneously, necessitating coordinated recovery efforts.

With Infrastructure as Code (IaC), setting up a new event hub cluster can take about thirty minutes. However, while this includes configuration, it excludes the actual data. Luckily, an optimized backup solution can restore crucial business events' data in a reasonable time frame. Thus, setting up a new cluster during a disaster can be a cost-effective alternative to permanently replicated clusters, which have their own downsides.

3. Setting Up Test Environments

Organizations often set up test environments using specific data sets, usually subsets of non-sensitive production data. The same approach applies to an event hub. To align the hub with master data in the databases, a cluster setup and event production on specific topics are necessary. A restore process allows you to provision topics of different environments or even rename them, facilitating quick test environment setups.

4. Creating a Safety Net with Multiple Copies

Multiple backups create a safety net against data loss due to phishing attacks, malware, or natural disasters. When data is stored in files, for instance, on cloud file storage, solutions exist to copy and air-gap these backups, keeping them offline and inaccessible. This air-gapping ensures backups cannot be remotely hacked or corrupted.

How to Back Up Your Events

Kafka solutions, including source and sink connectors via the Confluent platform, are available but also have limitations. They don’t track the original offset, can’t be restored to a specific moment, and if a database backup is restored, you can't sync your topic data to that exact time. Performance issues and high costs are also concerns, along with the need for custom configuration and development due to the connectors not being designed for backup purposes. Moreover, these connectors often lack user-friendly interfaces.

With Kannika Armory, we address these shortcomings with a straightforward, purpose-built solution optimized for high throughput and performance. Our user-friendly solution simplifies managing backups and restoring events to a specific moment in time.

Which Events Need Backup?

In modern Event-Driven Architectures, we often move away from point-to-point integrations. Applications produce business events without knowing the consuming applications, which is useful for loosely coupling and reusing applications. Be aware that business events are not exact replicas of database records; they indicate what happened and when. Event hubs often store more historical data than databases, capturing behavioral data invaluable to businesses.

While storing this data in a data lake is useful, making these business events always available for processing in an ordered sequence takes it a step further. Events are typically stored on the hub for extended periods, allowing consuming applications to build read models in memory or persistent data stores for quick data access when needed. Read models are also built in the event hub for streaming purposes through compacted topics.

For instance, if you need to stream data from two topics and combine data from events A and B as they arrive, you need relevant data stored on the event hub with appropriate keys. This allows you to:

- Stream data: read events from multiple topics and aggregate data, similar to database join operations.

- Replay data: address issues in consuming applications by replaying events.

- Phase in new microservices: new services can read all events from the start and react as if they had always been present.

By prioritizing event backups, you ensure your business remains resilient and agile in the face of errors, disasters, and evolving threats.

For more information or to get personalized assistance, contact us today. Ready to secure your data? Start your free trial with Kannika Armory now.