Unless otherwise indicated, these slides are © 2016 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Back your App with MySQL & Redis, the Cloud Foundry Way
Kenny Bastani, Spring Developer Advocate, Pivotal @kennybastani
What are we talking about today?
! Spring Data Redis
! Spring Boot
! We’re going to build a Spring Boot web service with MySQL storage
! Add in Redis caching with Spring Data Redis
! Deploy to the cloud! (Cloud Foundry)
! Stream metrics and compare caching vs. no caching
3
What is Spring Data Redis?
! Easy access to Redis from your Spring applications
! Provides a variety of abstractions for you to interact with Redis
• Spring Data Repositories (NEW!)
• RedisTemplate
• CacheManager
! Available as a Spring Boot starter project from http://start.spring.io
! Provides a CacheManager implementation so you can use annotation-driven caching on methods
11
+
Spring Initializr
16
supports rapid development of production-ready applications and services
Bootstrap your application
Cloud Foundry
! Open-source platform as a service (PaaS)
! Supports multiple cloud providers
! Supports build packs for multiple application frameworks
! Supports Linux container deployments using Diego
! Supports Docker container registries
30
Application Server Deployment
! Load balancing requires provisioning of new VMs and app server installations
! Poor resource isolation; memory leaks can cause other applications to become unavailable
! Runtime environment is driven by the operator
32
Virtual Machine
App
Linux Kernel
App App
Hardware Infrastructure
Linux Container Deployment
! Development team drives the application runtime of a container
! Containers are resource isolated, allowing efficient scheduling onto a grid of VMs
! Containers take seconds to start, VMs take minutes
! It’s not a rule that there is one microservice per container
33
Virtual Machine
Container
Linux Kernel
App App
App App
ContainerApp App
App App
ContainerApp App
App App
Hardware Infrastructure
Microservices - Container Deployment
! Each microservice can be containerized with their application dependencies
! Containers get scheduled on virtual machines with an allotted resource policy
34
Auto-scaling
! Minutes to start a VM, but seconds to start a container
! An elastic runtime handles auto-scaling of VMs with cloud providers
35