Cassandra on Pivotal CF 
Pivotal #CassandraSummit
Tammer Saleh 
Director of Product 
Pivotal CF Services, London 
! 
http://tammersaleh.com 
Pivotal #CassandraSummit
Overview of Pivotal CF! 
Services API! 
Why Cassandra! 
Building Cassandra! 
Automating Cassandra Operations 
Pivotal #CassandraSummit
Overview of Pivotal CF 
Pivotal #CassandraSummit
$ cf push is golden. 
$ cf create-service p-cassandra development-plan eventsdb 
$ cf bind-service eventsdb dashboard 
$ cf push dashboard 
$ open https://dashboard.mypcf.com 
Pivotal #CassandraSummit
Pivotal #CassandraSummit
Service Foo 
Broker DB 
Service Bar 
Broker DB 
Service Baz 
Broker DB 
Router 
Cloud Controller 
DEA 
DEA DEA 
Health Manager 
SSO 
provisioning / configuration / orchestration 
Runtime 
DEA 
vSphere 
BOSH 
Console 
Operations 
Manager 
AWS OpenStack 
Pivotal #CassandraSummit
Services API 
Pivotal #CassandraSummit
BOSH 
Router 
vSphere / AWS / OpenStack 
Operations 
Manager 
CF Runtime 
Application Instances 
Cloud 
Controller
BOSH 
Router 
vSphere / AWS / OpenStack 
Operations 
Manager 
CF Runtime 
Cloud 
Controller 
Service 
Service Instances 
Service 
Broker 
Application Instances
BOSH 
Router 
vSphere / AWS / OpenStack 
Operations 
Manager 
CF Runtime 
Cloud 
Controller 
Service 
Service Instances 
Service 
Broker 
Application Instances 
Catalog 
$ cf marketplace
BOSH 
Router 
vSphere / AWS / OpenStack 
Operations 
Manager 
CF Runtime 
Cloud 
Controller 
Service 
Service Instances 
Service 
Broker 
Application Instances 
Provision instance 
Done 
$ cf create service foo
CF Runtime 
Router 
Application Instances 
Cloud 
Controller 
Service 
Service Instances 
Service 
Broker 
Provision binding 
Binding info 
$ cf bind service my_app foo 
$VCAP_SERVICES={ 
"pgsql": [ 
{ 
"name": "UUID", 
"plan": "small", 
"credentials": { 
"uri": “postgres://u:p@service_ip” 
} 
} 
], … } 
Binding info
CF Runtime 
Router 
Application Instances 
Cloud 
Controller 
Service 
Service Instances 
Service 
Broker 
$ cf bind service my_app foo 
App instance reads 
and writes directly to 
service instance.
GET /v2/catalog What’s available? 
PUT /v2/service_instances/:id Create service 
DELETE /v2/service_instances/:id Delete service 
PUT /v2/service_instances/:id/service_bindings/:id Create binding 
DELETE /v2/service_instances/:id/service_bindings/:id Delete binding
Pivotal CF Services
Insanely fast KV storage - The AK-47 of Databases
The World's Leading Graph DB
Distributed, real-time search and analytics engine
Simple and Fast NoSQL DB
High-performance memory object cache.
Next generation MySQL replacement.
Enterprise Hadoop Distribution.
S3 Compatible Blobstore
Highly distributed, write-heavy KV/column store.
Our first production-grade service.
Why ? 
"In terms of scalability, there is a clear 
winner throughout our experiments. 
Cassandra achieves the highest 
throughput for the maximum number of 
nodes in all experiments." 
- University of Toronto, 2012
Why ?
Why ? 
Cassandra is truly cloud-scale.
Why ? 
Multi-datacenter 
deployments are 
commonplace in 
the cloud.
Building Cassandra 
Pivotal #CassandraSummit
Services API Redux 
Service Plan Instance Binding 
Pivotal #CassandraSummit
What is an Instance? 
Pivotal #CassandraSummit
What is an Instance? 
Scales to the size 
of a single cluster.! 
Single Keyspace.! 
Good for 
development and 
testing. 
Part of a Shared Cluster 
Instance 1 (Keyspace) 
Instance 2 (Keyspace) 
Instance 3 (Keyspace) 
Cassandra Node Cassandra Node Cassandra Node 
VM VM VM 
Pivotal #CassandraSummit
Keyspace visibility 
Pivotal #CassandraSummit
Noisy Neighbours 
Pivotal #CassandraSummit
Quotas 
Pivotal #CassandraSummit
What is an Instance? 
True production 
grade.! 
No noisy 
neighbours.! 
Expensive. 
Cluster of VMs 
Cassandra VM Cassandra VM Cassandra VM 
Instance 1 (Cluster of VMs) 
Cassandra VM Cassandra VM Cassandra VM 
Instance 2 (Cluster of VMs) 
Cassandra VM Cassandra VM Cassandra VM 
Instance 3 (Cluster of VMs) 
Pivotal #CassandraSummit
What is an Instance? 
Looks identical to 
production.! 
Fairly good noisy 
neighbour 
isolation.! 
Constrained 
resources per 
instance. 
Cluster of Containers 
Cassandra 
Node 
Instance 1 (Cluster) 
Cassandra 
Node 
Cassandra 
Node 
Instance 2 (Cluster) 
Cassandra 
Node 
Instance 3 (Cluster) 
Cassandra 
Node 
Cassandra 
Node 
Cassandra 
Node 
Cassandra 
Node 
Cassandra 
Node 
VM VM VM 
Pivotal #CassandraSummit
Automating Cassandra Operations 
Pivotal #CassandraSummit
BOSH 
Pivotal #CassandraSummit
BOSH is… 
• Predictable! 
• Repeatable! 
• IaaS agnostic! 
• Built for large-scale deployments 
Pivotal #CassandraSummit
BOSH 
Resurrector 
Pivotal #CassandraSummit
BOSH 
Resurrector 
BOSH 
Director 
VM 
Agent 
VM 
Agent 
VM 
Agent 
hello! 
hey ! 
there! 
ahoy! 
Pivotal #CassandraSummit
BOSH 
Resurrector 
BOSH 
Director 
VM 
Agent 
VM 
Agent 
VM 
Agent 
Pivotal #CassandraSummit
BOSH 
Resurrector 
BOSH 
Director 
VM 
Agent 
VM 
Agent 
VM 
Agent 
IaaS 
STONITH! 
Pivotal #CassandraSummit
BOSH 
Resurrector 
BOSH 
Director 
VM 
Agent 
VM 
Agent 
VM 
Agent 
IaaS 
Pivotal #CassandraSummit
BOSH 
Resurrector 
BOSH 
Director 
VM 
Agent 
VM 
Agent 
IaaS 
Pivotal #CassandraSummit
BOSH 
Resurrector 
BOSH 
Director 
VM 
Agent 
VM 
Agent 
IaaS 
Provision! 
Pivotal #CassandraSummit
BOSH 
Resurrector 
BOSH 
Director 
VM 
Agent 
VM 
Agent 
IaaS 
VM 
Agent 
howdy! 
Pivotal #CassandraSummit
NTPd 
Pivotal #CassandraSummit
NTPd! 
Accuracy vs Precision 
Pivotal #CassandraSummit
Cassandra 
Node 
Cassandra 
Cassandra 
NTPd! 
! 
Node 
Node 
https://blog.logentries.com/2014/03/synchronizing-clocks-in-a-cassandra-cluster-pt-2-solutions/ 
Pivotal #CassandraSummit
Cassandra 
Node 
Cassandra 
Node 
NTPd! 
! 
Cassandra 
Node 
NTPd! 
Server 
https://blog.logentries.com/2014/03/synchronizing-clocks-in-a-cassandra-cluster-pt-2-solutions/ 
Pivotal #CassandraSummit
Cassandra 
NTPd! 
Server 
NTPd! 
! 
Cassandra 
Node 
Node 
Cassandra 
Node 
Internet 
NTPd! 
Server 
NTPd! 
Server 
NTPd! 
Server 
https://blog.logentries.com/2014/03/synchronizing-clocks-in-a-cassandra-cluster-pt-2-solutions/ 
Pivotal #CassandraSummit
Running repairs 
Pivotal #CassandraSummit
Running repairs 
1. When decommissioning the Node. 
2. When the node has been down for N minutes. 
3. Once per node per week within GC_GRACE_PERIOD 
Pivotal #CassandraSummit
Services Are the Key 
to the Success of 
Pivotal CF 
Pivotal #CassandraSummit
Thank you. 
If this interests you, we’re hiring CF engineers in SF and London. 
Tammer Saleh 
tsaleh@pivotal.io 
http://tammersaleh.com 
Pivotal #CassandraSummit

