Interview Questions Microservices - amitbhilagude/userfullinks GitHub Wiki
Explain Microservices
Split the entire application into smaller pieces so that they can deploy and manage separately.
Explain the scenario about our cloud suite, How many teams are there, How do they communicate with each other through APIs.
Give examples of microservice which is used in your project.
Always follow Domain Driven Design pattern for building Microservices.
Explain Monolithic
Opposite to Microservice, Single deployment with single solutions with all projects.
Build and Deploy as a single Package.
Advantages of Microservices
Having small pieces and deploy separately, you can have any technology choice. Explain we have microservice some in .net core 2.2. some in 3.1 and some are in .Net framework 4.7
Less downtime if there is targeted one microservice deployment rather than deploying entire monolithic application
Low risk if it changes small piece only. but again I assume the contract is not changed.
Independent deployment by each team.
Challenges of Microservices
It is a complex architecture, having many codebases, many build pipelines, Monitor them, and Operation overhead. We need to be planned well
If two microservices are communicating with each other they need to align the contract and delivery timeline. We have managed this will versioning mechanism.
Operations overhead is there for monitoring them but we build them correctly it will not more risk.
When is Microservices is best suited
When you have large applications and multiple teams
When you want scale specific application module which can be converted into Microsoft.
Common type of tests done in Microservices
Unit test: to test your microservices
Integration Test: To test your contract
Acceptance Test: Functionality Acceptance
Tools used for Microservices
Defining contract we use Open API Specification and import Azure APIM to finalize the contract.
Swagger and swashbuckler to create the open API specification
Why use the container for Microservices
Docker container help you build images with all the dependency and you can easily deploy them into any machine.
If you want to scale-out the microservices then it can easily deploy into another node.
Semantic Monitoring
Take one critical business case and check if end to end flow works fine.
CDC
Consumer Driven Contract. Build contract first.
Deployment Options
Rolling Upgrade: Deploy each node one by one by keeping rest nodes serving the request
Canary Deployment: Deploy based on geographical region
Blue-Green Deployment: Allow you to test the functionality in Production without downtime e.g. Deployment slots in App service