Spring Boot vs. Spring MVC vs. Spring: How Do They Compare?

In this article, you will receive overviews of Spring, Spring MVC, and Spring Boot, learn what problems they solve, and where they're best applied. The most important thing that you will learn is that Spring, Spring MVC, and Spring Boot are not competing for the same space. They solve different problems and they solve them very well.

What Is the Core Problem That Spring Framework Solves?

Think long and hard. What’s the problem Spring Framework solves?

Multiple Cache Configurations With Caffeine and Spring Boot

Caching is key for the performance of nearly every application. Distributed caching is sometimes needed, but not always. In many cases, a local cache would work just fine, and there’s no need for the overhead and complexity of the distributed cache.

So, in many applications, including plain Spring and Spring Boot, you can use @Cacheable on any method and its result will be cached so that the next time the method is invoked, the cached result is returned.

This Week in Spring: Spring Cloud, Kafka, and More

Hi, Spring fans, and welcome to another installment of This Week in Spring! This week, I’m in colorful Chicago, Illinois, and magnificent Milwaukee, Wisconsin. I am so excited to be in both places. I’m in Chicago for the GOTO Chicago event, which is always fun, and I’m in Milwaukee for a meetup and, of course, to partake of local delicacies like Kopps, a Cousins sub, and a Spotted Cow beer. Life is great!

Did you see this epic image of the Chicago Lakeshore area I took the other day? Spring is truly in full swing! (I’ll ignore the buckets of rain that have been dumped on Chicago and Milwaukee just a day after that photo was taken…)

What Are Spring Projects?

There are several important Spring Projects solving the needs of enterprises today. But first, it is essential to understand what are Spring Projects and how are they different from Spring Modules?

What You Will Learn

  • What are Spring Projects?
  • What are some examples of Spring Projects?
  • How are Spring Projects different from Spring Modules?

What Are Spring Projects?

Within the Spring Framework, there are a variety of different Spring modules — JDBC, AOP, Beans, and Context. All Spring Modules share the same release version as the Spring Framework. They are part of the same project.

Optimizing Relationships Between Entities in Hibernate

In this post, following the example project that you have here, I am going to explain how to optimize queries to a database using JPA.

You will see different types of queries explaining how to make connections between lazy and eager tables. The tables will be joined by a single field, by several and even by one, but adding a static condition.

Creating a Spring Boot Configuration Server Using a Database

You can find many articles on the internet about creating a Spring Boot configuration server using either a file system or git repository, but this is not true for a configuration server based on a database. In this article, I am going to discuss reasons to use a database as a configuration server and demonstrate how to create it using Spring Boot.

Storing configurations on a database seems to be a better idea than storing it on either a file system or git. Because it is less trackable, it is less secure. I admit that git has security and tracking options, but they seem to be complicated for a developer. However, tracking a database table is just creating a trigger for updates, and securing a database is not an issue for a developer. Again, changing a value in a database table is just so simple and easy to commit; however, it can be a cumbersome task to make a change in a git repository.

Spring Framework Basics: What Is Inversion of Control?

Developers starting with the Spring Framework often get confused with the terminology, specifically dependencies, dependency injection, and Inversion of Control. In this article, we introduce you to the concept of Inversion of Control.

What You Will Learn

  • What is Inversion of Control?
  • What are some examples of Inversion of Control?
  • How does the Spring Framework implement Inversion of Control?
  • Why is Inversion of Control important and what are its advantages?

What Is Inversion of Control?

Approach-1

Have a look at the following implementation of ComplexAlgorithmImpl:

This Week in Spring: Releases, Spring Data, Cloud, and More

Hi, Spring fans! Welcome to another wild-and-wacky week of This Week in Spring! I’m in Johannesburg, South Africa, where I both spoke at the SpringOne Tour South Africa event and at the Johannesburg Java User Group. I have had tons of fun on safari visiting (safely from a great distance and in an SUV) the utterly astonishing, beautiful, majestic wildlife here. I can’t stress that last part enough. The animals here are so, so, SO breathtaking. I got as close as I ever want to get to an elephant that was the size of a small house with eyes. Utterly massive! It towered over buses. When you go into the bush, my tour guide warned, you enter the food chain, and there, we don’t figure very high at all. The experience reminded me how insignificant I am and how utterly privileged I am to be here, with you, dear community. We’re all pretty lucky.

