Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Unless otherwise indicated, these slides are © 2016 Pivotal Software, Inc. and licensed under a

Creative Commons Attribut...
Speaker Intro - Kenny Bastani
2
What are we talking about today?
! Spring Data Redis
! Spring Boot
! We’re going to build a Spring Boot web service with M...
But first…
A database joke
4
Why did the database have problems
ingesting data?
5
Because it had ACID indigestion
6
Why did the database have problems
ingesting data?
Ok let’s get serious
Let’s talk about architecture
7
Microservices & Polyglot Persistence
If you’re into that kind of thing
8
Polyglot Persistence
9
Spring Data Redis
10
What is Spring Data Redis?
! Easy access to Redis from your Spring applications
! Provides a variety of abstractions for y...
How does Spring Data work?
Abstractions…
12
Cloud Native Application with Redis Caching
13
Spring Boot
A JVM micro-framework for building microservices
14
What is Spring Boot?
15
Spring Initializr
16
supports rapid
development of
production-ready
applications and services
Bootstrap your application
17
Add Redis Caching
Configure Redis connection and Spring Data cache manager
18
Redis Cache Config
19
Configure Redis Connection
20
Configure Redis Template
21
Configure Redis Cache Manager
22
Annotation-driven Caching
23
Manage Users REST API Contract
24
Create a UserService
25
@Cacheable - Get or put
26
@CachePut - Update
27
@CacheEvict - Invalidate record
28
Deploy to the cloud!
Using Cloud Foundry
29
Cloud Foundry
! Open-source platform as a service (PaaS)
! Supports multiple cloud providers
! Supports build packs for mu...
Application Server vs Linux Container deployments
31
Application Server Deployment
! Load balancing requires
provisioning of new VMs and app
server installations
! Poor resour...
Linux Container Deployment
! Development team drives the
application runtime of a container
! Containers are resource isol...
Microservices - Container Deployment
! Each microservice can be containerized with their application dependencies
! Contai...
Auto-scaling
! Minutes to start a VM, but seconds to start a container
! An elastic runtime handles auto-scaling of VMs wi...
Demo CF deployment
run.pivotal.io
36
37
38
Learn More. Stay Connected.
! Twitter: @kennybastani
! Spring: spring.io/team/kbastani
! Blog: kennybastani.com
! GitHu...
Upcoming SlideShare
Loading in …5
×

Back your app with MySQL and Redis on Cloud Foundry

1,599 views

Published on

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

Published in: Software
  • Be the first to comment

  • Be the first to like this

Back your app with MySQL and Redis on Cloud Foundry

  1. 1. Unless otherwise indicated, these slides are © 2016 Pivotal Software, Inc. and licensed under a Creative 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
  2. 2. Speaker Intro - Kenny Bastani 2
  3. 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
  4. 4. But first… A database joke 4
  5. 5. Why did the database have problems ingesting data? 5
  6. 6. Because it had ACID indigestion 6 Why did the database have problems ingesting data?
  7. 7. Ok let’s get serious Let’s talk about architecture 7
  8. 8. Microservices & Polyglot Persistence If you’re into that kind of thing 8
  9. 9. Polyglot Persistence 9
  10. 10. Spring Data Redis 10
  11. 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 +
  12. 12. How does Spring Data work? Abstractions… 12
  13. 13. Cloud Native Application with Redis Caching 13
  14. 14. Spring Boot A JVM micro-framework for building microservices 14
  15. 15. What is Spring Boot? 15
  16. 16. Spring Initializr 16 supports rapid development of production-ready applications and services Bootstrap your application
  17. 17. 17
  18. 18. Add Redis Caching Configure Redis connection and Spring Data cache manager 18
  19. 19. Redis Cache Config 19
  20. 20. Configure Redis Connection 20
  21. 21. Configure Redis Template 21
  22. 22. Configure Redis Cache Manager 22
  23. 23. Annotation-driven Caching 23
  24. 24. Manage Users REST API Contract 24
  25. 25. Create a UserService 25
  26. 26. @Cacheable - Get or put 26
  27. 27. @CachePut - Update 27
  28. 28. @CacheEvict - Invalidate record 28
  29. 29. Deploy to the cloud! Using Cloud Foundry 29
  30. 30. 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
  31. 31. Application Server vs Linux Container deployments 31
  32. 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. 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. 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. 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
  36. 36. Demo CF deployment run.pivotal.io 36
  37. 37. 37
  38. 38. 38 Learn More. Stay Connected. ! Twitter: @kennybastani ! Spring: spring.io/team/kbastani ! Blog: kennybastani.com ! GitHub: github.com/kbastani Twitter: twitter.com/springcentral YouTube: spring.io/video LinkedIn: spring.io/linkedin Google Plus: spring.io/gplus

×