Using Purpose-Built Polyglot Persistence(P3) to improve your workloads

Collin Smith
5 min readJul 5, 2023

--

Purpose-Built Polyglot Persistence on AWS

Introduction

Polyglot persistence is a key concept in improving your workloads. It has been so long the assumption for many organizations that persisting data should involve only relational databases. There are many more alternatives available now that should be considered. Complex applications involve many different kinds of data which apply to different use case. This emphasizes that when migrating or building new applications, the different data storage options should be considered for the different aspects of your workloads. Purpose-built Polyglot Persistence (P3) should be key consideration when modernizing your applications.

An example scenario

We will walk through a sample scenario with Santa’s AWS Workshop. Santa’s workshop is a serverless application which helped Santa manage the toy requests that were sent in from children’s letters from around the world.

This application required 2 different data stores to fulfill 2 different use cases.

Use Case #1 : Santa needed to have high throughput low-latency reads to have high performant quick queries for the amount of each toys required to satisfy the upcoming Christmas.

Use Case #2: The Elven Data Analysis department is very familiar with SQL which they require a relational database to carry our their analysis of the submitted toy requests.

For these 2 different use cases, one can really start to look at the concept of Purpose-Built Databases. In this case, it was chosen to use DynamoDB to meet the low-latency read requirement of Use Case #1 and AWS RDS to meet the SQL requirements of Use Case #2 . This is an example of purpose-built persistence within the same solution to meet separate requirements effectively.

Let us have a look at the architecture

Purpose-Built Polyglot Persistence in Santa’s Workshop

Persistence Options in AWS

If you are not familiar with some of the key database offerings in AWS, you should consider when modernizing your workloads.

AWS Data models and use cases

There are at least 10 different Persistence options in AWS to consider for your workloads

  • Aurora — critical relational database loads with MySQL and PostgresSQL compatibility
  • Amazon RDS — managed relational database services available in up to 7 popular engines
  • DynamoDB — single-digit millisecond performance, serverless, high throughput and storage
  • DocumentDB — fully managed JSON document database to operate critical document workloads (with MongoDB compatibility)
  • ElastiCache — fully managed, Redis- and Memcached-compatible caching service
  • MemoryDB for Redis — a durable database to scale to hundreds of millions of requests per second
  • Neptune — fully managed database servie to run graph applications
  • Timestream — fast, scalable, and serverless time-series database service that can store trillions of events per day
  • QLDB (Quantum Ledger Database) — fully managed ledger database that provides a transparent, immutable and cryptographically verifiable transaction log
  • Keyspaces(for Apache Cassandra) — scalable, highly available, and managed Apache Cassandra compatible database service which is NoSQL based

Considerations

Martin Fowler provided some thoughts on Polyglot Persistence earlier. Polyglot Programming allows you to take advantages of different types of programming languages to tackle different types of problems more effectively. This same concept can be applied to databases with Polyglot Persistence.

Polyglot Persistence can be approached by seeing how applications or workloads use their own data and then breaking down separate components to handle data differently for each required use case.

This does come at a cost with respect to complexity as each persistence option requires an additional service to integrate. This requires more understanding as multiple persistent options are integrated into an application.

Some architectural approaches lend themselves to making a Polyglot Persistent approach easier. An Event-Driven Architecture allows events to flow and data can subsequently flow more easily to different data stores. The Strangler Fig pattern will assist you updating a legacy application or workload with a simpler and less complicated approach. This lends itself to indiviualize purpose-built data stores as well.

If you are mostly used to writing applications with one type of data stores such as relational database, I would consider incrementally approaching other possible database options based on improving the application one by one. It make take some time to familiarize and develop skills and understanding of a datastore to best improve the workload. Incrementally approaching addition persistence options might be a way to simplify your data store improvements rather than taking too much on too soon.

Benefits can be achieved by looking at the actual requirements of a workload’s data storage. This is different than the standard approach of “using what we always use”. This is why it is always beneficial to understand the persistence options that are available and consider them for upcoming projects.

Conclusion

Building Purpose-Built Polyglot Persistence into your current workloads will allow you to take advantages to improve performance and reliability of your workloads. There will be some complexity that always comes with new technologies which must be considered.

Individual use cases help determine how to best deal with workload performances. Sometimes architectural choices are made with respect to functionality being placed in the front end or backend and additionally with different languages to best meet requirements.

Persistence is another area where choices can be made to improve performance of applications. It will take some time to get familiar with new data stores but benefits are there to be had. Prioritizing the different options to the needs of your current application or portfolio of applications can help make the move to Polyglot Persistence easier and more effective. Consider a Purpose-Built Polyglot Persistence to address gaps in your current workloads.

Do not hesitate to reach out to us at Accolite Digital for more information about your organization’s cloud and digital transformation needs and how we can help you.

--

--

Collin Smith
Collin Smith

Written by Collin Smith

AWS Ambassador/Solutions Architect/Ex-French Foreign Legion

No responses yet