Intermixing data technologies when needed

Polyglot persistence is a term used in the context of microservices. This term was coined by Scott Leberknigh and Martin Fowler. An enterprise can have different types of data model and access frequency. Some data is required very frequently, and we need not bother much about their accuracy. On the other hand, some data needs to be persisted in a very certain manner. There are many more such different type of conditions, which may occur with different data. Those situations are the reasons enterprises have different technologies to store different types of data. For instance, for sessions, they use Redis; for recommendation engines, they might use Neo4j or any graph database; for finance transaction management, they use some kind of RDBMS such as MySQL or Oracle, and so on. This situation is referred to as polygot persistence.

Any e-commerce website normally has a product catalog to show to the user. When a user selects any one product online, as a business person, you want to show them another product similar to that one or a product that can be used with the selected product. The customer sees some messages such as "XX product is normally purchased together with YY product." It is like having a virtual stubborn sales guy who keeps showing you the things that can be used with your selected product until you make the payment of your selected product. If this is the requirement and tech has to use SQL-based databases, then it will be hard (not impossible) to implement it efficiently. On the other hand, if they choose any graph database, then making links among the products frequently brought together is very easy and can keep on improving. So, the user management part can be an SQL-based database, and the recommendation engine can be another type of database.

In brief, there are, however, some applications that benefit from a polyglot persistence architecture that uses a mixture of database types. A downside of not sharing databases is that maintaining data consistency and implementing queries is more challenging.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset