SlideShare a Scribd company logo
@chbatey
Christopher Batey

Technical Evangelist for Apache Cassandra
LA 2015: Cassandra for Java developers
@chbatey
Who am I?
• Based in London
• Technical Evangelist for Apache Cassandra
•Work on Stubbed Cassandra
•Help out Apache Cassandra users
• Previous: Cassandra backed apps at BSkyB
@chbatey
Overview
• Why distributed databases?
• Cassandra fundamentals
• Java driver
• Example: Customer events
@chbatey
Why Cassandra?
@chbatey
Building a web app
@chbatey
Running multiple copies of your app
@chbatey
Still in one DC?
@chbatey
Handling hardware failure
@chbatey
Handling hardware failure
@chbatey
Cassandra fundamentals
@chbatey
Cassandra
Cassandra
• Distributed masterless
database (Dynamo)
• Column family data model
(Google BigTable)
@chbatey
Datacenter and rack aware
Europe
• Distributed master less
database (Dynamo)
• Column family data model
(Google BigTable)
• Multi data centre replication
built in from the start
USA
@chbatey
Replication
DC1 DC2
client
RF3 RF3
C
RC
WRITE
CL = 1 We have replication!
client
@chbatey
Tunable Consistency
•Data is replicated N times
•Every query that you execute you give a consistency
-ALL
-QUORUM
-LOCAL_QUORUM
-ONE
• Christos Kalantzis Eventual Consistency != Hopeful Consistency: http://
youtu.be/A6qzx_HE3EU?list=PLqcm6qE9lgKJzVvwHprow9h7KMpb5hcUU
@chbatey
Async Replication
@chbatey
Async Replication
@chbatey
Async Replication
@chbatey
Java Driver
@chbatey
DataStax Java Driver
• Open source
@chbatey
Java driver 101
• Cluster - singleton per app
• Session - singleton per keyspace
Cluster cluster = Cluster.builder()

.addContactPoint(“host1”, “host2”)

.build();
Session session = cluster.connect("customer_events");
@chbatey
Load balancing
•Data centre aware policy
•Token aware policy
•Latency aware policy
•Whitelist policy
APP APP
Async
Replication
DC1 DC2
@chbatey
Multi Data Center Load Balancing
• Local nodes are queried first, if none are available the
request will be sent to a remote data center
Cluster cluster = Cluster.builder()
.addContactPoints("10.158.02.40", "10.158.02.44")
.withLoadBalancingPolicy(
new DCAwareRoundRobinPolicy("DC1"))
.build();
Name of the local DC
@chbatey
Token Aware Load Balancing
• Nodes that own a replica of the data being read or
written by the query will be contacted first
Cluster cluster = Cluster.builder()
.addContactPoints("10.158.02.40", "10.158.02.44")
.withLoadBalancingPolicy(
new TokenAwarePolicy(
new DCAwareRoundRobinPolicy("DC1")))
.build();
@chbatey
Retry Policies
• The behaviour to adopt when a request returns a
timeout or is unavailable.
Cluster cluster = Cluster.builder()
.addContactPoints("10.158.02.40", "10.158.02.44")
.withRetryPolicy(FallthroughRetryPolicy.INSTANCE)
.withLoadBalancingPolicy(new TokenAwarePolicy(new DCAwareRoundRobinPolicy("DC1")))
.build();
• DefaultRetryPolicy
• DowngradingConsistencyRetryPolicy
• FallthroughRetryPolicy
• LoggingRetryPolicy
@chbatey
Reconnection Policies
• Policy that decides how often the reconnection to a
dead node is attempted.
Cluster cluster = Cluster.builder()
.addContactPoints("10.158.02.40", "10.158.02.44”)
.withRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE)
.withReconnectionPolicy(new ConstantReconnectionPolicy(1000))
.withLoadBalancingPolicy(new TokenAwarePolicy(new DCAwareRoundRobinPolicy("DC1")))
.build();

• ConstantReconnectionPolicy
• ExponentialReconnectionPolicy (Default)
@chbatey
Session interface


ResultSet result = session.execute("select * from customer_events");

