DornerWorks

How a Read Replica Can Improve Your IoT App Performance, and Save You a Big Headache

Posted on August 26, 2019 by Michael Doran

This is it.

You’ve perfected the hardware solution for your IoT product. You’ve implemented best practice provisioning mechanisms to secure your product network. A team of web and mobile developers have created and tested an application that you’ve deemed miraculous.

Now all that is left is to launch your product and let your users marvel in your creation. Everything seems to be going great. As you monitor systems status you slowly start realizing that your users are experiencing long load times, and even worse, application outage.

Oh no! How could this be? You’ve done everything right up until this point.

If the experience described above sounds familiar, don’t worry; this is a sign of growing pains that your application is experiencing. Most IoT designs demand a heavy read load on backends in order to populate an application with useful information for end users such as status, alerts, charts, graphs, revenue, etc.

The good news is that there is a simple and economical solution to this problem. Before you make a knee jerk reaction that may cost you big time in the end read on to learn about the benefits of read replicas.

What is a Read Replica?

Read replicas are copies of master database instances and are commonly used to read requests or analytics traffic from the master. You can create multiple read replicas for a single master instance.

The illustration below provides an example of how a read replica would integrate into an existing IoT network infrastructure.

What are the Benefits of a Read Replica?

  • Improve application reliability
    • In the event of hardware failure you can ensure that your application is still operational by spreading your data across multiple machines. When a read replica is integrated into your network you can enable failover mechanisms that adapt to outages.
  • Improve read performance
    • For application suffering from long wait times as a result of heavy load from querying, read replicas provide a means to distribute read operations across multiple machines. Additionally, depending on the portion of your data that you read on a given replica, that replica may need to cache part of your data, decreasing cache misses and reducing I/O on the replica.
  • Data Backup is Built In
    • Read replicas provide real time backups of incoming data to your system providing durability for your application. If your primary instance is experiencing outages failover mechanisms can be set in place in order to utilize your replica as the primary instance until issues are resolved.
  • Multi-Region Coverage
    • If your application is servicing end users around the globe you can deploy multiple read replicas in regions that are closest to your user base. Deploying read replicas in multiple regions creates high availability for your applications data.

Conclusion

Creating a read replica is one of the many common practices to improve performance for your IoT application. Performance gains stem from distributing read and write operations across multiple machines. Most common cloud services offer a streamlined way of implementing read replicas and it is a useful technique to service read intensive applications.

Give it a try and let us know if you need any help!

Michael Doran
by Michael Doran
Embedded Engineer
Michael Doran is an embedded engineer at Dornerworks.