I also really enjoyed meeting some of the local community. My friend, Rory Preddy at Microsoft South Africa, was telling me that the local community here in South Africa is very small — tens of thousands of professional developers, if that. What the community lacks in quantity, they more than make up for in quality.

Easy Access to Data With Spring REST Data

Spring Boot offers fantastic support for accessing data with JPA through the use of interfaces that extends to the repository. If we add to this the ease with which REST services are created, as explained in this entry, we can make an application that offers an API to access our preferred database very easily.

But if we want to implement HATEOAS in our project or if there are a lot of entry points in our API, we must write a lot of code. To solve this problem, Spring Boot offers the library Spring Data Rest. With it, we can write an API REST to access our database easily and without writing much code.

Spring Boot REST Service: Download Files

Download a File From a Spring Boot REST Service

On HBase, I was working on a REST API that could download an ingested file from a table with a JSON response. It needs to be downloaded as a JSON file from the UI. I created a REST service that downloads single and selected multiple files as ZIP files.

Below is my input, and I need to download it as a JSON file.

This Week in Spring: Releases, Podcasts, Debugging, and More

Hi, Spring fans, and welcome to another installment of This Week in Spring! This week, I’m in New York City for the Kafka Summit where I’ll be joining the excellent Tim Berglund, head of developer experience at Confluent, and James Watters, SVP at Pivotal, to talk about why Pivotal and Confluent are better together. Join us! Then, next week it’s off to South Africa (for the SpringOne Tour shows in Capetown and Johannesburg), and then, it’s off again to Mauritius for the DevConf. If you’re in any of those places, don’t hesitate to say hi!.

LTR: Confluent co-founder Jay Kreps, Tim Berglund, me, and Pivotal SVP James Watters

A Bootiful Podcast: CQRS With AxonIQ’s Steven van Beelen and Pivotal’s Ben Wilcock

Hi Spring fans! In this week's installment Josh Long talks to AxonIQ's Steven van Beelen, lead of the Axon project, and Pivotal's Ben Wilcock, on CQRS, event-sourcing, event-storming, microservices, Spring Boot and the long camaraderie shared by Axon and Spring.

Effective Advice on Spring Async: Part 1

As per the current trend, I see developers from Juniors to Seniors all using Spring Boot as their weapon of choice to build software. The fact that it is developer friendly and its "convention over configuration" style helps the developer to only focus on business logic. If they are unsure as to how Springs works, just reviewing a Spring Boot tutorial can allow one to start using Spring Boot — it's that easy.

Another part of Spring Boot that I like is that developers do not have to know Spring's inner details — just put some annotations in, write the business code, and voila! With that said, sometimes, you have to know how it works. What I am trying to say is that you need to know your tool better so you can utilize it like a pro.

DAO Integration Test With TestContainers, Spring Boot, Liquibase, and PostgresSQL

In this article, we will cover how to do a DAO integration test when you have a spring boot application with PostgreSQL DB and Liquibase for schema versioning. Last time, we explained how to do the same without Liquibase using embedded PostgreSQL, but this time, we will do the same but use Docker with test containers, which will apply your Liquibase changes and make sure your DAO integration test has the same environment as the production database environment if you are using Docker for your database in production.

The whole code example is on GitHub.

Angular 7 + Spring Boot Application: Hello World Example

In this tutorial, we will create a full-stack application where we expose an endpoint using Spring Boot and consume this endpoint using Angular 7 and display the data. In the next tutorial, we will be further enhancing this application and performing CRUD operations.

Previously, we have seen what a PCF is and how to deploy an application to PCF. I have deployed this application we are developing to PCF. The demo application is as follows-