Wednesday, June 19, 2024

Microservices

What are the some of disadvantages of micro services?
  • Coordination complexity
    • As the micro service architecture comprises different services, communicating between them, these services become a little more complex.
    • Increased development time
    • Requires more complex architecture
    • Set up new architecture
    • Higher cost of implementation

Can we create micro services as state machines?
  • Micro services are independent entities that solve a specific context.
  • For that context, the micro service can work as a state machine.
  • In a state machine, there are life cycle events that cause change in the state of the system.
    • In a library, service, there is a book that changes state based on different events like procure a book, register a book, issue a book, return book, loser, book, lead to return of book, et cetera.
    • These events and book can form a state machine for library micro service.
How we can use multiple databases in spring micro services?
  • For different environment, we can use profile to use multiple databases.
  • Multiple databases for single environment can be configured using Java configuration.
    • We can have different data sources and object.
    • We can have factory method Which will give us different object based on conditions.
How can we scale micro services?
  • We can use Joule and Dribble to scale micro services.
What are some of the advantages of using micro services?
  • Single chain of responsibility(Scale up) Is better.
  • Easy to code and integrate.
  • Deployment takes less time as only concerned micro service needs to be deployed.
How can we perform session management in micro services?
  • We can use SAGA design pattern To perform session management in micro services.
    • We can apply with choreography approach or orchestration approach.
    • In choreography We can use event sourcing approach.
  • We can also manage session using correlation ID between micro services using mapped diagnostics context.
  • Asynchronous Session Can be managed using a broker like Kafka or Rabbit Mq etc.
What is Load Balancing?
  • Load balancing means distributing your incoming request to multiple server instances.

No comments:

Post a Comment

Spring Boot

What is circular/cyclic dependency in spring boot? When two services are interdependent on each other, that is to start one service, we requ...