This content is copyright of CloudCredo. © CloudCredo 2015. All rights reserved.
As a CF hero
I want a new version of my app to show the same data
So that I can iterate on feedback from my users
In a service deployed alongside Cloud Foundry
Registered with CF through a Service Broker
A service for provisioning resources of a specific type
An API advertising a catalog of service offerings and plans
$ cf marketplace
service          plans               description
____________________________________________________________________
cleardb          spark, boost*, ...  Highly available MySQL for y...
cloudamqp        lemur, tiger*, ...  Managed HA RabbitMQ servers ...
elephantsql      turtle, panda*, ..  PostgreSQL as a Service     ...
ironworker       large*,        ...  Scalable Background and Asyn...
loadimpact       lifree, li100*, ..  Automated and on-demand perf...
memcachedcloud   100mb*, 250mb*, ..  Enterprise-Class Memcached f...
mongolab         sandbox        ...  Fully-managed MongoDB-as-a-S...
newrelic         standard       ...  Manage and monitor your apps...
rediscloud       100mb*, 250mb*, ..  Enterprise-Class Redis for D...
searchly         small*, micro*, ..  Search Made Simple. Powered-...
sendgrid         free, bronze*,  ..  Email Delivery. Simplified.
....................................................................
$ cf create-service rediscloud 30mb redis
$ cf services
name    service      plan   bound apps   last operation
redis   rediscloud   30mb                create succeeded
# From the training home directory:
$ cd 07-shared-state/stateful-app
$ cf push --no-start
$ cf bind-service stateful-app redis
App stateful-app is already bound to redis.
# Services can be defined in the app manifest
$ cf start stateful-app

$ cf scale stateful-app -i 2

$ cf env stateful-app
...
 "VCAP_SERVICES": {
  "rediscloud": [
   {
    "credentials": {
     "hostname": "pub-redis-15708.us-east-1-4.6.ec2.redislabs.com",
     "password": "PASSWORD",
     "port": "15708"
    },
...
$ redis-cli -h pub-redis-15708...redislabs.com -p 15708 -a PASSWORD
pub-redis-15708.us-east-1-4.6.ec2.redislabs.com:15708> keys *
1) "9f397b68...total_instance_10.10.81.59:61500_responses"
2) "9f397b68...total_instance_10.10.17.49:61509_responses"
3) "9f397b68...total_app_responses"
pub-redis-15708.us-east-1-4.6.ec2.redislabs.com:15708> exit
$ cf set-env stateful-app SHOW_APP_SUPPORTERS true
$ cf restart stateful-app

What actually happened: the CEO clicked some links.
$ cf delete -f -r stateful-app
We restore the app, much to our users’ delight.
# From the training home directory:
$ cd 07-shared-state/stateful-app
$ cf push --no-start
$ cf set-env stateful-app SHOW_APP_SUPPORTERS true
$ cf start stateful-app

As a CF hero
I want a new version of my app to show the same data
So that I can iterate on feedback from my users
Questions cannot be stupid. Answers can.
This content is copyright of CloudCredo. © CloudCredo 2015. All rights reserved.