Microservices Flashcards
What is microservices?
Microservices is an architectural style that structures an application as a collection of small autonomous services, modeled around a business domain
What are the main advantages of microservices?
- Independent Development
- Speed of development
- Independent Deployment
- Security and access for some private services.
- Mixed Technology Stack
- Resielence (If one component of a system
fails, you can isolate the problem) - Scaling
- Optimizing for Replaceability
What are the main disadvantages of microservices?
- Wrong splitting to context
- Building integration between services
- Managing dependencies could be hard
- Much harder to test and monitor than traditional architectures.
- Nearly impossible to carry transactions across API calls
- Insufficient scaling of one service leads to scalability problems and frequently to a failure of other services which depend on it. This is known as backpressure.
How small should be microservices?
- If one team can’t handle this size, would be better to split into the fewer pieces.
What alternatives for microservices do we have?
- Shared libraries (gems)
- Modules
What general points can help you take a good architectural decision?
- Vision ( where a company going to be in the future? for example, become word wide platform)
- Principles ( rules which will lead you to the company aim. for example write code which will be used for many years in the future)
- Practices ( how to achieve principle, for example, guidelines)
Should we use a shared database for microservices?
Pluses
- easy
Minuses
- can’t replace a database
- everyone has access to the whole data ( you can break something accidentally )
What is SOAP?
SOAP is an acronym for Simple Object Access Protocol. It is an XML-based messaging protocol for exchanging information among computers. SOAP is an application of the XML specification.
What are the main rules for creating good integration?
- Avoid Breaking Changes.
For example, if a microservice adds new fields to a piece of data it sends out, existing consumers shouldn’t be impacted. ( add a new field to API and fronted is broken) - Be APIs Technology-Agnostic
This means avoiding integration technology that dictates what technology stacks we can use to implement our
microservices. (Integration tools which works only in one env is not a good idea)
What does it mean ‘Cost of changes’?
This is how difficult to add new changes to the project.
What ways/tools you can use to build an integration between microservices?
- Shared database
- Remote Procedure Calls
- REST
What is Remote Procedure Calls? (RPC)
Remote procedure call refers to the technique of making a local call and having it execute on a remote service somewhere.
What is REST?
REpresentational State Transfer (REST)
What is RabbitMQ?
RabbitMQ is a messaging broker. It gives your applications a common platform to send and receive messages, and your messages a safe place to live until received.
How to handle versioning?
- gem version (1.2.23 bump when works)
- old and new API endpoint works together
- old API request converts to the new request