ResultSetFuture resultSetFuture = session.executeAsync("select * from customer_events”);

// prepare
PreparedStatement preparedStatement = session.prepare("select * from where customer_id = ?”);
// execute
BoundStatement boundStatement = preparedStatement.bind(“chbatey");
ResultSet execute = session.execute(boundStatement);
Guava listenable future!
Statement simpleStatement = new SimpleStatement("select * from customer_events");

simpleStatement.setConsistencyLevel(ConsistencyLevel.QUORUM);

ResultSetFuture resultSetFuture = session.executeAsync(simpleStatement);
@chbatey
RxJava?
public Observable<CustomerEvent> getCustomerEventsObservable(String customerId) {

BoundStatement boundStatement = getEventsForCustomer.bind(customerId);

ListenableFuture<ResultSet> resultSetFuture = session.executeAsync(boundStatement);

// map to an obserable
Observable<ResultSet> observable = Observable.from(resultSetFuture, Schedulers.io());
// ResultSet is an Iterator<Row> 

Observable<Row> rowObservable = observable.flatMapIterable(eachRow -> eachRow);

return rowObservable.map(row -> new CustomerEvent(

row.getString("customer_id"),

row.getUUID("time"),

row.getString("staff_id"),

row.getString("store_type"),

row.getString("event_type"),

row.getMap("tags", String.class, String.class)));
http://christopher-batey.blogspot.com/2014/12/streaming-large-payloads-over-http-from.html
http://www.datastax.com/dev/blog/java-driver-async-queries
@chbatey
Example Time: Customer event store
@chbatey
An example: Customer event store
• Customer event
- customer_id e.g ChrisBatey
- event_type e.g login, logout, add_to_basket,
remove_from_basket, buy_item
• Staff
- name e.g Charlie
- favourite_colour e.g red
• Store
- name
- type e.g Website, PhoneApp, Phone, Retail
@chbatey
Requirements
• Get all events for a particular customer
• As above for a time slice
• Future requirement: Get all events by staff
member?
@chbatey
Modelling in a relational database
CREATE TABLE customer_events(
customer_id text,
staff_name text,
time timeuuid,
event_type text,
store_name text,
PRIMARY KEY (customer_id));
CREATE TABLE store(
name text,
location text,
store_type text,
PRIMARY KEY (name));
CREATE TABLE staff(
name text,
favourite_colour text,
job_title text,
PRIMARY KEY (name));
@chbatey
Reading this
client
RF3
C
Read latest customer event
CL = QUORUM
Read store or staff information
C
@chbatey
You must denormalise
@chbatey
Your model should look like your queries
Modelling in Cassandra
CREATE TABLE customer_events(
customer_id text,
staff_id text,
time timeuuid,
store_type text,
event_type text,
tags map<text, text>,
PRIMARY KEY ((customer_id), time));
Partition Key
Clustering Column(s)
How it is stored on disk
customer
_id
time event_type store_type tags
charles 2014-11-18 16:52:04 basket_add online {'item': 'coffee'}
charles 2014-11-18 16:53:00 basket_add online {'item': ‘wine'}
charles 2014-11-18 16:53:09 logout online {}
chbatey 2014-11-18 16:52:21 login online {}
chbatey 2014-11-18 16:53:21 basket_add online {'item': 'coffee'}
chbatey 2014-11-18 16:54:00 basket_add online {'item': 'cheese'}
charles
event_type
basket_add
staff_id
n/a
store_type
online
tags:item
coffee
event_type
basket_add
staff_id
n/a
store_type
online
tags:item
wine
event_type
logout
staff_id
n/a
store_type
online
chbatey
event_type
login
staff_id
n/a
store_type
online
event_type
basket_add
staff_id
n/a
store_type
online
tags:item
coffee
event_type
basket_add
staff_id
n/a
store_type
online
tags:item
cheese
@chbatey
Get all the events
public List<CustomerEvent> getAllCustomerEvents() {

return session.execute("select * from customers.customer_events")

.all().stream()

.map(mapCustomerEvent())

.collect(Collectors.toList());

}
private Function<Row, CustomerEvent> mapCustomerEvent() {

return row -> new CustomerEvent(

row.getString("customer_id"),

row.getUUID("time"),

row.getString("staff_id"),

row.getString("store_type"),

row.getString("event_type"),

row.getMap("tags", String.class, String.class));

}
@chbatey
All events for a particular customer
private PreparedStatement getEventsForCustomer;



@PostConstruct

public void prepareSatements() {

getEventsForCustomer =
session.prepare("select * from customers.customer_events where customer_id = ?");

}



public List<CustomerEvent> getCustomerEvents(String customerId) {

BoundStatement boundStatement = getEventsForCustomer.bind(customerId);

return session.execute(boundStatement)
.all().stream()

.map(mapCustomerEvent())

.collect(Collectors.toList());

}
@chbatey
Customer events for a time slice
public List<CustomerEvent> getCustomerEventsForTime(String customerId, long startTime,
long endTime) {


Select.Where getCustomers = QueryBuilder.select()

.all()

.from("customers", "customer_events")

.where(eq("customer_id", customerId))

.and(gt("time", UUIDs.startOf(startTime)))

.and(lt("time", UUIDs.endOf(endTime)));





return session.execute(getCustomers).all().stream()

.map(mapCustomerEvent())

.collect(Collectors.toList());

}
@chbatey
@chbatey
Mapping API
@Table(keyspace = "customers", name = "customer_events")

public class CustomerEvent {

@PartitionKey

@Column(name = "customer_id")

private String customerId;



@ClusteringColumn

private UUID time;



@Column(name = "staff_id")

private String staffId;



@Column(name = "store_type")

private String storeType;



@Column(name = "event_type")

private String eventType;



private Map<String, String> tags;
// ctr / getters etc
}

@chbatey
Mapping API
@Accessor

public interface CustomerEventDao {

@Query("select * from customers.customer_events where customer_id = :customerId")

Result<CustomerEvent> getCustomerEvents(String customerId);



@Query("select * from customers.customer_events")

Result<CustomerEvent> getAllCustomerEvents();



@Query("select * from customers.customer_events where customer_id = :customerId
and time > minTimeuuid(:startTime) and time < maxTimeuuid(:endTime)")

Result<CustomerEvent> getCustomerEventsForTime(String customerId, long startTime,
long endTime);

}


@Bean

public CustomerEventDao customerEventDao() {

MappingManager mappingManager = new MappingManager(session);

return mappingManager.createAccessor(CustomerEventDao.class);

}
@chbatey
Adding some type safety
public enum StoreType {

ONLINE, RETAIL, FRANCHISE, MOBILE

}
@Table(keyspace = "customers", name = "customer_events")

public class CustomerEvent {

@PartitionKey

@Column(name = "customer_id")

private String customerId;



@ClusteringColumn()

private UUID time;



@Column(name = "staff_id")

private String staffId;



@Column(name = "store_type")

@Enumerated(EnumType.STRING) // could be EnumType.ORDINAL

private StoreType storeType;

@chbatey
User defined types
create TYPE store (name text, type text, postcode text) ;





CREATE TABLE customer_events_type(
customer_id text,
staff_id text,
time timeuuid,
store frozen<store>,
event_type text,
tags map<text, text>,
PRIMARY KEY ((customer_id), time));

@chbatey
Mapping user defined types
@UDT(keyspace = "customers", name = "store")

public class Store {

private String name;

private StoreType type;

private String postcode;
// getters etc
}
@Table(keyspace = "customers", name = "customer_events_type")

public class CustomerEventType {

@PartitionKey

@Column(name = "customer_id")

private String customerId;



@ClusteringColumn()

private UUID time;



@Column(name = "staff_id")

private String staffId;



@Frozen

private Store store;



@Column(name = "event_type")

private String eventType;



private Map<String, String> tags;

@chbatey
Mapping user defined types
@UDT(keyspace = "customers", name = "store")

public class Store {

private String name;

private StoreType type;

private String postcode;
// getters etc
}
@Table(keyspace = "customers", name = "customer_events_type")

public class CustomerEventType {

@PartitionKey

@Column(name = "customer_id")

private String customerId;



@ClusteringColumn()

private UUID time;



@Column(name = "staff_id")

private String staffId;



@Frozen

private Store store;



@Column(name = "event_type")

private String eventType;



private Map<String, String> tags;

@Query("select * from customers.customer_events_type")

Result<CustomerEventType> getAllCustomerEventsWithStoreType();
@chbatey
Extra goodies
@chbatey
©2014 DataStax. Do not distribute without consent.
Query Tracing
Connected to cluster: xerxes
Simplex keyspace and schema created.
Host (queried): /127.0.0.1
Host (tried): /127.0.0.1
Trace id: 96ac9400-a3a5-11e2-96a9-4db56cdc5fe7
activity | timestamp | source | source_elapsed
---------------------------------------+--------------+------------+--------------
Parsing statement | 12:17:16.736 | /127.0.0.1 | 28
Peparing statement | 12:17:16.736 | /127.0.0.1 | 199
Determining replicas for mutation | 12:17:16.736 | /127.0.0.1 | 348
Sending message to /127.0.0.3 | 12:17:16.736 | /127.0.0.1 | 788
Sending message to /127.0.0.2 | 12:17:16.736 | /127.0.0.1 | 805
Acquiring switchLock read lock | 12:17:16.736 | /127.0.0.1 | 828
Appending to commitlog | 12:17:16.736 | /127.0.0.1 | 848
Adding to songs memtable | 12:17:16.736 | /127.0.0.1 | 900
Message received from /127.0.0.1 | 12:17:16.737 | /127.0.0.2 | 34
Message received from /127.0.0.1 | 12:17:16.737 | /127.0.0.3 | 25
Acquiring switchLock read lock | 12:17:16.737 | /127.0.0.2 | 672
Acquiring switchLock read lock | 12:17:16.737 | /127.0.0.3 | 525
@chbatey
Storing events to both tables in a batch
public void storeEventLogged(CustomerEvent customerEvent) {

BoundStatement boundInsertForCustomerId = insertByCustomerId.bind(customerEvent.getCustomerId(),
customerEvent.getTime(),
customerEvent.getEventType(),
customerEvent.getStaffId(),
customerEvent.getStaffId());

BoundStatement boundInsertForStaffId = insertByStaffId.bind(customerEvent.getCustomerId(),
customerEvent.getTime(),
customerEvent.getEventType(),
customerEvent.getStaffId(),
customerEvent.getStaffId());


BatchStatement batchStatement = new BatchStatement(BatchStatement.Type.LOGGED);

batchStatement.add(boundInsertForCustomerId);

batchStatement.add(boundInsertForStaffId);



session.execute(batchStatement);

}
@chbatey
Why is this slower?
client
C BATCH LOG
BL-R
BL-R
BL-R: Batch log replica
@chbatey
Light weight transactions
• Often referred to as compare and set (CAS)
INSERT INTO STAFF (login, email, name)
values ('chbatey', ‘christopher.batey@datastax.com', ‘Chirstopher Batey')
IF NOT EXISTS
@chbatey
Summary
• Cassandra is a shared nothing masterless datastore
• Availability a.k.a up time is king
• Biggest hurdle is learning to model differently
• Modern drivers make it easy to work with
@chbatey
Thanks for listening
• Questions?
• Think of any later ping me on twitter @chbatey

More Related Content

What's hot

Cassandra 2.0 to 2.1
Cassandra 2.0 to 2.1Cassandra 2.0 to 2.1
Cassandra 2.0 to 2.1
Johnny Miller
 
Document validation in MongoDB 3.2
Document validation in MongoDB 3.2Document validation in MongoDB 3.2
Document validation in MongoDB 3.2
Andrew Morgan
 
Embrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with RippleEmbrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with Ripple
Sean Cribbs
 
Cassandra EU - Data model on fire
Cassandra EU - Data model on fireCassandra EU - Data model on fire
Cassandra EU - Data model on fire
Patrick McFadin
 
Jonathan Ellis "Apache Cassandra 2.0 and 2.1". Выступление на Cassandra conf ...
Jonathan Ellis "Apache Cassandra 2.0 and 2.1". Выступление на Cassandra conf ...Jonathan Ellis "Apache Cassandra 2.0 and 2.1". Выступление на Cassandra conf ...
Jonathan Ellis "Apache Cassandra 2.0 and 2.1". Выступление на Cassandra conf ...it-people
 
Hardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoiaHardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoia
zznate
 
Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)Sean Cribbs
 
Cassandra 2.0 and timeseries
Cassandra 2.0 and timeseriesCassandra 2.0 and timeseries
Cassandra 2.0 and timeseries
Patrick McFadin
 
Advanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache CassandraAdvanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache Cassandra
DataStax Academy
 
MySQL under the siege
MySQL under the siegeMySQL under the siege
MySQL under the siege
Source Ministry
 
Real data models of silicon valley
Real data models of silicon valleyReal data models of silicon valley
Real data models of silicon valley
Patrick McFadin
 
Service discovery and configuration provisioning
Service discovery and configuration provisioningService discovery and configuration provisioning
Service discovery and configuration provisioning
Source Ministry
 
Storing time series data with Apache Cassandra
Storing time series data with Apache CassandraStoring time series data with Apache Cassandra
Storing time series data with Apache Cassandra
Patrick McFadin
 
Dublin Meetup: Cassandra anti patterns
Dublin Meetup: Cassandra anti patternsDublin Meetup: Cassandra anti patterns
Dublin Meetup: Cassandra anti patterns
Christopher Batey
 
Cassandra Summit 2015
Cassandra Summit 2015Cassandra Summit 2015
Cassandra Summit 2015
jbellis
 
Cassandra summit keynote 2014
Cassandra summit keynote 2014Cassandra summit keynote 2014
Cassandra summit keynote 2014
jbellis
 
Enabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax EnterpriseEnabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax Enterprise
DataStax Academy
 
NAT64/DNS64 experiments, warnings and one useful tool
NAT64/DNS64 experiments, warnings and one useful toolNAT64/DNS64 experiments, warnings and one useful tool
NAT64/DNS64 experiments, warnings and one useful tool
APNIC
 
Cassandra Basics, Counters and Time Series Modeling
Cassandra Basics, Counters and Time Series ModelingCassandra Basics, Counters and Time Series Modeling
Cassandra Basics, Counters and Time Series Modeling
Vassilis Bekiaris
 
Time series databases
Time series databasesTime series databases
Time series databases
Source Ministry
 

What's hot (20)

Cassandra 2.0 to 2.1
Cassandra 2.0 to 2.1Cassandra 2.0 to 2.1
Cassandra 2.0 to 2.1
 
Document validation in MongoDB 3.2
Document validation in MongoDB 3.2Document validation in MongoDB 3.2
Document validation in MongoDB 3.2
 
Embrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with RippleEmbrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with Ripple
 
Cassandra EU - Data model on fire
Cassandra EU - Data model on fireCassandra EU - Data model on fire
Cassandra EU - Data model on fire
 
Jonathan Ellis "Apache Cassandra 2.0 and 2.1". Выступление на Cassandra conf ...
Jonathan Ellis "Apache Cassandra 2.0 and 2.1". Выступление на Cassandra conf ...Jonathan Ellis "Apache Cassandra 2.0 and 2.1". Выступление на Cassandra conf ...
Jonathan Ellis "Apache Cassandra 2.0 and 2.1". Выступление на Cassandra conf ...
 
Hardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoiaHardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoia
 
Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)
 
Cassandra 2.0 and timeseries
Cassandra 2.0 and timeseriesCassandra 2.0 and timeseries
Cassandra 2.0 and timeseries
 
Advanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache CassandraAdvanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache Cassandra
 
MySQL under the siege
MySQL under the siegeMySQL under the siege
MySQL under the siege
 
Real data models of silicon valley
Real data models of silicon valleyReal data models of silicon valley
Real data models of silicon valley
 
Service discovery and configuration provisioning
Service discovery and configuration provisioningService discovery and configuration provisioning
Service discovery and configuration provisioning
 
Storing time series data with Apache Cassandra
Storing time series data with Apache CassandraStoring time series data with Apache Cassandra
Storing time series data with Apache Cassandra
 
Dublin Meetup: Cassandra anti patterns
Dublin Meetup: Cassandra anti patternsDublin Meetup: Cassandra anti patterns
Dublin Meetup: Cassandra anti patterns
 
Cassandra Summit 2015
Cassandra Summit 2015Cassandra Summit 2015
Cassandra Summit 2015
 
Cassandra summit keynote 2014
Cassandra summit keynote 2014Cassandra summit keynote 2014
Cassandra summit keynote 2014
 
Enabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax EnterpriseEnabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax Enterprise
 
NAT64/DNS64 experiments, warnings and one useful tool
NAT64/DNS64 experiments, warnings and one useful toolNAT64/DNS64 experiments, warnings and one useful tool
NAT64/DNS64 experiments, warnings and one useful tool
 
Cassandra Basics, Counters and Time Series Modeling
Cassandra Basics, Counters and Time Series ModelingCassandra Basics, Counters and Time Series Modeling
Cassandra Basics, Counters and Time Series Modeling
 
Time series databases
Time series databasesTime series databases
Time series databases
 

Similar to LA Cassandra Day 2015 - Cassandra for developers

LJC Conference 2014 Cassandra for Java Developers
LJC Conference 2014 Cassandra for Java DevelopersLJC Conference 2014 Cassandra for Java Developers
LJC Conference 2014 Cassandra for Java Developers
Christopher Batey
 
LJC: Fault tolerance with Apache Cassandra
LJC: Fault tolerance with Apache CassandraLJC: Fault tolerance with Apache Cassandra
LJC: Fault tolerance with Apache Cassandra
Christopher Batey
 
Jan 2015 - Cassandra101 Manchester Meetup
Jan 2015 - Cassandra101 Manchester MeetupJan 2015 - Cassandra101 Manchester Meetup
Jan 2015 - Cassandra101 Manchester Meetup
Christopher Batey
 
DataStax: Making Cassandra Fail (for effective testing)
DataStax: Making Cassandra Fail (for effective testing)DataStax: Making Cassandra Fail (for effective testing)
DataStax: Making Cassandra Fail (for effective testing)
DataStax Academy
 
Cassandra Day London: Building Java Applications
Cassandra Day London: Building Java ApplicationsCassandra Day London: Building Java Applications
Cassandra Day London: Building Java Applications
Christopher Batey
 
Cassandra Day London 2015: Getting Started with Apache Cassandra and Java
Cassandra Day London 2015: Getting Started with Apache Cassandra and JavaCassandra Day London 2015: Getting Started with Apache Cassandra and Java
Cassandra Day London 2015: Getting Started with Apache Cassandra and Java
DataStax Academy
 
3 Dundee-Spark Overview for C* developers
3 Dundee-Spark Overview for C* developers3 Dundee-Spark Overview for C* developers
3 Dundee-Spark Overview for C* developers
Christopher Batey
 
Vienna Feb 2015: Cassandra: How it works and what it's good for!
Vienna Feb 2015: Cassandra: How it works and what it's good for!Vienna Feb 2015: Cassandra: How it works and what it's good for!
Vienna Feb 2015: Cassandra: How it works and what it's good for!
Christopher Batey
 
Manchester Hadoop Meetup: Spark Cassandra Integration
Manchester Hadoop Meetup: Spark Cassandra IntegrationManchester Hadoop Meetup: Spark Cassandra Integration
Manchester Hadoop Meetup: Spark Cassandra Integration
Christopher Batey
 
Reading Cassandra Meetup Feb 2015: Apache Spark
Reading Cassandra Meetup Feb 2015: Apache SparkReading Cassandra Meetup Feb 2015: Apache Spark
Reading Cassandra Meetup Feb 2015: Apache Spark
Christopher Batey
 
What is Apache Kafka and What is an Event Streaming Platform?
What is Apache Kafka and What is an Event Streaming Platform?What is Apache Kafka and What is an Event Streaming Platform?
What is Apache Kafka and What is an Event Streaming Platform?
confluent
 
Introduction to Real-Time Analytics with Cassandra and Hadoop
Introduction to Real-Time Analytics with Cassandra and HadoopIntroduction to Real-Time Analytics with Cassandra and Hadoop
Introduction to Real-Time Analytics with Cassandra and Hadoop
Patricia Gorla
 
Couchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problemCouchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problem
delagoya
 
Avoiding the Pit of Despair - Event Sourcing with Akka and Cassandra
Avoiding the Pit of Despair - Event Sourcing with Akka and CassandraAvoiding the Pit of Despair - Event Sourcing with Akka and Cassandra
Avoiding the Pit of Despair - Event Sourcing with Akka and Cassandra
Luke Tillman
 
Critical Attributes for a High-Performance, Low-Latency Database
Critical Attributes for a High-Performance, Low-Latency DatabaseCritical Attributes for a High-Performance, Low-Latency Database
Critical Attributes for a High-Performance, Low-Latency Database
ScyllaDB
 
NYC Cassandra Day - Java Intro
NYC Cassandra Day - Java IntroNYC Cassandra Day - Java Intro
NYC Cassandra Day - Java Intro
Christopher Batey
 
Design Patterns for Building 360-degree Views with HBase and Kiji
Design Patterns for Building 360-degree Views with HBase and KijiDesign Patterns for Building 360-degree Views with HBase and Kiji
Design Patterns for Building 360-degree Views with HBase and Kiji
HBaseCon
 
Munich March 2015 - Cassandra + Spark Overview
Munich March 2015 -  Cassandra + Spark OverviewMunich March 2015 -  Cassandra + Spark Overview
Munich March 2015 - Cassandra + Spark Overview
Christopher Batey
 
Grokking Engineering - Data Analytics Infrastructure at Viki - Huy Nguyen
Grokking Engineering - Data Analytics Infrastructure at Viki - Huy NguyenGrokking Engineering - Data Analytics Infrastructure at Viki - Huy Nguyen
Grokking Engineering - Data Analytics Infrastructure at Viki - Huy Nguyen
Huy Nguyen
 

Similar to LA Cassandra Day 2015 - Cassandra for developers (20)

LJC Conference 2014 Cassandra for Java Developers
LJC Conference 2014 Cassandra for Java DevelopersLJC Conference 2014 Cassandra for Java Developers
LJC Conference 2014 Cassandra for Java Developers
 
LJC: Fault tolerance with Apache Cassandra
LJC: Fault tolerance with Apache CassandraLJC: Fault tolerance with Apache Cassandra
LJC: Fault tolerance with Apache Cassandra
 
Jan 2015 - Cassandra101 Manchester Meetup
Jan 2015 - Cassandra101 Manchester MeetupJan 2015 - Cassandra101 Manchester Meetup
Jan 2015 - Cassandra101 Manchester Meetup
 
DataStax: Making Cassandra Fail (for effective testing)
DataStax: Making Cassandra Fail (for effective testing)DataStax: Making Cassandra Fail (for effective testing)
DataStax: Making Cassandra Fail (for effective testing)
 
Cassandra Day London: Building Java Applications
Cassandra Day London: Building Java ApplicationsCassandra Day London: Building Java Applications
Cassandra Day London: Building Java Applications
 
Cassandra Day London 2015: Getting Started with Apache Cassandra and Java
Cassandra Day London 2015: Getting Started with Apache Cassandra and JavaCassandra Day London 2015: Getting Started with Apache Cassandra and Java
Cassandra Day London 2015: Getting Started with Apache Cassandra and Java
 
3 Dundee-Spark Overview for C* developers
3 Dundee-Spark Overview for C* developers3 Dundee-Spark Overview for C* developers
3 Dundee-Spark Overview for C* developers
 
Vienna Feb 2015: Cassandra: How it works and what it's good for!
Vienna Feb 2015: Cassandra: How it works and what it's good for!Vienna Feb 2015: Cassandra: How it works and what it's good for!
Vienna Feb 2015: Cassandra: How it works and what it's good for!
 
Manchester Hadoop Meetup: Spark Cassandra Integration
Manchester Hadoop Meetup: Spark Cassandra IntegrationManchester Hadoop Meetup: Spark Cassandra Integration
Manchester Hadoop Meetup: Spark Cassandra Integration
 
Reading Cassandra Meetup Feb 2015: Apache Spark
Reading Cassandra Meetup Feb 2015: Apache SparkReading Cassandra Meetup Feb 2015: Apache Spark
Reading Cassandra Meetup Feb 2015: Apache Spark
 
Advanced Cassandra
Advanced CassandraAdvanced Cassandra
Advanced Cassandra
 
What is Apache Kafka and What is an Event Streaming Platform?
What is Apache Kafka and What is an Event Streaming Platform?What is Apache Kafka and What is an Event Streaming Platform?
What is Apache Kafka and What is an Event Streaming Platform?
 
Introduction to Real-Time Analytics with Cassandra and Hadoop
Introduction to Real-Time Analytics with Cassandra and HadoopIntroduction to Real-Time Analytics with Cassandra and Hadoop
Introduction to Real-Time Analytics with Cassandra and Hadoop
 
Couchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problemCouchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problem
 
Avoiding the Pit of Despair - Event Sourcing with Akka and Cassandra
Avoiding the Pit of Despair - Event Sourcing with Akka and CassandraAvoiding the Pit of Despair - Event Sourcing with Akka and Cassandra
Avoiding the Pit of Despair - Event Sourcing with Akka and Cassandra
 
Critical Attributes for a High-Performance, Low-Latency Database
Critical Attributes for a High-Performance, Low-Latency DatabaseCritical Attributes for a High-Performance, Low-Latency Database
Critical Attributes for a High-Performance, Low-Latency Database
 
NYC Cassandra Day - Java Intro
NYC Cassandra Day - Java IntroNYC Cassandra Day - Java Intro
NYC Cassandra Day - Java Intro
 
Design Patterns for Building 360-degree Views with HBase and Kiji
Design Patterns for Building 360-degree Views with HBase and KijiDesign Patterns for Building 360-degree Views with HBase and Kiji
Design Patterns for Building 360-degree Views with HBase and Kiji
 
Munich March 2015 - Cassandra + Spark Overview
Munich March 2015 -  Cassandra + Spark OverviewMunich March 2015 -  Cassandra + Spark Overview
Munich March 2015 - Cassandra + Spark Overview
 
Grokking Engineering - Data Analytics Infrastructure at Viki - Huy Nguyen
Grokking Engineering - Data Analytics Infrastructure at Viki - Huy NguyenGrokking Engineering - Data Analytics Infrastructure at Viki - Huy Nguyen
Grokking Engineering - Data Analytics Infrastructure at Viki - Huy Nguyen
 

More from Christopher Batey

Cassandra summit LWTs
Cassandra summit  LWTsCassandra summit  LWTs
Cassandra summit LWTs
Christopher Batey
 
Docker and jvm. A good idea?
Docker and jvm. A good idea?Docker and jvm. A good idea?
Docker and jvm. A good idea?
Christopher Batey
 
LJC: Microservices in the real world
LJC: Microservices in the real worldLJC: Microservices in the real world
LJC: Microservices in the real world
Christopher Batey
 
Cassandra Day NYC - Cassandra anti patterns
Cassandra Day NYC - Cassandra anti patternsCassandra Day NYC - Cassandra anti patterns
Cassandra Day NYC - Cassandra anti patterns
Christopher Batey
 
Think your software is fault-tolerant? Prove it!
Think your software is fault-tolerant? Prove it!Think your software is fault-tolerant? Prove it!
Think your software is fault-tolerant? Prove it!
Christopher Batey
 
Manchester Hadoop Meetup: Cassandra Spark internals
Manchester Hadoop Meetup: Cassandra Spark internalsManchester Hadoop Meetup: Cassandra Spark internals
Manchester Hadoop Meetup: Cassandra Spark internals
Christopher Batey
 
Cassandra London - 2.2 and 3.0
Cassandra London - 2.2 and 3.0Cassandra London - 2.2 and 3.0
Cassandra London - 2.2 and 3.0
Christopher Batey
 
Cassandra London - C* Spark Connector
Cassandra London - C* Spark ConnectorCassandra London - C* Spark Connector
Cassandra London - C* Spark Connector
Christopher Batey
 
IoT London July 2015
IoT London July 2015IoT London July 2015
IoT London July 2015
Christopher Batey
 
1 Dundee - Cassandra 101
1 Dundee - Cassandra 1011 Dundee - Cassandra 101
1 Dundee - Cassandra 101
Christopher Batey
 
2 Dundee - Cassandra-3
2 Dundee - Cassandra-32 Dundee - Cassandra-3
2 Dundee - Cassandra-3
Christopher Batey
 
Paris Day Cassandra: Use case
Paris Day Cassandra: Use caseParis Day Cassandra: Use case
Paris Day Cassandra: Use case
Christopher Batey
 
Data Science Lab Meetup: Cassandra and Spark
Data Science Lab Meetup: Cassandra and SparkData Science Lab Meetup: Cassandra and Spark
Data Science Lab Meetup: Cassandra and Spark
Christopher Batey
 
Devoxx France: Fault tolerant microservices on the JVM with Cassandra
Devoxx France: Fault tolerant microservices on the JVM with CassandraDevoxx France: Fault tolerant microservices on the JVM with Cassandra
Devoxx France: Fault tolerant microservices on the JVM with Cassandra
Christopher Batey
 
Manchester Hadoop User Group: Cassandra Intro
Manchester Hadoop User Group: Cassandra IntroManchester Hadoop User Group: Cassandra Intro
Manchester Hadoop User Group: Cassandra Intro
Christopher Batey
 
Webinar Cassandra Anti-Patterns
Webinar Cassandra Anti-PatternsWebinar Cassandra Anti-Patterns
Webinar Cassandra Anti-Patterns
Christopher Batey
 
LA Cassandra Day 2015 - Testing Cassandra
LA Cassandra Day 2015  - Testing CassandraLA Cassandra Day 2015  - Testing Cassandra
LA Cassandra Day 2015 - Testing Cassandra
Christopher Batey
 
Voxxed Vienna 2015 Fault tolerant microservices
Voxxed Vienna 2015 Fault tolerant microservicesVoxxed Vienna 2015 Fault tolerant microservices
Voxxed Vienna 2015 Fault tolerant microservices
Christopher Batey
 
Cassandra Summit EU 2014 Lightning talk - Paging (no animation)
Cassandra Summit EU 2014 Lightning talk - Paging (no animation)Cassandra Summit EU 2014 Lightning talk - Paging (no animation)
Cassandra Summit EU 2014 Lightning talk - Paging (no animation)
Christopher Batey
 
Cassandra Summit EU 2014 - Testing Cassandra Applications
Cassandra Summit EU 2014 - Testing Cassandra ApplicationsCassandra Summit EU 2014 - Testing Cassandra Applications
Cassandra Summit EU 2014 - Testing Cassandra Applications
Christopher Batey
 

More from Christopher Batey (20)

Cassandra summit LWTs
Cassandra summit  LWTsCassandra summit  LWTs
Cassandra summit LWTs
 
Docker and jvm. A good idea?
Docker and jvm. A good idea?Docker and jvm. A good idea?
Docker and jvm. A good idea?
 
LJC: Microservices in the real world
LJC: Microservices in the real worldLJC: Microservices in the real world
LJC: Microservices in the real world
 
Cassandra Day NYC - Cassandra anti patterns
Cassandra Day NYC - Cassandra anti patternsCassandra Day NYC - Cassandra anti patterns
Cassandra Day NYC - Cassandra anti patterns
 
Think your software is fault-tolerant? Prove it!
Think your software is fault-tolerant? Prove it!Think your software is fault-tolerant? Prove it!
Think your software is fault-tolerant? Prove it!
 
Manchester Hadoop Meetup: Cassandra Spark internals
Manchester Hadoop Meetup: Cassandra Spark internalsManchester Hadoop Meetup: Cassandra Spark internals
Manchester Hadoop Meetup: Cassandra Spark internals
 
Cassandra London - 2.2 and 3.0
Cassandra London - 2.2 and 3.0Cassandra London - 2.2 and 3.0
Cassandra London - 2.2 and 3.0
 
Cassandra London - C* Spark Connector
Cassandra London - C* Spark ConnectorCassandra London - C* Spark Connector
Cassandra London - C* Spark Connector
 
IoT London July 2015
IoT London July 2015IoT London July 2015
IoT London July 2015
 
1 Dundee - Cassandra 101
1 Dundee - Cassandra 1011 Dundee - Cassandra 101
1 Dundee - Cassandra 101
 
2 Dundee - Cassandra-3
2 Dundee - Cassandra-32 Dundee - Cassandra-3
2 Dundee - Cassandra-3
 
Paris Day Cassandra: Use case
Paris Day Cassandra: Use caseParis Day Cassandra: Use case
Paris Day Cassandra: Use case
 
Data Science Lab Meetup: Cassandra and Spark
Data Science Lab Meetup: Cassandra and SparkData Science Lab Meetup: Cassandra and Spark
Data Science Lab Meetup: Cassandra and Spark
 
Devoxx France: Fault tolerant microservices on the JVM with Cassandra
Devoxx France: Fault tolerant microservices on the JVM with CassandraDevoxx France: Fault tolerant microservices on the JVM with Cassandra
Devoxx France: Fault tolerant microservices on the JVM with Cassandra
 
Manchester Hadoop User Group: Cassandra Intro
Manchester Hadoop User Group: Cassandra IntroManchester Hadoop User Group: Cassandra Intro
Manchester Hadoop User Group: Cassandra Intro
 
Webinar Cassandra Anti-Patterns
Webinar Cassandra Anti-PatternsWebinar Cassandra Anti-Patterns
Webinar Cassandra Anti-Patterns
 
LA Cassandra Day 2015 - Testing Cassandra
LA Cassandra Day 2015  - Testing CassandraLA Cassandra Day 2015  - Testing Cassandra
LA Cassandra Day 2015 - Testing Cassandra
 
Voxxed Vienna 2015 Fault tolerant microservices
Voxxed Vienna 2015 Fault tolerant microservicesVoxxed Vienna 2015 Fault tolerant microservices
Voxxed Vienna 2015 Fault tolerant microservices
 
Cassandra Summit EU 2014 Lightning talk - Paging (no animation)
Cassandra Summit EU 2014 Lightning talk - Paging (no animation)Cassandra Summit EU 2014 Lightning talk - Paging (no animation)
Cassandra Summit EU 2014 Lightning talk - Paging (no animation)
 
Cassandra Summit EU 2014 - Testing Cassandra Applications
Cassandra Summit EU 2014 - Testing Cassandra ApplicationsCassandra Summit EU 2014 - Testing Cassandra Applications
Cassandra Summit EU 2014 - Testing Cassandra Applications
 

Recently uploaded

Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
KrzysztofKkol1
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
MayankTawar1
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
Sharepoint Designs
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
ayushiqss
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Hivelance Technology
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
Jelle | Nordend
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 

Recently uploaded (20)

Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 

LA Cassandra Day 2015 - Cassandra for developers

  • 1. @chbatey Christopher Batey
 Technical Evangelist for Apache Cassandra LA 2015: Cassandra for Java developers
  • 2. @chbatey Who am I? • Based in London • Technical Evangelist for Apache Cassandra •Work on Stubbed Cassandra •Help out Apache Cassandra users • Previous: Cassandra backed apps at BSkyB
  • 3. @chbatey Overview • Why distributed databases? • Cassandra fundamentals • Java driver • Example: Customer events
  • 11. @chbatey Cassandra Cassandra • Distributed masterless database (Dynamo) • Column family data model (Google BigTable)
  • 12. @chbatey Datacenter and rack aware Europe • Distributed master less database (Dynamo) • Column family data model (Google BigTable) • Multi data centre replication built in from the start USA
  • 14. @chbatey Tunable Consistency •Data is replicated N times •Every query that you execute you give a consistency -ALL -QUORUM -LOCAL_QUORUM -ONE • Christos Kalantzis Eventual Consistency != Hopeful Consistency: http:// youtu.be/A6qzx_HE3EU?list=PLqcm6qE9lgKJzVvwHprow9h7KMpb5hcUU
  • 20. @chbatey Java driver 101 • Cluster - singleton per app • Session - singleton per keyspace Cluster cluster = Cluster.builder()
 .addContactPoint(“host1”, “host2”)
 .build(); Session session = cluster.connect("customer_events");
  • 21. @chbatey Load balancing •Data centre aware policy •Token aware policy •Latency aware policy •Whitelist policy APP APP Async Replication DC1 DC2
  • 22. @chbatey Multi Data Center Load Balancing • Local nodes are queried first, if none are available the request will be sent to a remote data center Cluster cluster = Cluster.builder() .addContactPoints("10.158.02.40", "10.158.02.44") .withLoadBalancingPolicy( new DCAwareRoundRobinPolicy("DC1")) .build(); Name of the local DC
  • 23. @chbatey Token Aware Load Balancing • Nodes that own a replica of the data being read or written by the query will be contacted first Cluster cluster = Cluster.builder() .addContactPoints("10.158.02.40", "10.158.02.44") .withLoadBalancingPolicy( new TokenAwarePolicy( new DCAwareRoundRobinPolicy("DC1"))) .build();
  • 24. @chbatey Retry Policies • The behaviour to adopt when a request returns a timeout or is unavailable. Cluster cluster = Cluster.builder() .addContactPoints("10.158.02.40", "10.158.02.44") .withRetryPolicy(FallthroughRetryPolicy.INSTANCE) .withLoadBalancingPolicy(new TokenAwarePolicy(new DCAwareRoundRobinPolicy("DC1"))) .build(); • DefaultRetryPolicy • DowngradingConsistencyRetryPolicy • FallthroughRetryPolicy • LoggingRetryPolicy
  • 25. @chbatey Reconnection Policies • Policy that decides how often the reconnection to a dead node is attempted. Cluster cluster = Cluster.builder() .addContactPoints("10.158.02.40", "10.158.02.44”) .withRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE) .withReconnectionPolicy(new ConstantReconnectionPolicy(1000)) .withLoadBalancingPolicy(new TokenAwarePolicy(new DCAwareRoundRobinPolicy("DC1"))) .build();
 • ConstantReconnectionPolicy • ExponentialReconnectionPolicy (Default)
  • 26. @chbatey Session interface 
 ResultSet result = session.execute("select * from customer_events");
 ResultSetFuture resultSetFuture = session.executeAsync("select * from customer_events”);
 // prepare PreparedStatement preparedStatement = session.prepare("select * from where customer_id = ?”); // execute BoundStatement boundStatement = preparedStatement.bind(“chbatey"); ResultSet execute = session.execute(boundStatement); Guava listenable future! Statement simpleStatement = new SimpleStatement("select * from customer_events");
 simpleStatement.setConsistencyLevel(ConsistencyLevel.QUORUM);
 ResultSetFuture resultSetFuture = session.executeAsync(simpleStatement);
  • 27. @chbatey RxJava? public Observable<CustomerEvent> getCustomerEventsObservable(String customerId) {
 BoundStatement boundStatement = getEventsForCustomer.bind(customerId);
 ListenableFuture<ResultSet> resultSetFuture = session.executeAsync(boundStatement);
 // map to an obserable Observable<ResultSet> observable = Observable.from(resultSetFuture, Schedulers.io()); // ResultSet is an Iterator<Row> 
 Observable<Row> rowObservable = observable.flatMapIterable(eachRow -> eachRow);
 return rowObservable.map(row -> new CustomerEvent(
 row.getString("customer_id"),
 row.getUUID("time"),
 row.getString("staff_id"),
 row.getString("store_type"),
 row.getString("event_type"),
 row.getMap("tags", String.class, String.class))); http://christopher-batey.blogspot.com/2014/12/streaming-large-payloads-over-http-from.html http://www.datastax.com/dev/blog/java-driver-async-queries
  • 29. @chbatey An example: Customer event store • Customer event - customer_id e.g ChrisBatey - event_type e.g login, logout, add_to_basket, remove_from_basket, buy_item • Staff - name e.g Charlie - favourite_colour e.g red • Store - name - type e.g Website, PhoneApp, Phone, Retail
  • 30. @chbatey Requirements • Get all events for a particular customer • As above for a time slice • Future requirement: Get all events by staff member?
  • 31. @chbatey Modelling in a relational database CREATE TABLE customer_events( customer_id text, staff_name text, time timeuuid, event_type text, store_name text, PRIMARY KEY (customer_id)); CREATE TABLE store( name text, location text, store_type text, PRIMARY KEY (name)); CREATE TABLE staff( name text, favourite_colour text, job_title text, PRIMARY KEY (name));
  • 32. @chbatey Reading this client RF3 C Read latest customer event CL = QUORUM Read store or staff information C
  • 34. @chbatey Your model should look like your queries
  • 35. Modelling in Cassandra CREATE TABLE customer_events( customer_id text, staff_id text, time timeuuid, store_type text, event_type text, tags map<text, text>, PRIMARY KEY ((customer_id), time)); Partition Key Clustering Column(s)
  • 36. How it is stored on disk customer _id time event_type store_type tags charles 2014-11-18 16:52:04 basket_add online {'item': 'coffee'} charles 2014-11-18 16:53:00 basket_add online {'item': ‘wine'} charles 2014-11-18 16:53:09 logout online {} chbatey 2014-11-18 16:52:21 login online {} chbatey 2014-11-18 16:53:21 basket_add online {'item': 'coffee'} chbatey 2014-11-18 16:54:00 basket_add online {'item': 'cheese'} charles event_type basket_add staff_id n/a store_type online tags:item coffee event_type basket_add staff_id n/a store_type online tags:item wine event_type logout staff_id n/a store_type online chbatey event_type login staff_id n/a store_type online event_type basket_add staff_id n/a store_type online tags:item coffee event_type basket_add staff_id n/a store_type online tags:item cheese
  • 37. @chbatey Get all the events public List<CustomerEvent> getAllCustomerEvents() {
 return session.execute("select * from customers.customer_events")
 .all().stream()
 .map(mapCustomerEvent())
 .collect(Collectors.toList());
 } private Function<Row, CustomerEvent> mapCustomerEvent() {
 return row -> new CustomerEvent(
 row.getString("customer_id"),
 row.getUUID("time"),
 row.getString("staff_id"),
 row.getString("store_type"),
 row.getString("event_type"),
 row.getMap("tags", String.class, String.class));
 }
  • 38. @chbatey All events for a particular customer private PreparedStatement getEventsForCustomer;
 
 @PostConstruct
 public void prepareSatements() {
 getEventsForCustomer = session.prepare("select * from customers.customer_events where customer_id = ?");
 }
 
 public List<CustomerEvent> getCustomerEvents(String customerId) {
 BoundStatement boundStatement = getEventsForCustomer.bind(customerId);
 return session.execute(boundStatement) .all().stream()
 .map(mapCustomerEvent())
 .collect(Collectors.toList());
 }
  • 39. @chbatey Customer events for a time slice public List<CustomerEvent> getCustomerEventsForTime(String customerId, long startTime, long endTime) { 
 Select.Where getCustomers = QueryBuilder.select()
 .all()
 .from("customers", "customer_events")
 .where(eq("customer_id", customerId))
 .and(gt("time", UUIDs.startOf(startTime)))
 .and(lt("time", UUIDs.endOf(endTime)));
 
 
 return session.execute(getCustomers).all().stream()
 .map(mapCustomerEvent())
 .collect(Collectors.toList());
 }
  • 41. @chbatey Mapping API @Table(keyspace = "customers", name = "customer_events")
 public class CustomerEvent {
 @PartitionKey
 @Column(name = "customer_id")
 private String customerId;
 
 @ClusteringColumn
 private UUID time;
 
 @Column(name = "staff_id")
 private String staffId;
 
 @Column(name = "store_type")
 private String storeType;
 
 @Column(name = "event_type")
 private String eventType;
 
 private Map<String, String> tags; // ctr / getters etc }

  • 42. @chbatey Mapping API @Accessor
 public interface CustomerEventDao {
 @Query("select * from customers.customer_events where customer_id = :customerId")
 Result<CustomerEvent> getCustomerEvents(String customerId);
 
 @Query("select * from customers.customer_events")
 Result<CustomerEvent> getAllCustomerEvents();
 
 @Query("select * from customers.customer_events where customer_id = :customerId and time > minTimeuuid(:startTime) and time < maxTimeuuid(:endTime)")
 Result<CustomerEvent> getCustomerEventsForTime(String customerId, long startTime, long endTime);
 } 
 @Bean
 public CustomerEventDao customerEventDao() {
 MappingManager mappingManager = new MappingManager(session);
 return mappingManager.createAccessor(CustomerEventDao.class);
 }
  • 43. @chbatey Adding some type safety public enum StoreType {
 ONLINE, RETAIL, FRANCHISE, MOBILE
 } @Table(keyspace = "customers", name = "customer_events")
 public class CustomerEvent {
 @PartitionKey
 @Column(name = "customer_id")
 private String customerId;
 
 @ClusteringColumn()
 private UUID time;
 
 @Column(name = "staff_id")
 private String staffId;
 
 @Column(name = "store_type")
 @Enumerated(EnumType.STRING) // could be EnumType.ORDINAL
 private StoreType storeType;

  • 44. @chbatey User defined types create TYPE store (name text, type text, postcode text) ;
 
 
 CREATE TABLE customer_events_type( customer_id text, staff_id text, time timeuuid, store frozen<store>, event_type text, tags map<text, text>, PRIMARY KEY ((customer_id), time));

  • 45. @chbatey Mapping user defined types @UDT(keyspace = "customers", name = "store")
 public class Store {
 private String name;
 private StoreType type;
 private String postcode; // getters etc } @Table(keyspace = "customers", name = "customer_events_type")
 public class CustomerEventType {
 @PartitionKey
 @Column(name = "customer_id")
 private String customerId;
 
 @ClusteringColumn()
 private UUID time;
 
 @Column(name = "staff_id")
 private String staffId;
 
 @Frozen
 private Store store;
 
 @Column(name = "event_type")
 private String eventType;
 
 private Map<String, String> tags;

  • 46. @chbatey Mapping user defined types @UDT(keyspace = "customers", name = "store")
 public class Store {
 private String name;
 private StoreType type;
 private String postcode; // getters etc } @Table(keyspace = "customers", name = "customer_events_type")
 public class CustomerEventType {
 @PartitionKey
 @Column(name = "customer_id")
 private String customerId;
 
 @ClusteringColumn()
 private UUID time;
 
 @Column(name = "staff_id")
 private String staffId;
 
 @Frozen
 private Store store;
 
 @Column(name = "event_type")
 private String eventType;
 
 private Map<String, String> tags;
 @Query("select * from customers.customer_events_type")
 Result<CustomerEventType> getAllCustomerEventsWithStoreType();
  • 48. @chbatey ©2014 DataStax. Do not distribute without consent. Query Tracing Connected to cluster: xerxes Simplex keyspace and schema created. Host (queried): /127.0.0.1 Host (tried): /127.0.0.1 Trace id: 96ac9400-a3a5-11e2-96a9-4db56cdc5fe7 activity | timestamp | source | source_elapsed ---------------------------------------+--------------+------------+-------------- Parsing statement | 12:17:16.736 | /127.0.0.1 | 28 Peparing statement | 12:17:16.736 | /127.0.0.1 | 199 Determining replicas for mutation | 12:17:16.736 | /127.0.0.1 | 348 Sending message to /127.0.0.3 | 12:17:16.736 | /127.0.0.1 | 788 Sending message to /127.0.0.2 | 12:17:16.736 | /127.0.0.1 | 805 Acquiring switchLock read lock | 12:17:16.736 | /127.0.0.1 | 828 Appending to commitlog | 12:17:16.736 | /127.0.0.1 | 848 Adding to songs memtable | 12:17:16.736 | /127.0.0.1 | 900 Message received from /127.0.0.1 | 12:17:16.737 | /127.0.0.2 | 34 Message received from /127.0.0.1 | 12:17:16.737 | /127.0.0.3 | 25 Acquiring switchLock read lock | 12:17:16.737 | /127.0.0.2 | 672 Acquiring switchLock read lock | 12:17:16.737 | /127.0.0.3 | 525
  • 49. @chbatey Storing events to both tables in a batch public void storeEventLogged(CustomerEvent customerEvent) {
 BoundStatement boundInsertForCustomerId = insertByCustomerId.bind(customerEvent.getCustomerId(), customerEvent.getTime(), customerEvent.getEventType(), customerEvent.getStaffId(), customerEvent.getStaffId());
 BoundStatement boundInsertForStaffId = insertByStaffId.bind(customerEvent.getCustomerId(), customerEvent.getTime(), customerEvent.getEventType(), customerEvent.getStaffId(), customerEvent.getStaffId()); 
 BatchStatement batchStatement = new BatchStatement(BatchStatement.Type.LOGGED);
 batchStatement.add(boundInsertForCustomerId);
 batchStatement.add(boundInsertForStaffId);
 
 session.execute(batchStatement);
 }
  • 50. @chbatey Why is this slower? client C BATCH LOG BL-R BL-R BL-R: Batch log replica
  • 51. @chbatey Light weight transactions • Often referred to as compare and set (CAS) INSERT INTO STAFF (login, email, name) values ('chbatey', ‘christopher.batey@datastax.com', ‘Chirstopher Batey') IF NOT EXISTS
  • 52. @chbatey Summary • Cassandra is a shared nothing masterless datastore • Availability a.k.a up time is king • Biggest hurdle is learning to model differently • Modern drivers make it easy to work with
  • 53. @chbatey Thanks for listening • Questions? • Think of any later ping me on twitter @chbatey