Hitesh Sahu
Hitesh SahuHitesh Sahu
  1. Home
  2. ›
  3. posts
  4. ›
  5. …

  6. ›
  7. 3 Microservice

Loading ⏳
Fetching content, this won’t take long…


💡 Did you know?

🍌 Bananas are berries, but strawberries are not.

🍪 This website uses cookies

No personal data is stored on our servers however third party tools Google Analytics cookies to measure traffic and improve your website experience. Learn more

Cover Image for 🛠️ Backend - Microservices 📖

🛠️ Backend - Microservices 📖

Learn about building and managing microservices architectures, including service communication, scalability, and deployment strategies.

Hitesh Sahu
Written by Hitesh Sahu, a passionate developer and blogger.

Tue Nov 11 2025

Share This on

Microservices

Small Autonomous Services that work together, modeled around business domain

  • Subset of Service Oriented Architecture(SOA)
  • Allow use of multiple DB & Tech Stacks for differeent features

Principal of MicroServices

1. Domain Driven Design

  • Services Modelled around Business Domain
  • Service decomose by business fomain
  • Slice vertically
  • Team expert in perticular domain

2. Automation CI/CD

  • Create a platform for deploying service.
  • Automate testing & deployment process for scaling with confidence.
  • Setting up a Process help scaling service easily.
  • Build->Test->UAT->Performance->Prod

3. Abstraction

  • Hide Implementation Detail from other service
  • Hide Database and allow service to communicate over service to access DB
  • Abstarction allow changing in Tables easier.
  • Easier to expose Info what is hidden than hide Info what is Shown

4. Independently Deployability

  • Avoid Release Train
  • Must not have aneed redeploy entire System if a service changes
  • Add test for dependent service using Test cases as Pact to give confidence
  • Co Exist End Point-Beta API release to give consumer time to upgrade.

5. Distributed/ Decentralized Power Across Team

  • Give power to team
  • Team must be autonomus
  • A man with power slow down the process

6. Consumer First

  • Make life easy for Developer
  • Good Documentation
  • Provide Swagger JSON

7. Isolate Failure

  • Reduce Impact of failure of Service failure
  • Reduce Cascading failure

8. Highly Observable

  • Logs to monitor failure
  • Error Logs & Failure
  • Latency of calls between service
  • ID to trace service flow

Migration to MicroService

Monolith Types

  1. Single Process Monolith

    • All code in a Single process
    • All data in single DB
  2. Modular Monolith

    • Code is broken into modules.
    • Teams work on split modules
    • All Modules are packaged together into a single process
    • All data in single DB
  3. 3rd Party Monolith

    • Limited to no abaility to change core system
    • Might have access to storage & API
  4. Distributed Monolith

  • Process communicate over process
  • Complex release System
  • Downside of both distributed system &
  • Large scoped deployment lerage
  • High cost of change & risk
  • Release train to abort before release

Issue with monolith

  • Scalability

CAP Theory

  • In a Partion we have to tradeoff Consistancy over Availability

Compariosn to MicroService

monolith Microservice
Simplicity Incremental Partial Development
Consistancy of DBMS High Availability of Services
Inter module refactoring b/n module boundry Force Preserve Modularity all the time
Fix Tech Stack and hard to change Flexibility of Multiple platforms Tech stack/dbms/platform

Decomposition

Incremental Upgrade

  • Extract a process to Micro Service
  • Increamental extract & refactor feature/process
  • Wrap new functionality around old functionality

Routing

  • Find issue with Network beforehand and add HTTP Proxy
  • HTTP Proxy divert call to Monolith and Side Service

Branch by Abstraction

  • Add abstraction around functionality
  • It Give swap point for changing feature
  • Start work on a new service
  • Switch Service
  • Clean Up

Parallel Run

  • Call current service & new service
  • Varify new service output & check if it behave same as Existing implementation

Accessing Data

  • MS need to access same data
  • Direct access cause Coupling Problem
  • Go through Monolith to access DB in this case
  • Dependency can be inverted in case Monolith need data from Monolith

CAP Theory

  • In a Partion we have to tradeoff Consistancy over Availability

Security

Prevention-> Detection-> Response- >Recovery

  1. Attack Tree
  • Brainstorm ways attack can happen and try to prevent them
  • Find possible point of attack & Possibility of cracking
  1. HTTPS
  • Server gurantees
  • Payload not manipulated
  • Client not guarantee
  • Make sure Certificate is Secure and Authentic
  1. Client side Certificate
  • Client guarantees
  1. Add Authentication (OAuth, FormAuth)
  • User access management
  1. Confused Deputy
  • Whoever asking a data is authenticated
  • Token validation
  1. Security Problem in Docker Image
  • Check if image is up to date
  • Check if docker image have vulnaribility
  1. Patch the tech stack
Programming/3-Microservice
Let's work together
+49 176-2019-2523
hiteshkrsahu@gmail.com
WhatsApp
Skype
Munich 🥨, Germany 🇩🇪, EU
Playstore
Hitesh Sahu's apps on Google Play Store
Need Help?
Let's Connect
Navigation
  Home/About
  Skills
  Work/Projects
  Lab/Experiments
  Contribution
  Awards
  Art/Sketches
  Thoughts
  Contact
Links
  Sitemap
  Legal Notice
  Privacy Policy

Made with

NextJS logo

NextJS by

hitesh Sahu

| © 2025 All rights reserved.