Spring Boot is probably the fastest way to get a Spring application up and running within less than 5 minutes and a very few little lines of code. I like to think at Spring Boot as a framework that takes most of the work out when it comes to configuring Spring-based applications.
Spring vs. Spring Boot
Spring Boot is an opinionated production ready-way to consume spring, which provides conventions over configuration to Spring (aka, it allows you to manage dependencies). Spring Boot provides sensible default, automatic configuration, and support for embedded HTTP server.
You can think as spring boot as spring + tomcat (or any other application server) – configuration.
Spring MVC is the part of spring that allows you to develop web applications. It is commonly used to:
- develop HTML web applications
- develop REST endpoints
- serve single page applications
Spring Data provides polyglot persistence within Spring. It provides a consistent programming model for a variety of different persistence stores: JDBC, JPA, MongoDB, Neo4J, Redis, Elasticsearch, Solr, Gemfire, Cassandra, Couchbase.
Spring Data provides a CrudRepository (support for create, read, update, delete operation over databases), and paging and sorting support. It also provides custom finder method support, for instance:
List<Travel> findByDestination(String destination)
is equal to
select * from travel where destination = :destination
There are different finder method which can be used:
Spring Data also offers template classes (same idea as JdbcTemplate). Template classes provides consistent ways for working with persistence stores. Example: mongoTemplate.
Three different ways to start with spring boot
From my experience there are three ways to start a spring boot project.
Using the spring boot command line interface (CLI)
brew tap pivotal/tap && brew install springboot
You can also download and install the spring boot CLI. To perform this activity follow the instruction here.
With Spring Tool Suite or IntelliJ
Open your IDE of choice and navigate to: File -> New -> Spring Starter Project