Topic 5:
API Gateway Pattern:
===============
In a microservice, we might be having different services doing different things, having a single point of entry for external consumers to access these various services is known as API Gateway pattern. It makes easier to manage, secure our services and provide unified interface to external world
-It hides the complexity from the clients
Functions of API Gateway:
----------------------------
Routing, Authorization, Rate limiting, Load Balancing, Caching, Monitoring, Logging, Transformation, Service Discovery, Circuit breaker, version management
Advantages of Using API Gateway pattern:
---------------------------------------------
1. Reduces complexity of interactions: API gateway simplifies the communication between different services.
2. Consistency API Calls: Different services use different data formats to interact. API gateways translate calls & data formats
3. Security: Central place to handle authentication and authorization.
4. Load Balancing
5. Caching: Can cache responses from service and improve performance
6. Single point for monitoring, analytics and logging
7. Version Management: Can route requests to different versions of a service based on client request
8. API gateway can act as request aggregator, user don't have to send multiple requests to get some information, API gateway does call different services, collects info and send back the full information.
-Here client is making only one call to API gateway, but API gateway is making multiple calls & reducing user's effort
-Example: On Instagram, user sends API request to get feed, API Gate way sends request to Notification service and feed service, aggregates response and sends back to user
9. Different clients might need different types of information, API gateway takes care of that (for example: Request made from phone, cli, laptop & TV might get data in different formats)
Problems of API Gateway pattern:
------------------------------------
1. Single point of failure: Go for redundancy
2. Bottleneck: All requests go through the gateway, so scale horizontally.
3. Complexity: Gateway will do many things, so split the functionalities into multiple gateways
4. Security: If gateway is compromised, everything is done and dusted
Topic 4:
Strangler Fig Pattern:
================
-Monolith (legacy system) is slowly replaced with a microservice
-Firstly, we will remove redundancy in monolith and make components loosely coupled
-Then we introduce abstraction
-Now, we try to create new microservice one by one for each functionality of monolith
-We will introduce a Facade interface/router/proxy layer (IMPORTANT), to divert the traffic to new microservice
-Facade interface is the backbone of Strangler fig pattern
Things to keep in mind while introducing Strangler fig pattern:
----------------------------------------
1. Proxy layer: Gatekeeper that knows which service was now available in microservice & which is still present in monolith
-Use features flags to turn on/off new functionalities
-User segmentation: route users in phases for A/B testing
-API version: route request based on version headers
2. Data consistency: New microservice should sync data with legacy system, either through replication.
-Replication can be done by even-driven approach
3. State management: If you are doing phased roll out, keep in mind that we have to do to state sharing between old and new systems/
-Like shared caches, etc.
4. Rollback strategy: We should have a prepared strategy to rollback to old system
-Example, use feature toggles or dynamic routing to easily switch between systems.
5. Testing: Testing should be done properly
-Contract Testing: Are all our new features obeying expected behaviour
-E2E testing
-Performance Testing:
6. Zero-Downtime Migration:
-Use approaches like blue-green or canary deployment so user don't face any issue
7. Data Transformation: Our new service might be using different database model, so we should make sure to add a middleware to do data transformation
8. Security Consideration: Since 2 different services are now talking, we should make sure to check potential security vulnerabilities
-Also use security practices like API throttling, service-to-service authentication (mTLS), and regular vulnerability scanning.
Topic 4:
Strangler Fig Pattern:
================
-Monolith (legacy system) is slowly replaced with a microservice
-Firstly, we will remove redundancy in monolith and make components loosely coupled
-Then we introduce abstraction
-Now, we try to create new microservice one by one for each functionality of monolith
-We will introduce a Facade interface/router/proxy layer (IMPORTANT), to divert the traffic to new microservice
-Facade interface is the backbone of Strangler fig pattern
Things to keep in mind while introducing Strangler fig pattern:
----------------------------------------
1. Proxy layer: Gatekeeper that knows which service was now available in microservice & which is still present in monolith
-Use features flags to turn on/off new functionalities
-User segmentation: route users in phases for A/B testing
-API version: route request based on version headers
2. Data consistency: New microservice should sync data with legacy system, either through replication.
-Replication can be done by even-driven approach
3. State management: If you are doing phased roll out, keep in mind that we have to do to state sharing between old and new systems/
-Like shared caches, etc.
4. Rollback strategy: We should have a prepared strategy to rollback to old system
-Example, use feature toggles or dynamic routing to easily switch between systems.
5. Testing: Testing should be done properly
-Contract Testing: Are all our new features obeying expected behaviour
-E2E testing
-Performance Testing:
6. Zero-Downtime Migration:
-Use approaches like blue-green or canary deployment so user don't face any issue
7. Data Transformation: Our new service might be using different database model, so we should make sure to add a middleware to do data transformation
8. Security Consideration: Since 2 different services are now talking, we should make sure to check potential security vulnerabilities
-Also use security practices like API throttling, service-to-service authentication (mTLS), and regular vulnerability scanning.
Topic 3:
1. Blue-Green Deployment:
==================
-Maintains two identical environments: Blue(current) and Green(new). Switch all traffic at once.
-100% switch in one step
-All users get the new version immediately
2. Canary Deployment:
===============
-Release the new version to a small percentage of users first, then gradually increase traffic
-Only a subset of users see the new version initially
-When you want to minimize risk and validate changes with real users.
#LearnWithMe
Topic 3:
1. Blue-Green Deployment:
==================
-Maintains two identical environments: Blue(current) and Green(new). Switch all traffic at once.
-100% switch in one step
-All users get the new version immediately
2. Canary Deployment:
===============
-Release the new version to a small percentage of users first, then gradually increase traffic
-Only a subset of users see the new version initially
-When you want to minimize risk and validate changes with real users.
#LearnWithMe
Topic 2:
GraphQL is a query language for APIs and a runtime that sits between clients and backend services/databases. It allows clients to request exactly the data they need.
GraphQL itself does not automatically make database calls faster. The database performance depends on how the GraphQL resolvers are implemented.
GraphQL mainly reduces over-fetching and under-fetching of data, which can reduce network payload size and the number of API round trips.
#LearnWithMe
Today is weekend
Not going to trip
My target is to join MAANG or any big product-based company that pays huge salary within 1 year.
I am sacrificing my enjoyment and grinding in my room
Great things need sacrifice, and I am ready to sacrifice
Today I will understand these terms shared by @pulkit_mittal_ and will post the notes here
As a backend developer in 2026, how many of these 10 terms do you understand?
1. Idempotency
2. Backpressure
3. Circuit Breaker
4. Eventual Consistency
5. Distributed Lock
6. Exactly-Once vs At-Least-Once Delivery
7. Cold Start
8. High Cardinality Metrics
9. Sharding vs Partitioning
10. P99 Latency
Topic 2:
GraphQL is a query language for APIs and a runtime that sits between clients and backend services/databases. It allows clients to request exactly the data they need.
GraphQL itself does not automatically make database calls faster. The database performance depends on how the GraphQL resolvers are implemented.
GraphQL mainly reduces over-fetching and under-fetching of data, which can reduce network payload size and the number of API round trips.
#LearnWithMe
Shocking๐โ ๏ธ
A small account like mine, with 30 followers, ratioed Striver with 200k followers๐คฏ
Thank you @nikitabier and @elonmusk , for making @X awesome