• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter
 

C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter

on

  • 834 views

Speakers: Michaël Figuiere, Software Engineer at DataStax & Alex Popescu, Senior Product Manager at DataStax ...

Speakers: Michaël Figuiere, Software Engineer at DataStax & Alex Popescu, Senior Product Manager at DataStax
Video: http://www.youtube.com/watch?v=hK2dXLiYVMI&list=PLqcm6qE9lgKLoYaakl3YwIWP4hmGsHm5e&index=11
Is Cassandra too complex for newcomers? Besides the many improvements that have made their way into C* to dramatically simplify it and the finalized Cassandra Query Language, the SQL-like query language that should look familiar, new drivers have been created with a modern and efficient API. Last, but not least, DataStax is introducing *today* DevCenter 1.0, an IDE whose goal is to simplify developer's workflow even further and to improve their productivity. This presentation will show you how putting to work the new drivers and DevCenter can make your daily life with Cassandra nicer!

Statistics

Views

Total Views
834
Views on SlideShare
830
Embed Views
4

Actions

Likes
2
Downloads
8
Comments
0

2 Embeds 4

http://23.253.69.203 3
http://localhost 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter Presentation Transcript

    • #CASSANDRAEU Cassandra made simple with CQL drivers and DevCenter Michaël Figuiere, Software Engineer, DataStax ! Alex Popescu, Sen.Product Manager, DataStax
    • Agenda •Why building tools for Cassandra? •DataStax Drivers • Core values •Introducing DevCenter #CASSANDRAEU
    • Motivation «Use the right tool for the job» ... the best tools for the job #CASSANDRAEU
    • Why building tools for C* •Too many choices •Best practices •distributed systems •modern applications •Friendly, Familiar, Integrated experience #CASSANDRAEU
    • One way or another •Learn & experiment •Implement •Test •Integrate ! •Repeat #CASSANDRAEU
    • CQL The new face of Cassandra * CQL * Simpler Data Model using Denormalized Tables * SQL-like Query Language * Schema Definition * CQL Native Protocol * Introduced in Cassandra 1.2 * Designed for CQL * Thrift will keep being supported by Cassandra
    • CQL Drivers Overview * Reference Implementation * Asynchronous architecture based on Netty * Prepared Statements Support * Automatic Fail-over * Node Discovery * Cassandra Tracing Support * Tunable Policies !
    • Request Pipelining Client Cassandra Without Request Pipelining Client Cassandra With Request Pipelining
    • Notifications Node Client Node Node With Notifications Node Client Node Without Notifications Node
    • Asynchronous Architecture Nod Client Thread Nod Client Thread Driver Nod Client Thread Nod
    • Asynchronous Architecture Nod Client Thread 6 Nod 1 Client Thread 2 Driver 3 Nod 5 Client Thread 4 Nod
    • Connect and Write Cluster cluster = new Cluster.builder() .addContactPoints("10.0.0.1", "10.0.0.2") .build(); ! Session session = cluster.connect("myKeyspace"); ! session.execute( "INSERT INTO user (user_id, name, email) VALUES (12345, 'johndoe', 'john@doe.com')" );
    • Read from a table ResultSet rs = session.execute("SELECT * FROM test"); ! List<Row> rows = rs.all(); for (Row row : rows) { ! String userId = row.getString("user_id"); String name = row.getString("name"); String email = row.getString("email"); }
    • Asynchronous Read ResultSetFuture future = session.executeAsync("SELECT * FROM test"); ! for (Row row : future.get()) { ! String userId = row.getString("user_id"); String name = row.getString("name"); String email = row.getString("email"); }
    • Read with Callbacks final ResultSetFuture future = session.executeAsync("SELECT * FROM test"); ! future.addListener(new Runnable() { public run() { for (Row row : future.get()) { ! String userId = row.getString("user_id"); String name = row.getString("name"); String email = row.getString("email"); } } }, executor);
    • Using Prepared Statements public void setUserByPreparedStatement(User user) {! ! BoundStatement bs = setUser.bind();! ! bs.setString("username", user.getUsername());! bs.setString("firstname", user.getFirstname());! bs.setString("lastname", user.getLastname());! bs.setString("email", user.getEmail());! bs.setDate("created_date", user.getCreated_date());! ! ! ! session.execute(bs); ! }
    • Using the Query Builder Query query = select().all().from("videodb", "videos")! .where(eq("videoId", videoId)).limit(10);! ! query.setConsistencyLevel(ConsistencyLevel.ONE);! ! ResultSet rs = session.execute(query);!
    • Load Balancing and Failover Respons e 5 Retry Policy 4 6 Client 1 Load Balancing Policy 3 Node Node 2 Node Health Monitor Notifications Reconnection
    • Multi Datacenter Load Balancing Datacenter A Client Node Client Node Client Node Client Node Client Client Node Node Datacenter B Local nodes are queried first, if non are available, the request will be sent to a remote node.
    • Token Aware Load Balancing Replic Node a Node Replic Node Client a Node Replic a Node Nodes that own a Replica of the data being read or written by the query will be contacted first.
    • Add a Load Balancing Policy ! ! cluster = Cluster.builder()! .addContactPoints("10.0.0.1", "10.0.0.2") .withLoadBalancingPolicy(Policies.defaultLoadBalancingPolicy())! .build();! ! session = cluster.connect(keyspace);! Create your own policy!
    • Automatic Paging Nod Query Client Page 1 + Paging State 1 Repli Nod Repli Nod Repli
    • Automatic Paging Nod Repli Query + Paging State 1 Client Nod Repli Page 2 + Paging State 2 Nod Repli
    • Introducing DevCenter 1.0
    • DevCenter #CASSANDRAEU •DevCenter is a free visual query tool that can be used by both developers and admins for creating and running CQL queries and commands against Apache Cassandra and DataStax Enterprise •DevCenter is the smarter and friendlier brother of cqlsh
    • DevCenter #CASSANDRAEU Pull a Steve Jobs... ... brag about how brilliant DevCenter is
    • #CASSANDRAEU Quick links *DataStax drivers: http://github.com/datastax *DevCenter: http://www.datastax.com/dev/blog/datastaxdevcenter-1-0-is-here http://www.datastax.com/download/clientdrivers !