what is Cloud Foundry & spring - spring

I am trying to get the idea of cloud serves but didn't get the point of that.
Dose it can replace a server for the app?
what is the purpose of it?
I have an android app and I what to get info from the server can it be done with Cloud Foundry and what is spring and how it connects to Cloud Foundry.
If you can give me link of how to communicate android app with Cloud Foundry
thanks a lot!

CloudFoundry's an open-source PaaS (github.com/cloudfoundry). It commoditizes the stack - that is, in practical terms, it makes it dead simple to get things like databases (MySQL, PostgreSQL, Redis, MongoDB), messaging (RabbitMQ), and web servers (Tomcat) up and running quickly. Whereas clouds like AWS let you spin up CPUs and hard disks and a stock OS install, a PaaS like CloudFoundry lets you spin up infrastructure, like message brokers, databases, and web servers and routers. So, yes, it replaces a server (or, often more importantly, it can stand in for 1000 servers on-demand). That's the obvious part.
CloudFoundry itself is open source, so unlike other PaaS solutions, by building on top of CF you're not locked into CF. You can later decide to run the cloud locally on your own datacenter, or on some other CloudFoundry provider (CloudFoundry.com is just one provider of the CloudFoundry software. Just as you can easily re-target a git repisotry to have it point to any remote repository using the git command line tool, you can re-target the CloudFoundry 'vmc' command line tool to point to a different CloudFoundry install.
Spring's a development framework in Java. It's not the only way to consume CF, but I personally think it's quite nice. CF exposes a lot of different technologies for the eager technologist and Spring provides the only comprehensive library set that can handle all those options. Learn one Spring library and the others will feel simialar, and so it's more natural to get started with a new API and technology. In the way that APIs designed with idiomatic Python APIs are said to be "Pythonic," Spring's APIs are cohesive and work nicely together. However, if Java's not your cup of tea (punny!), then that's OK too. CloudFoundry supports Ruby on Rails, Scala, Node.js, and other cloudfoundry providers support alternatives (Stacato supports Python, AppFog supports PHP, etc.)
For a quick example demonstrating how to get started with Spring, and the SpringSource Tool Suite, and a development virtual machine for CloudFoundry (so you can develop locally and quickly), check out this blog (and, particularly, the video embedded therein): http://blog.springsource.com/2011/08/24/micro-cloud-foundry-for-spring-developers/

