Sunday, June 14, 2020

When will you go for microservice & when will you go for monoliths?


If your company does not have appetite for below, then do NOT go for microservices

  • Rapid provisioning (Infrastructure)
  • Basic monitoring
  • Rapid application deployment (deployment as well as rollback)
  • DevOps culture

Another very important point is, if you cannot define the service boundary right at first place, then it will be very difficult to fix later in microservices.

Disadvantages of Microservice


Complexity – Microservices are distributed systems. Application needs to make remote calls. And remote calls tends to fail. This brings in complexity.

Consistency – Each microservices has its own data store. Hence only eventual consistency is possible.

Transactions – Managing transactions needs additional efforts.

Domain boundary – If you have defined the domain boundary (bounded context in DDD) wrong in first place, then it’s very difficult to fix in Microservice.

Advantages of Microservice


Scalability – It’s easy to scale in or scale out services depending on business need. Also doesn’t have to scale the entire application.

Availability – even if one service is down, application can be functional.

Partial deployment – it’s possible to deploy changes to specific to a microservices. This is faster compared to deploying the entire application.

Independently upgradable – each microservices are like components, it’s possible to independently upgrade or replace them.

Multiple platforms/technology - software development can be done using different technologies.  (Polyglot)

What is Microservice?

Microservice is a way of building distributed software.

Here business capabilities are broken down into independently deployable services. Relatively smaller teams works on each of microservices. It talks to each other using inter process communication. Microservices let each service to choose its own data store and manage its data. These data will not be directly accessed by other microservice.

Saturday, March 28, 2020

Azure Cache for Redis - Observation

Redis cache is an open source In-Memory data store.

In-memory is best way to store and get data faster, but its not ideal for persisting data.

Nuget package StackExchange.Redis helps to configure Redis cache on .NET code

ConnectionMultiplexer class helps to establish connection with Redis cache.


Note: Redis Pricing Tier C0 Basic offers up to 250MB cache and is sufficient for the hands-on 


Wednesday, March 18, 2020

Terraform - Getting started

Terraform is an opensource tool for creating, changing and versioning infrastructure. It uses config files.

In other words, it uses Infrastructure as a Code (IaC) to provision cloud resources or any infrastructure.

Terraform execution steps are:

  1. init
  2. plan
  3. apply
  4. destroy
Terraform generates execution plan, before applying them.
Terraform plan command throws if any syntax or runtime error exits.
Terraform apply command provision the infrastructure on the cloud.
Terraform destroy command deletes the infrastructure from the cloud.

Reference:

Monday, March 16, 2020

Load Balancer Types in Azure

Load Balancers helps to distribute incoming network traffic
  1. Azure Load Balancer
  2. Azure Application Gateway
  3. Azure Traffic Manager

 Azure Load Balancer operates at Layer 4 of OSI model (TCP/UDP). It is a single point of contact for clients.

Azure Application Gateway operates at Layer 7 of OSI model (HTTP/HTTPS). It is a web traffic load balancer. That is it manages traffic to web applications

Azure Traffic Manager is DNS Based traffic load balancer. It manages traffic across multiple azure regions.