develop scalable applications with datastax drivers (alex popescu, bulat shakirzyanov, datastax) |...

22
Develop scalable applications with DataStax Drivers for Apache Cassandra and DataStax Enterprise Alex Popescu & Bulat Shakirzyanov

Upload: datastax

Post on 24-Jan-2017

63 views

Category:

Software


0 download

TRANSCRIPT

Develop scalable applications with DataStax Drivers for Apache Cassandra and DataStax Enterprise

Alex Popescu & Bulat Shakirzyanov

© DataStax, All Rights Reserved.

1 Overview of DataStax drivers

2 Load balancing

3 Fault tolerance

4 Address resolution

5 Sneak peek at upcoming features

2

DataStax DriversSmart clients for Apache Cassandra and DataStax Enterprise

© DataStax, All Rights Reserved.

DataStax Drivers

4

© DataStax, All Rights Reserved.

Goals of DataStax Drivers• Consistent set of features across languages

• Asynchronous execution

• Automatic cluster discovery

• Connection pools and automatic reconnection

• Load balancing

• Fault tolerant

• Address resolution

• Flexible to the core • Consistent terminology

• Cluster -> Session -> PreparedStatement & Statement -> Future or ResultSet

5

Load BalancingPrinciples and Implementations

Application Driver

Load Balancing

Application Thread

NodePool

SessionPool

Pool

Pool

Application Thread

Application Thread

Client Cluster

Node

Node

Node

Load Balancing

Policy

Datacenter

Datacenter

DataCenter Aware Balancing

Node

Node

NodeClient

Node

Node

Node

Client

Client

Client

Client

Client

Local nodes are queried first, if none are available, the request could be sent to a remote node.

Token Aware BalancingRoute request directly to Replicas

Node

Node

ReplicaNode

Client

Replica

Replica

Uses prepared statement metadata to get the token

Fault ToleranceSources of Failure and Error Handling

Fault Tolerance

Coordinator

Node Replica

Replica

ReplicaNode

Business Logic

Driver

Application

Possible Failures

Coordinator

Node Replica

Replica

ReplicaNode

Business Logic

Driver

Application

Invalid Requests

Network Timeouts

Server Errors

Application Driver

Automatic Retry of Server Errors

Application Thread

NodePool

SessionPool

Pool

Pool

Application Thread

Application Thread

Client Cluster

Node

Node

Node

Load Balancing

Policy

Address ResolutionTopology Aware Client

Datacenter Datacenter

Multiple Addresses

Node

NodeNode

Node

Client Client

Node

NodeNode

Node

Client Client

Within Datacenter:Private IPs

Across Datacenters:Public IPs

Application Driver

Address ResolutionApplication

Thread NodePool

Cluster

Pool

Pool

Pool

Application Thread

Application Thread

Client Cluster

Node

Node

Node

Address Resolution

Policy

Control Connection

Session

EC2 Multi-Region Address Resolution

17

One more thing…Sneak peek of new and upcoming driver features

© DataStax, All Rights Reserved.

Sneak peek: Slow query log

19

© DataStax, All Rights Reserved.

Sneak peek: Execution profiles

20

© DataStax, All Rights Reserved.

Sneak peak: Speculative retries

21

Q&AThank you!