Data access object pattern in microservice architecture

Click for: original source

Everett Griffiths is author of the blog post which focuses on the Data Access Object design pattern and how it can be used to communicate with multiple data sources. The article will demonstrate a solution using PHP and dependency injection to straddle multiple data sources in a scalable and testable way. Similar results can be obtained in other languages or using different organizational approaches.

He presents very interesting user case when application needs to retrieve data from multiple sources. The example with bad way to update the data model is presented with supporting code and then better alternative suggested.

This article demonstrates one way to split code execution across multiple classes by injecting one class into another. Accessing data across various microservices is only one possible use of this trick of sequential chaining. Drawbacks are listed as well. All in all - good read!

[Read More]

Tags software-architecture programming php microservices