Reader small image

You're reading from  Mastering Spring Cloud

Product typeBook
Published inApr 2018
Reading LevelIntermediate
PublisherPackt
ISBN-139781788475433
Edition1st Edition
Languages
Right arrow
Author (1)
Piotr Mińkowski
Piotr Mińkowski
author image
Piotr Mińkowski

Piotr works as a Solution Architect at Red Hat. He has several years of experience in software architecture and development. During this time, he was working in large organizations, where he was responsible for IT transformation to the modern cloud-native development approach. He is interested in technologies related to programming, containerization, and microservices. He writes about it in his blog https://piotrminkowski.com.
Read more about Piotr Mińkowski

Right arrow

Chapter 15. Spring Microservices on Cloud Platforms

Pivotal defines Spring Cloud as a framework that accelerates cloud-native application development. Today, when we talk about cloud-native applications, the first thing that comes to mind is the ability to deliver software quickly. To meet these demands, we should be able to quickly build new applications and design architectures that are scalable, portable, and prepared to be frequently updated. The tools that provide the mechanisms for containerization and orchestration help us in setting up and maintaining such an architecture. In fact, tools such as Docker or Kubernetes, which we have looked at in previous chapters, allow us to create our own private cloud and run Spring Cloud microservices on it. Although an application does not have to be deployed on a public cloud, it contains all of the most important characteristics of cloud software. 

Deploying your Spring application on a public cloud is just a possibility, not a necessity. However...

Pivotal Cloud Foundry


Although the Pivotal platform can run applications written in many languages, including Java, .NET, Ruby, JavaScript, Python, PHP, and Go, it has the best support for Spring Cloud Services and Netflix OSS tools. It makes perfect sense because they are the ones who developed Spring Cloud. Take a look at the following diagram, which is also available on Pivotal's official website. The following diagram illustrates the microservices-based architecture provided by the Pivotal Cloud platform. You can use Spring Cloud on Cloud Foundry to quickly leverage common microservice patterns, including distributed configuration management, service discovery, dynamic routing, load balancing, and fault tolerance:

Usage models

You can use the Pivotal platform in three different models. Models are distinguished based on the host, which is where the applications are deployed. The following is a list of the available solutions:

  • PCF Dev: This instance of the Pivotal platform can be run locally...

The Heroku platform


Heroku is one of the oldest cloud platforms created using the PaaS (Platform as a Service) model. In comparison to Pivotal Cloud Foundry, Heroku doesn't have built-in support for Spring Cloud applications. It complicates our model a little because we can't use a platform's services to enable typical microservices components, including service discovery, a configuration server, or a circuit breaker. In spite of this, Heroku contains some really interesting features that are not provided by Pivotal Web Services.

Deployment methods

We can manage our application using the CLI, web console or a dedicated Maven plugin. Deploying Heroku is pretty similar to deploying the Pivotal platform, however, the methods are slightly different. The main approach assumes that you deploy the application by building it from the source code stored in your local Git repository or on GitHub. The build is executed by the Heroku platform automatically after you have pushed some changes in a branch...

Summary


We have reached the end of our Spring Cloud microservices journey! Our exercises began with simple deployments on the local machine, but in the last chapter we deployed our microservices in an environment fully-managed by the cloud vendor, which also automatically built, started, and exposed HTTP APIs on specified domains. I personally think that it is amazing how easily we can run, scale, and expose data outside an application using any of the most popular programming languages or third-party tools, such as a database or a message broker. In fact, each one of us can now implement and launch a production-ready application to the web within a few hours without worrying about the software that has to be installed.

This chapter has shown you how easily you can run Spring Cloud microservices on different platforms. The given examples illustrate the real power of cloud-native applications. No matter whether you launch an application locally on your laptop, inside a Docker Container, using...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Mastering Spring Cloud
Published in: Apr 2018Publisher: PacktISBN-13: 9781788475433
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Piotr Mińkowski

Piotr works as a Solution Architect at Red Hat. He has several years of experience in software architecture and development. During this time, he was working in large organizations, where he was responsible for IT transformation to the modern cloud-native development approach. He is interested in technologies related to programming, containerization, and microservices. He writes about it in his blog https://piotrminkowski.com.
Read more about Piotr Mińkowski