ArticleslgStudy

computer science

Polyglot persistence

Polyglot persistence is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Polyglot persistence rather than just read about it. In short: Polyglot persistence is using multiple data storage technologies within a single system, in order to meet varying data storage needs. Such a system may consist of multiple applications, or it may be a single application with smaller components.

Key takeaways

  • Polyglot persistence belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Polyglot persistence to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Polyglot persistence from memory before moving on to harder problems.

Reference excerpt

Polyglot persistence is using multiple data storage technologies within a single system, in order to meet varying data storage needs. Such a system may consist of multiple applications, or it may be a single application with smaller components.

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 languages, 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 databases, 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, 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 might solve the problem of relationships in case of Big Data, but it might not solve the problem of database transactions, which may be provided better by relational database management systems. Instead, a NoSQL document database 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 Graph In-memory 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

External links Big Data and Polyglot Persistence Introduction to Polyglot Persistence: Using Different Data Storage Technologies for Varying Data Storage Needs Polyglot Persistence

Worked examples

Example 1 — a first encounter with Polyglot persistence

Start with the simplest possible case. Write down what Polyglot persistence claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Polyglot persistence before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Polyglot persistence ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Polyglot persistence

In research
Polyglot persistence appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Polyglot persistence in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Polyglot persistence is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer programming, Databases, so understanding it makes those chapters shorter.
In everyday life
Look for Polyglot persistence outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Polyglot persistence” →

How to study Polyglot persistence in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Polyglot persistence means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Polyglot persistence out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Polyglot persistence in simple terms?

Polyglot persistence is using multiple data storage technologies within a single system, in order to meet varying data storage needs. Such a system may consist of multiple applications, or it may be a single application with smaller components.

Why does Polyglot persistence matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Polyglot persistence?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Polyglot persistence.

Tags

  • Computer programming
  • Databases

Keep exploring