The Springsource team has been doing some interesting work this year integrating a variety of Spring projects with Cloud Foundry.
With the rising popularity of microservices, many of the Spring projects are proving to be useful not only for quickly developing these smaller, lighter weight services, but also for easily incorporating some of the projects from Netflix OSS that implement patterns for making them industrial strength even at web scale.
A few related links:
The latest Cloud Foundry Java buildpacks include support for Spring
Boot and Spring Auto-reconfig (https://github.com/cloudfoundry/java-buildpack/releases).
The CF docs
contain an example on deploying Spring Boot apps to Cloud Foundry or
Heroku
The new Spring Cloud project will "Integrate your application with Pivotal Cloudfoundry. Makes it easy to implement SSO and OAuth2 protected resources, and also to create a Cloudfoundry service broker."
I look forward to seeing more of the results from the collaboration between the Cloud Foundry and Spring teams. One evidence of this is a recent tweet from Pivotal's James Watters "As the Microservices trends take off its pretty amazing to have the world's leading lightwieght #springframework on same team as CF."

Related

How do people host Spring Boot apps with WebFlux on Reactor Netty in production?

I know it's a vague question but that's because I am not clear enough on what people are doing to ask anything more specific. I currently run my own apps with the embedded reactor netty server for development and basically push the embedded server inside a jar to cloud foundry to run the embedded server in production.
What are the other ways out there to set up a production environment for reactive reactor netty apps that people are using, or any documentation you might have seen?
I'm no sure that there is any difference between hosting the reactive spring-webflux application and regular applications.
Spring boot creates a jar with everything bundled inside (netty or more old-school tomcat) - it doesn't matter.
Then you can take this and run it "as is" on your server (on-premise, cloud ec2 style whatever you have, this really depends on your organization) directly with java -jar app.jar
Or, if you have more advanced needs/setup:
"Containerize" the application and create a docker (usually, although there are alternatives) image that runs the spring boot application. and then deploy it on kubernetes cluster, for example. At this point you should really consult with your DevOps people so that they'll tell you what is the way of deployment in your organization.
Besides kubernetes cluster there are many other alternatives:
- cloud provider specific solutions, like ECS or Fargate in amazon AWS
- Docker Swarm to name a few
All these solutions are pretty advanced, allow auto-scaling, advanced liveness monitoring and so forth. As an organization you usually pick the one that meets your needs

Cloud Foundry and Composite UI

We are developing our application which probably is going to consist of about 20 Microservices. We are considering to use Pivotal Cloud Foundry to manage our Microservices and make it easier to have a platform for deployment and health check - amoung others.
About 12 Microservice will render HTML and now we want to know how we can compose all these services to one UI and present it to the client. Does Cloud Foundry a plugin or somehow solves the UI issues for Microservices? Does PCF generates Composite UI?
Does Cloud Foundry a plugin or somehow solves the UI issues for Microservices? Does PCF generates Composite UI?
No, the platform does not do this for you. It only handles routing requests to your apps.
About 12 Microservice will render HTML and now we want to know how we can compose all these services to one UI and present it to the client.
You might look into using a proxy app in front of your microservices. The proxy would just be responsible for presenting a unified front for your clients and combining all the backend services together.
Netflix Zuul/Spring Cloud Zuul or Spring Cloud Gateway might help with this, if you're using Java. I've also see people use Nginx as a reverse proxy to do similar things.
At the end of the day, you're going to need to figure out what works for your particular microservices & clients side apps though. I don't think anyone can give you a definitive answer to your question, at least not without a lot more information.

If I have Kubernetes(or mesos) already, why do I need use Spring Cloud?

I'm a newbie on Spring Cloud, and I'm a little confused about it. Kubernetes and Spring Cloud are both micro-services framework. If I have Kubernetes(or mesos) already, why do I need use Spring Cloud? I notice that many projects use them both.
What's the difference between Kubernetes and Spring Cloud? They both can provide service discovery, load balance and so on.
I'm really confused.
Kubernetes and Spring Cloud address a lot of the same concerns with Microservices, but with different approaches and technologies. Redhat wrote a great article explaining this. Here the main takeaways:
Spring Cloud has a rich set of well integrated Java libraries to
address all runtime concerns as part of the application stack. As a
result, the Microservices themselves have libraries and runtime agents
to do client side service discovery, load balancing, configuration
update, metrics tracking, etc. Patterns such as singleton clustered
services, batch jobs are managed in the JVM too.
Kubernetes is
polyglot, doesn’t target only the Java platform, and addresses the
distributed computing challenges in a generic for all languages way.
It provides services for configuration management, service discovery,
load balancing, tracing, metrics, singletons, scheduled jobs on the
platform level, outside of the application stack. The application
doesn’t need any library or agents for client side logic and it can be
written in any language.
In some areas both platforms rely on similar
third party tools. For example the ELK and EFK stacks, tracing
libraries, etc.
Some libraries such as Hystrix, Spring Boot are useful
equally well on both environments. There are areas where both
platforms are complementary and can be combined together to create a
more powerful solution (KubeFlix and Spring Cloud Kubernetes are such
examples).
Source: https://developers.redhat.com/blog/2016/12/09/spring-cloud-for-microservices-compared-to-kubernetes/
To understand the differences and similarities in more detail I would recommend to the read the full article.

How Spring Cloud relates to Docker Swarm

I'm confused with cloud/clustering technologies like Docker Swarm and Spring Cloud and how they relates to each other.
Is it correct way to thing, they implement same functionality at different layers? For example docker swarm performs load balancing and service discovery at container or network layer (application is agnostic of this layer), where as framework like Spring Cloud embeds this logic to application, giving more flexibility, but also violating separation of concerns.
Am I mistaken, or is this correct? What is the SWOT of each approach, and is there any reason to use both Docker tooling and Spring Cloud utilities together?
First off, Spring and Docker are two different technologies coming from different points of view. From what I can gather, Spring Cloud is a mechanism for deploying java containers and orchestrating them.
Docker is an application / OS agnostic deployment mechanism.
I don't know much about Spring Cloud, but if you're in an environment that is not all Java, it may make more sense to approach Docker. It would allow you to deploy micro services on just about any platform.
We went through this at the last company I worked for, as they were implementing Springboot, but also looking at Docker at the same time. In the end it just made sense to deploy everything in Docker since it provided a uniform deployment and service management mechanism. That as opposed to hobbling together various deployment and management tools by language.

Example open source microservices applications

I'm looking for open source applications that demonstrate the microservices pattern. In particular, I'd like to find one or more applications that can be spun up on real cloud environment up (but with fake data and requests) to demonstrate real-world deployment mechanics.
Unfortunately, I haven't found any good options yet. I'll note that Discourse is a modern 3-tier application, using Rails API, Ember.js, Postgres, and Redis, but it still is much closer to a monolith than an example of microservices. The closest I've found so far is https://github.com/kbastani/spring-cloud-microservice-example but that is more of a framework than an actual application that delivers data.
Not your typical CRUD app but Deis (a PaaS) uses REST APIs mostly to communicate between services. Peatio has a bunch of services that communicate asynchronously through a message queue.
Microsoft provides a demo webshop application based on .NET Core showing how to apply the microservices pattern:
https://github.com/dotnet-architecture/eShopOnContainers
There is also an ebook available: https://aka.ms/microservicesebook
this lagom application example is a microservices application written in Lagom . It is a akka based framework (DDD for design).
Application is complete and working. See if that serve your purpose.

Resources