Microservices simplified for Product Managers
“What are Microservices?” “Explain Microservices?”
This is one of the most popular Product management technical interview questions. Get a 2-minute explanation of Microservices in this post.
Monolith vs Microservices Architecture Source: aws.com
PS: The best decision I made in my Product management career so far was to become Technical. It opened me up to 6 figure job opportunities.
For the next 8 weeks, I’ll be sharing free resources to help you become a technical product manager. Subscribe to my newsletter to get trained as a Technical Product manager.
👋 Hey, it’s Valentine. Welcome to my weekly newsletter where I share resources and tips to help you become a product manager.
If you’re not a subscriber, here’s what you missed previously:
Get Solutions to 7 popular PM interview questions using frameworks from PMs at Google, Microsoft, and Amazon PMs. Use discount code i2s85yu today only to get a 50 % discount. Limited to 5 customers only
Get 4 case studies I submitted to hiring managers got me offers from different companies. Use discount code i2s85yu today only to get a 50 % discount. Limited to 5 customers only
Free resources (worth at least 3500$) that helped me transition from customer success to Product Management (liked by 500+ people
Sample resume used by PMs to land a Microsoft offer. (Liked by 2000+ people)
What are Microservices?
Microservices are an architectural approach to software development where software is broken into small independent services that communicate over well-defined APIs. This makes applications easier to scale and faster to develop.
To leverage Microservices, Netflix has microservices for streaming, microservices to manage its video catalog, microservices to manage user preferences,microservices to manage its recommendation engine.
The benefit of Microservices is that during weekends or peak hours, Netflix can easily scale up only its streaming microservices while leaving other microservices as they are. This saves Netflix millions of dollars every month.
By 2017,Netflix architecture consisted of over 700 loosely coupled microservices. Today, Netflix makes around $9.8 billion Q3 2024 and streams approximately six billion hours of content weekly to more than 282 million subscribers in 190 countries, and it continues to grow.
Amazon, Google drive and Uber, just to mention a few, moved to the Microservices architecture and have seen lots of benefits.
Differences between Monolithic vs. Microservices Architecture
Monolithic architecture is an older type of architecture where the various components are tightly coupled and work as a single unit . Here are the differences between both architectures
Differences between Monolithic and Microservices
Monolithic Architecture:
Features are tightly coupled and run as a single service.
Scaling requires the entire application to be scaled, even for a single process demand.
Growing codebases increase complexity, limiting feature improvements and experimentation.
Microservices Architecture:
Applications are built as independent components, each running a specific process as a service.
Services communicate via lightweight APIs and are aligned with business capabilities.
Each service can be independently updated, deployed, and scaled to meet specific demands.
Promotes modularity, making it easier to implement new features and experiment.
Reduces risk by isolating failures to specific services, preserving overall application availability.
Core Principles of Microservices Architecture
Uber’s Microservices structure Source: Dzone https://dzone.com/articles/microservice-architecture-learn-build-and-deploy-a
1. Independence: Each service operates independently, allowing teams to develop, deploy, and scale services autonomously without affecting others.
2. Business Function Alignment: Each microservice corresponds to a specific business capability, promoting modularity and clarity.
3. Decentralized Data Management: Instead of a single monolithic database, each service manages its own data, enhancing scalability and fault isolation.
4. API Communication: Microservices interact via lightweight protocols like REST, gRPC, or messaging queues, ensuring seamless integration and interoperability.
Benefits of Microservices Architectures
Scalability: Services can be scaled independently based on their load requirements.
Resilience: Failures are isolated to specific services, reducing the risk of a complete system crash.
Faster Development: Teams can work on different services simultaneously, accelerating development cycles.
Microservices Design Patterns
1. API Gateway: This acts as a single entry point for clients, routing requests to appropriate services. This simplifies communication, enhances security, and allows cross-cutting concerns like authentication and rate limiting to be centralized.
2. Database Per Service Pattern: in this pattern each service manages its own database. This Promotes independence and prevents bottlenecks, though it requires careful data synchronization strategies.
3. Saga Pattern: this manages distributed transactions across multiple services.
This ensures consistency without relying on a centralized transaction manager, crucial for maintaining data integrity.
4. Event Sourcing : this pattern stores changes as a sequence of events rather than overwriting data. This enables auditability, replaying past events, and reconstructing state efficiently.
5. Service Discovery: this pattern allows microservices to dynamically locate each other using a registry. This Simplifies scaling and dynamic infrastructure management.
Challenges to Consider before implementing Microservices
Complexity: Requires robust DevOps practices and tools for monitoring, debugging, and deployment.
Latency: Inter-service communication can add delays.
Data Consistency: Maintaining consistency across decentralized databases is non-trivial.
Practical Use Cases of Microservices
Apps Leveraging Microservices
- Spotify: Manages music catalog, recommendations, and user playlists using microservices.
- Twitter: Scales its timelines, tweets, and notifications through microservices.
- Airbnb: Uses microservices for booking management, payments, and property listings.
- Google: Implements microservices across Gmail, Drive, and other services to handle massive scale and complexity.
Challenges
Complexity: Managing many services requires robust infrastructure, monitoring, and orchestration tools.
Latency: Inter-service communication introduces overhead and may impact performance.
Testing: Requires advanced strategies like contract testing to validate interactions between services.
Data Consistency: Handling eventual consistency and synchronization across decentralized data is challenging.
Cost: Maintaining multiple services increases infrastructure and operational expenses.
Tools and Practices
Containerization: Use Docker or Kubernetes for consistent deployment and orchestration.
Monitoring: Leverage tools like Prometheus, Grafana, or ELK Stack for observability.
CI/CD: Automate testing and deployments to ensure reliability and speed.
Messaging Systems: Employ Kafka, RabbitMQ, or AWS SQS for asynchronous communication.
That’s it for today. See you next week!
When you are ready I can help you in 4 ways!
Get Solutions to 7 popular PM interview questions using frameworks from PMs at Google, Microsoft, and Amazon PMs. Use discount code i2s85yu today only to get at a 50 % discount. Limited to 5 customers only
Get 4 case studies I submitted to hiring managers got me offers from different companies. Use discount code i2s85yu today only to get at a 50 % discount. Limited to 5 customers only
Free resources (worth at least 3500$) that helped me transition from customer success to Product Management (liked by 500+ people
Sample resume used by PMs to land a Microsoft offer. (Liked by 2000+ people)
Feedback from a PM in the United Kingdom who landed her first role through close mentorship
Free Resources:
Introduction to Microservices
More about Microservices
Introduction to AI product management