Polyglot Persistence is a fancy term to mean that when storing data, it us best to use multiple data storage technologies, chosen based upon the way data is being used by individual applications or components of a single application. Different kinds of data are best dealt with different data stores. In short, it means picking the right tool for the right use case. It’s the same idea behind Polyglot Programming, which is the idea that applications should be written in a mix of languages to take advantage of the fact that different languages are suitable for tackling different problems.
Looking at a Polyglot Persistence example, an e-commerce platform will deal with many types of data (i.e. shopping cart, inventory, completed orders, etc). Instead of trying to store all this data in one database, which would require a lot of data conversion to make the format of the data all the same, store the data in the database best suited for that type of data. So the e-commerce platform might look like this:
So we are using a mixture of RDBMS solutions (i.e. SQL Server) with NoSQL solutions of which there are four types: Key-Value, Document, Graph, Column (see Types of NoSQL databases). A guideline on the database type to use based on the functionality of the data:
With an application that uses many types of data, a web service can be created to send the data request to the appropriate database:
This will come at a cost in complexity, as each data storage solution means learning a new technology. But the benefits will be worth it, as when relational databases are using inappropriately, they will cause a significant slowdown in application development and performance. Another benefit is many NoSQL database are designed to operate over clusters and can handle large volumes of data, so it gives you horizontal scaling (scale-out) as opposed to the limitation with most relational databases that use vertical scaling (scale-up).
Polyglot Persistence – Two Great Tastes That Taste Great Together
Introduction to Polyglot Persistence: Using Different Data Storage Technologies for Varying Data Storage Needs
Webinar: What, Where, and How of Polyglot Persistence
Spring Polyglot Persistent Applications Part 1
The Rise of NoSQL and Polyglot Persistence
Polyglot Persistence: Choosing the Right Azure Storage Mix
What’s better for your big data application, SQL or NoSQL?
Difference between SQL and NoSQL : Comparision
Data Access for Highly-Scalable Solutions: Using SQL, NoSQL, and Polyglot Persistence