How to Build a Decoupled Microservice Using Materialize | HackerNoon

United States News News

How to Build a Decoupled Microservice Using Materialize | HackerNoon
United States Latest News,United States Headlines

'How to Build a Decoupled Microservices Using Materialize' by bobbyiliev_ microservices kubernetes

We will use the following architecture as described in the video above. The following diagram shows the architecture:We have an eCommerce website that consists of these two microservices:: This microservice is responsible for managing orders.

In order for the Backend to communicate with the Catalog service, we use a REST API. This is how the Basket service gets the products data from the Catalog service. The problem with the above architecture is that the Basket service is tightly coupled with the Catalog service. There are a few drawbacks to this architecture: If the Catalog service is down, the Basket service will not be able to get the products data. Meaning, the Basket service will not be able to process orders and would also be down. When scaling up, the Basket service will start generating load on the Catalog service meaning, the Catalog service will also need to be scaled up.To decouple the microservices, we will use a third microservice called. This microservice will be responsible for routing the requests to the other microservices. But with this approach, the API Gateway will handle all the requests and the microservices and this could turn into a bottleneck as it will have a lot of responsibilities.As each microservice is independent and owns its own data, to decouple the microservices, we can use a materialized view that will store the aggregated data of the microservices.Quick overview of the architecture above: We are adding a new materialized view to the Basket service which will store the aggregated data of the Basket service and the Catalog service.The change events could be stored in a service like Apache Kafka or RedPanda. The Basket service will now handle the change events and update the materialized view accordingly as the data in the Catalog service changes.The downsides of this approach are:The change events would add lots of complexity to the microservices. If you do not have the expertise, adding the additional components and changes means that there will be a steep learning curve for the development team.Materialize is a streaming database that takes data coming from different sources like Kafka, PostgreSQL, S3 buckets, and more and allows users to write views that aggregate/materialize that data and let you query those views using pure SQL. Unlike traditional materialized views, Materialize is designed to maintain the data in a continuous state and keeps the views incrementally updated. This means that if you have a view that is constantly updating, you can query the data in real-time. A normal materialized view would do a full table scan every time it needs to be updated which can be very expensive.

We have summarized this news so that you can read it quickly. If you are interested in the news, you can read the full text here. Read more:

hackernoon /  🏆 532. in US

 

United States Latest News, United States Headlines

Similar News:You can also read news stories similar to this one that we have collected from other news sources.

Explore Some of the Latest (Major) HackerNoon Product Updates! | HackerNoonExplore Some of the Latest (Major) HackerNoon Product Updates! | HackerNoon'Explore Some of the Latest (Major) HackerNoon Product Updates! ' hackernoon hackernoonproduct
Read more »

How to Build a Weather Chatbot with RCS Services using Node.js | HackerNoonHow to Build a Weather Chatbot with RCS Services using Node.js | HackerNoonApplication example using JavaScript and Node.js where a simple chatbot will be implemented in the RCS channel to obtain meteorological data.
Read more »

How to Build a Directed Acyclic Graph (DAG) - Towards Open Options Chains Part IV | HackerNoonHow to Build a Directed Acyclic Graph (DAG) - Towards Open Options Chains Part IV | HackerNoonIn 'Towards Open Options Chains', Chris Chow presents his solution for collecting options data: a data pipeline with Airflow, PostgreSQL, and Docker.
Read more »

Samsung, please don't let accountants build the Galaxy S22 | Digital TrendsSamsung, please don't let accountants build the Galaxy S22 | Digital TrendsSamsung probably let its accountants build the plastic-backed the Galaxy S21, and we really don't want to see the same thing happen to the Galaxy S22.
Read more »

The race is on to build a casino in New York CityThe race is on to build a casino in New York CityReal estate developers and some of the world’s largest casino operators are scrambling to search New York City and its suburbs to find the right location for a gambling resort in the nation’s most attractive, untapped market
Read more »



Render Time: 2026-05-07 04:03:09