In this session, we will build a minimum viable Spring Data web service with REST API, add a MySQL backing service as the primary data store, and a Redis Labs backing service for caching. We will demonstrate performance metrics without Redis caching enabled and then with Redis caching enabled. I will also provide an intro-level explanation of the platform capabilities within Pivotal Web Services.
3. 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
11. 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
+
32. 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
33. 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
Container
App App
App App
Container
App App
App App
Hardware Infrastructure
34. Microservices - Container Deployment
! Each microservice can be containerized with their application dependencies
! Containers get scheduled on virtual machines with an allotted resource
policy
34
35. 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