Cassandra Summit 2014: Apache Cassandra on Pivotal CloudFoundry

  • 1.
    Cassandra on PivotalCF Pivotal #CassandraSummit
  • 2.
    Tammer Saleh Directorof Product Pivotal CF Services, London ! http://tammersaleh.com Pivotal #CassandraSummit
  • 3.
    Overview of PivotalCF! Services API! Why Cassandra! Building Cassandra! Automating Cassandra Operations Pivotal #CassandraSummit
  • 4.
    Overview of PivotalCF Pivotal #CassandraSummit
  • 5.
    $ cf pushis golden. $ cf create-service p-cassandra development-plan eventsdb $ cf bind-service eventsdb dashboard $ cf push dashboard $ open https://dashboard.mypcf.com Pivotal #CassandraSummit
  • 6.
  • 7.
    Service Foo BrokerDB Service Bar Broker DB Service Baz Broker DB Router Cloud Controller DEA DEA DEA Health Manager SSO provisioning / configuration / orchestration Runtime DEA vSphere BOSH Console Operations Manager AWS OpenStack Pivotal #CassandraSummit
  • 8.
    Services API Pivotal#CassandraSummit
  • 9.
    BOSH Router vSphere/ AWS / OpenStack Operations Manager CF Runtime Application Instances Cloud Controller
  • 10.
    BOSH Router vSphere/ AWS / OpenStack Operations Manager CF Runtime Cloud Controller Service Service Instances Service Broker Application Instances
  • 11.
    BOSH Router vSphere/ AWS / OpenStack Operations Manager CF Runtime Cloud Controller Service Service Instances Service Broker Application Instances Catalog $ cf marketplace
  • 12.
    BOSH Router vSphere/ AWS / OpenStack Operations Manager CF Runtime Cloud Controller Service Service Instances Service Broker Application Instances Provision instance Done $ cf create service foo
  • 13.
    CF Runtime Router Application Instances Cloud Controller Service Service Instances Service Broker Provision binding Binding info $ cf bind service my_app foo $VCAP_SERVICES={ "pgsql": [ { "name": "UUID", "plan": "small", "credentials": { "uri": “postgres://u:p@service_ip” } } ], … } Binding info
  • 14.
    CF Runtime Router Application Instances Cloud Controller Service Service Instances Service Broker $ cf bind service my_app foo App instance reads and writes directly to service instance.
  • 15.
    GET /v2/catalog What’savailable? PUT /v2/service_instances/:id Create service DELETE /v2/service_instances/:id Delete service PUT /v2/service_instances/:id/service_bindings/:id Create binding DELETE /v2/service_instances/:id/service_bindings/:id Delete binding
  • 16.
  • 17.
    Insanely fast KVstorage - The AK-47 of Databases
  • 18.
  • 19.
    Distributed, real-time searchand analytics engine
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 27.
  • 28.
    Why ? "Interms of scalability, there is a clear winner throughout our experiments. Cassandra achieves the highest throughput for the maximum number of nodes in all experiments." - University of Toronto, 2012
  • 29.
  • 30.
    Why ? Cassandrais truly cloud-scale.
  • 31.
    Why ? Multi-datacenter deployments are commonplace in the cloud.
  • 32.
  • 33.
    Services API Redux Service Plan Instance Binding Pivotal #CassandraSummit
  • 34.
    What is anInstance? Pivotal #CassandraSummit
  • 35.
    What is anInstance? Scales to the size of a single cluster.! Single Keyspace.! Good for development and testing. Part of a Shared Cluster Instance 1 (Keyspace) Instance 2 (Keyspace) Instance 3 (Keyspace) Cassandra Node Cassandra Node Cassandra Node VM VM VM Pivotal #CassandraSummit
  • 36.
  • 37.
    Noisy Neighbours Pivotal#CassandraSummit
  • 38.
  • 39.
    What is anInstance? True production grade.! No noisy neighbours.! Expensive. Cluster of VMs Cassandra VM Cassandra VM Cassandra VM Instance 1 (Cluster of VMs) Cassandra VM Cassandra VM Cassandra VM Instance 2 (Cluster of VMs) Cassandra VM Cassandra VM Cassandra VM Instance 3 (Cluster of VMs) Pivotal #CassandraSummit
  • 40.
    What is anInstance? Looks identical to production.! Fairly good noisy neighbour isolation.! Constrained resources per instance. Cluster of Containers Cassandra Node Instance 1 (Cluster) Cassandra Node Cassandra Node Instance 2 (Cluster) Cassandra Node Instance 3 (Cluster) Cassandra Node Cassandra Node Cassandra Node Cassandra Node Cassandra Node VM VM VM Pivotal #CassandraSummit
  • 41.
    Automating Cassandra Operations Pivotal #CassandraSummit
  • 42.
  • 43.
    BOSH is… •Predictable! • Repeatable! • IaaS agnostic! • Built for large-scale deployments Pivotal #CassandraSummit
  • 44.
    BOSH Resurrector Pivotal#CassandraSummit
  • 45.
    BOSH Resurrector BOSH Director VM Agent VM Agent VM Agent hello! hey ! there! ahoy! Pivotal #CassandraSummit
  • 46.
    BOSH Resurrector BOSH Director VM Agent VM Agent VM Agent Pivotal #CassandraSummit
  • 47.
    BOSH Resurrector BOSH Director VM Agent VM Agent VM Agent IaaS STONITH! Pivotal #CassandraSummit
  • 48.
    BOSH Resurrector BOSH Director VM Agent VM Agent VM Agent IaaS Pivotal #CassandraSummit
  • 49.
    BOSH Resurrector BOSH Director VM Agent VM Agent IaaS Pivotal #CassandraSummit
  • 50.
    BOSH Resurrector BOSH Director VM Agent VM Agent IaaS Provision! Pivotal #CassandraSummit
  • 51.
    BOSH Resurrector BOSH Director VM Agent VM Agent IaaS VM Agent howdy! Pivotal #CassandraSummit
  • 52.
  • 53.
    NTPd! Accuracy vsPrecision Pivotal #CassandraSummit
  • 54.
    Cassandra Node Cassandra Cassandra NTPd! ! Node Node https://blog.logentries.com/2014/03/synchronizing-clocks-in-a-cassandra-cluster-pt-2-solutions/ Pivotal #CassandraSummit
  • 55.
    Cassandra Node Cassandra Node NTPd! ! Cassandra Node NTPd! Server https://blog.logentries.com/2014/03/synchronizing-clocks-in-a-cassandra-cluster-pt-2-solutions/ Pivotal #CassandraSummit
  • 56.
    Cassandra NTPd! Server NTPd! ! Cassandra Node Node Cassandra Node Internet NTPd! Server NTPd! Server NTPd! Server https://blog.logentries.com/2014/03/synchronizing-clocks-in-a-cassandra-cluster-pt-2-solutions/ Pivotal #CassandraSummit
  • 57.
    Running repairs Pivotal#CassandraSummit
  • 58.
    Running repairs 1.When decommissioning the Node. 2. When the node has been down for N minutes. 3. Once per node per week within GC_GRACE_PERIOD Pivotal #CassandraSummit
  • 59.
    Services Are theKey to the Success of Pivotal CF Pivotal #CassandraSummit
  • 60.
    Thank you. Ifthis interests you, we’re hiring CF engineers in SF and London. Tammer Saleh tsaleh@pivotal.io http://tammersaleh.com Pivotal #CassandraSummit