Polyglot persistence is a term that refers to using multiple data storage technologies for varying data storage needs across an application or within smaller components of an application. Such varying data storage needs could arise in both the cases, i.e. an enterprise with multiple applications or singular components of an application needing to store data differently.
Description
Polyglot persistence shares its origins with how the term
Polyglot programming is defined.
Polyglot programming is a term coined by Neal Ford in 2006, and expresses the idea that computer applications should be written in a mix of different
programming language
A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language.
The description of a programming l ...
s, in order to take advantage of the fact that different languages are suitable for tackling different problems. Complex applications combine different types of problems, so picking the right language for each job may be more productive than trying to solve all aspects of the problem using a single language. This same concept can be applied to
database
In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases spa ...
s, that an application can communicate with different databases, using each for what it is best at to achieve an end goal, hence the term ''polyglot persistence''.
Since there are numerous databases available to solve different problems, using a single database to satisfy all of a program's requirements can result in a
non-performant, "jack of all trades, master of none" solution.
Relational databases
A relational database is a (most commonly digital) database based on the relational model of data, as proposed by E. F. Codd in 1970. A system used to maintain relational databases is a relational database management system (RDBMS). Many relatio ...
, for example, are good at enforcing relationships that exist between various data tables. To discover a relationship or to find data from different tables that belong to the same object, an
SQL join operation can be used. This might work when the data is smaller in size, but becomes problematic when the data involved grows larger. A
graph database
A graph database (GDB) is a database that uses graph structures for semantic queries with nodes, edges, and properties to represent and store data. A key concept of the system is the ''graph'' (or ''edge'' or ''relationship''). The graph relat ...
might solve the problem of relationships in case of
Big Data, but it might not solve the problem of
database transaction
A database transaction symbolizes a unit of work, performed within a database management system (or similar system) against a database, that is treated in a coherent and reliable way independent of other transactions. A transaction generally repr ...
s, which may be provided better by
relational database management systems. Instead, a
NoSQL
A NoSQL (originally referring to "non- SQL" or "non-relational") database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases. Such databases have existed ...
document database
A document-oriented database, or document store, is a computer program and data storage system designed for storing, retrieving and managing document-oriented information, also known as semi-structured data.
Document-oriented databases are one ...
might be used to store unstructured data for that particular part of the problem. Thus different problems are solved by different database systems, all within the same application.
Some of such data storage technologies, but not limited to, could be
*
Relational
*
NoSQL
A NoSQL (originally referring to "non- SQL" or "non-relational") database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases. Such databases have existed ...
*
Graph
Graph may refer to:
Mathematics
*Graph (discrete mathematics), a structure made of vertices and edges
**Graph theory, the study of such graphs and their properties
*Graph (topology), a topological space resembling a graph in the sense of discre ...
*
In-memory
An in-memory database (IMDB, or main memory database system (MMDB) or memory resident database) is a database management system that primarily relies on main memory for computer data storage. It is contrasted with database management systems that e ...
Martin Fowler writes in one of his articles, ''"One of the interesting consequences of this is that we are gearing up for a shift to polyglot persistence where any decent sized enterprise will have a variety of different data storage technologies for different kinds of data. There will still be large amounts of it managed in relational stores, but increasingly we'll be first asking how we want to manipulate the data and only then figuring out what technology is the best bet for it."''
References
{{Reflist
External links
Big Data and Polyglot PersistenceIntroduction to Polyglot Persistence: Using Different Data Storage Technologies for Varying Data Storage Needs
Computer programming
Databases