Describe the flow of HTTPS requests through the Spring Boot application?
On a high-level spring boot application follow the MVC pattern which is depicted in the below flow diagram.
Spring Boot Flow Architecture
24. What is the difference between RequestMapping and GetMapping?
RequestMapping can be used with GET, POST, PUT, and many other request methods using the method attribute on the annotation. Whereas getMapping is only an extension of RequestMapping which helps you to improve on clarity on request.
25. What is the use of Profiles in spring boot?
While developing the application we deal with multiple environments such as dev, QA, Prod, and each environment requires a different configuration. For eg., we might be using an embedded H2 database for dev but for prod, we might have proprietary Oracle or DB2. Even if DBMS is the same across the environment, the URLs will be different.
To make this easy and clean, Spring has the provision of Profiles to keep the separate configuration of environments.
26. What is Spring Actuator? What are its advantages?
An actuator is an additional feature of Spring that helps you to monitor and manage your application when you push it to production. These actuators include auditing, health, CPU usage, HTTP hits, and metric gathering, and many more that are automatically applied to your application.
27. How to enable Actuator in Spring boot application?
To enable the spring actuator feature, we need to add the dependency of “spring-boot-starter-actuator” in pom.xml.
<dependency>
<groupId> org.springframework.boot</groupId>
<artifactId> spring-boot-starter-actuator </artifactId>
</dependency> What is Spring?
Before understanding Spring let’s understand what is a Framework? The framework is a re-usable design platform for software systems, which provides support for code libraries and various scripting languages In simple words a framework is something that makes core programming easy. There are frameworks for PHP, Perl, Java, Python, Ruby, and many other languages. All Software Frameworks are built with the idea of reusability of the code and provide tools that help programmers develop and bind together different components of a software project.
Now, we know what a framework is so let’s jump to the definition of Spring. What is Spring? Spring is a lightweight application framework and we can say it is similar to the framework of frameworks because it provides support to various frameworks such as Struts, JSP, Hibernate, etc. The first version of the Spring framework was written by Rod Johnson in 2002 and the framework was first released in 2003 under the Apache license version 2.0.
Basis
Spring
Spring Boot
Where it’s used?
Spring framework is a java EE framework that is used to build applications.
Spring Boot framework is mainly used to develop REST API’s
Key feature
The primary or most important feature of the Spring framework is dependency injection(Dependency Injection (DI) is a design technique that removes dependencies from computer code, making the application easier to maintain and test).
The main or primary feature of the Spring Boot is Autoconfiguration( Simply described, Spring Boot autoconfiguration is a method of automatically configuring a Spring application based on the dependencies found on the classpath.) Autoconfiguration can speed up and simplify development by removing the need to define some beans that are part of the auto-configuration classes.
Why it’s used
Its goal is to make Java EE (Enterprise Edition) development easier, allowing developers to be more productive.
Spring Boot provides the RAD(Rapid Application Development) feature to the Spring framework for faster application development.
Type of Application Development
Spring framework helps to create a loosely coupled application.
Spring Boot helps to create a stand-alone application.
Servers dependency
In the Spring framework to test the Spring Project, we need to set up the servers explicitly.
Spring Boot offers built-in or embedded servers such as Tomcat and jetty.
Deployment descriptor
To run a Spring application a deployment descriptor is required.
In Spring Boot there is no need for the Deployment descriptor.
In-memory database support
Spring framework does not provide support for the in-memory database.
Spring Boot provides support for the in-memory database such as H2.
Boilerplate code
Spring framework requires too many lines of code (boilerplate code) even for minimal tasks.
You avoid boilerplate code which reduces time and increases productivity.
Configurations
In the Spring framework, you have to build configurations manually.
In Spring Boot there are default configurations that allow faster bootstrapping.
Dependencies
Spring Framework requires a number of dependencies to create a web app.
Spring Boot, on the other hand, can get an application working with just one dependency. There are several more dependencies required during build time that is added to the final archive by default.
HTTP Authentication
HTTP Basic Authentication is for enabling security confirmations, it indicates that several dependencies and configurations need to be enabled to enable security. Spring requires both the standard spring-security-web and spring-security-config dependencies to set up security in an application. Next, we need to add a class that extends the WebSecurityConfigurerAdapter and makes use of the @EnableWebSecurity annotation.
Spring Boot also requires these dependencies to make it work, but we only need to define the dependency of spring-boot-starter-security as this will automatically add all the relevant dependencies to the classpath.
Testing
Testing in Spring Boot is difficult in comparison to Spring Boot due to a large amount of source code.
Testing in Spring Boot is easier due to the reduced amount of source code.
XML Configuration
In the Spring framework, XML Configuration is required.
No need for XML configuration in Spring Boot.
CLI Tools
Spring framework does not provide any CLI tool for developing and testing applications.
Spring Boot provides a CLI tool for developing and testing Spring Boot applications.
Plugins
Spring framework does not provide any plugin for maven, Gradle, etc. like Spring Boot.
Spring Boot provides build tool plugins for Maven and Gradle. The Plugins offer a variety of features, including the packaging of executable jars.
Spark applications run as independent sets of processes on a cluster, coordinated by the SparkContext object in your main program (called the driver program ). Specifically, to run on a cluster, the SparkContext can connect to several types of cluster managers (either Spark’s own standalone cluster manager, Mesos or YARN), which allocate resources across applications. Once connected, Spark acquires executors on nodes in the cluster, which are processes that run computations and store data for your application. Next, it sends your application code (defined by JAR or Python files passed to SparkContext) to the executors. Finally, SparkContext sends tasks to the executors to run. There are several useful things to note about this architecture: Each application gets its own executor processes, which stay up for the duration of the whole application and run tasks in multiple threads. This has the benefit of isolating applications from ...
DORA metrics, often referred to as the DORA (DevOps Research and Assessment) metrics, are a set of key performance indicators (KPIs) used to measure and assess the effectiveness of an organization's DevOps practices. DORA metrics were developed by the DevOps Research and Assessment team, which includes notable figures in the DevOps community such as Dr. Nicole Forsgren and Jez Humble. The DORA metrics encompass four key areas: 1. **Deployment Frequency:** This metric measures how often an organization deploys code changes to production. Higher deployment frequencies indicate a more agile and responsive development process. 2. **Lead Time for Changes:** This metric tracks the time it takes for code changes to go from code commit to being deployed in production. Shorter lead times suggest efficient and streamlined development and delivery processes. 3. **Mean Time to Recover (MTTR):** MTTR measures how quickly an organization can recover from failures or incidents in production. Low...
Comments
Post a Comment