Prev Next

Spring / Microservices

Could not find what you were looking for? send us the question and we would be happy to answer your question.

Explain micro service architecture.

Microservices are design patterns, a variant of the service-oriented architecture (SOA) architectural style, structures an application as a collection of loosely coupled independent services. In a microservices architecture, services are fine-grained and uses lightweight protocols.

The advantage of decomposing an application into smaller services is to improve modularity, enables the application easier to understand, develop, test, and become more resilient to architecture erosion. It helps to parallelize development by enabling different teams to develop, deploy and scale its respective services/modules independently.

It also allows the architecture of an individual service to emerge through continuous refactoring. Microservices-based architectures enable continuous delivery and deployment.

Explain the benefits of microservices.

Modularity of large application into microservices help achieve loose coupling when one module failed keeps other modules unaffected and live. Fault isolation is highly improved.

Modularity also helps developer understand and write code, enables parallelizing developments of different modules.

Continuous integration (CI) and deployments made easier.

Improved scalability.

Promotes the usage of its own technology stack per module, isolated from other modules which has zero impact on other modules.

Application troubleshooting and debugging will be quicker as it is easy to isolate which service to look into.

Containerization such as docker is easy and cloud friendly.

Smaller team.

Some of the challenges with Microservice.

Modularity in term of service may lead to duplication of efforts and code.

Application with too many modules make difficult to manage.

DevOps skill set may be required which lead to additonal resource challenge.

Explain spring boot in the context of microservices.

Spring boot provides easy means of creating stand-alone applications with minimal or no configurations. Spring boot provides default code and configurations required to start a spring project quickly.

What is Docker?

Docker is a container that package software in a format that can run isolated on a shared operating system. Unlike VMs, containers do not bundle a full operating system, only the libraries, and settings required to make the software work.

This makes for efficient, lightweight, self-contained systems and guarantees that software will always run the same, regardless of where it is deployed.

What is Dockerfile?

Dockerfile describes the build process for an image. It is run to automatically create an image. It has all the commands necessary to build the image and run your application.

What is kubernetes?

Kubernetes is an open-source container orchestration system for automating deployment, scaling, and management of containerized applications.

What are polyglot microservices?

The polyglot microservices is based on polyglot programming, the practice of writing code in multiple languages to capture additional functionality and efficiency not available in a single language.

What is a service mesh?

Service mesh is used to describe the network of microservices that make up such applications and the interactions between them.

What is distributed tracing?

Distributed tracing systems allows tracking a request through a software system that is distributed across multiple applications, services, and databases as well as through proxies.

Distributed tracing allow us to measure the total time a request took to complete across multiple services. It helps gather timing data needed to troubleshoot latency problems in service architectures.

There are many distributed tracing systems like Zipkin, OpenTracing, etc.

Explain Trace and Span terminologies in distributed tracing.

A trace is an end to end latency graph, composing of the different spans.

A span is an individual operation that takes place, In a microservice architecture, a request may pass through a set of different services and each represents one span and altogether represents a trace.

How do I decompose an application into services?

We can decompose in several catogories.

  • Split by business functionality - define services corresponding to business capabilities.
  • Self-contained Service - design services to handle synchronous requests without waiting for other services.
  • Services by team.
What is Semantic monitoring in Microservices architecture?

Semantic monitoring also known as synthetic monitoring runs certain application's automated tests against the live production system on a regular basis in a specified interval. The results are published into the monitoring service, which triggers alerts in case of any failures. This technique combines automation testing with monitoring in order to detect failing business requirements in production.

Once an issue is detected, it allow faster isolation and bug triaging, thereby reducing the main time required to repair.

What is Melvin Conway's Law?

Melvin Conway's law states that the "Organizations which design systems are constrained to produce designs which are copies of the communication structures of these organizations."

What is Spring Cloud?

Spring Cloud provides tools for developers to quickly build some of the common patterns in distributed systems such as configuration management, service discovery, circuit breakers, intelligent routing, micro-proxy, control bus, one-time tokens, global locks, leadership election, distributed sessions, cluster state.

Coordination of distributed systems leads to boilerplate patterns, and using Spring Cloud developers can quickly stand up services and applications that implement those patterns.

What is a CDC?

CDC is Consumer-Driven Contract. It is a pattern for developing Microservices so that external systems can use them.

What is PACT in Microservices Architecture?

A contract between a consumer application and a provider application is called a PACT. Each pact is a collection of interactions. It is an open-source tool that can be used to implement the Consumer-Driven Contract in Microservices.

What is a Client Certificate?

Client Certificate is a type of digital certificate usually used by client systems for making a request that is authenticated by a remote server. It plays an important role in authentication designs that are mutual and provides strong assurance of the identity of a requester. However, you should have a fully configured back-end service for authenticating your client certificate.

What is meant by Continuous Integration?

Continuous Integration (CI) is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early.

What is Blue-Green Deployment Technique?

Blue-green deployment is a technique that reduces downtime and risk by running two identical production environments called Blue and Green. At any time, only one of the environments is live, with the live environment serving all production traffic while the other is idle.

As you prepare a new version of your software, deployment and the final stage of testing takes place in an environment that is not LIVE (GREEN). Once you have deployed and fully tested the software in non-live (GREEN), you switch the router so all incoming requests now go to Green instead of Blue (earlier LIVE). Green is now live, and Blue is idle.

This technique can eliminate downtime due to application deployment. In addition, blue-green deployment reduces risk: if something unexpected happens with your new version on Green, you can immediately roll back to the last version by switching back to Blue.

«
»
Creating simple Spring boot application using Eclipse and Gradle

Comments & Discussions