Five Ideas to write Better Cloud Native Microservices
Avinash Patil
Solution Architect| Cloud-Native Consultant | LLMOps, MLOps, DevSecOps | Tech Evangelist and Blogger
Hello Readers let's proceed with our microservice series and explore some strategies to enhance your microservice development.
According to the principles of microservices architecture, our systems should include features such as CQRS, Event Sourcing, User Schema for different databases, among others.
Before we begin, it's important to determine whether we actually need to transition from a monolithic to a microservices architecture. Companies like Netflix and Google require this because they manage multiple services, and their applications are updated frequently. Deciding when to start breaking down a monolith can be challenging, and not all software needs to be split into microservices. However, applications like e-commerce are well-suited for microservices architecture since they are designed with a Service-Oriented Architecture in mind.
The process of adopting microservices begins with decomposing your data and designing database schemas, aiming for one database per service. To accomplish this, start with a small monolith to understand your dependencies, whether they are relational or transactional data.
In microservices architecture, service discovery is crucial for enabling inter-service communication. It's important to write well-defined public APIs to facilitate the discovery and interaction between microservices.
Microservices are typically deployed in containers because they offer service-level isolation and are easy to set up, requiring only a single process to run and terminate.
Idea #1: Take a REST:
CRUD Operations API tools
Advantages: Simple CRUD without SQL, Rapid Development, Easy to implement, No driver dependencies, Secure
Disadvantages: Slower than native DB access (JDBC) , DBA setup, no transaction, no connection pooling , black-box approach
领英推荐
Solution : Auto REST Enabling a Table
Endpoints for Get by Id [Get] ,
Custom endpoint , when post by user and user id. Micronaut Declarative HTTP Client
Idea #2 : Use Multi-Model Instead of NoSQL:
Advantages : Simple CRUD without SQL, Rapid, Easy
Idea #3 : Multimodel makes mashups life easier
Schema per Service, Relation Data in one service,
Idea #4 : Deploy microservices as Native Images
Advantages: Improved RAM and CPU performance
Idea #5: Use Data Access Toolkits: e.g. Spring Data, Micronaut Data
CRUD with raw SQL. Ahead of time compilation
With that in mind, continue to be awesome and share this post.