Your SlideShare is downloading. ×
Cassandra Day SV 2014: Netflix’s Astyanax Java Client Driver for Apache Cassandra
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Cassandra Day SV 2014: Netflix’s Astyanax Java Client Driver for Apache Cassandra

1,003
views

Published on

Astyanax is the thrift protocol based C* driver widely used and open sourced by Netflix. It was recently integrated with the Java Driver released by DataStax. This talk focusses on the different …

Astyanax is the thrift protocol based C* driver widely used and open sourced by Netflix. It was recently integrated with the Java Driver released by DataStax. This talk focusses on the different options available with Astyanax and how it complements the Java Driver.

About Puneet Oberai, Senior Software Engineer at Netflix
Senior Software Engineer at Netflix and proud team member of Netflix CDE (Cloud Data Engineering).

Published in: Technology, News & Politics

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,003
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
10
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Astyanax   Puneet  Oberai   Ne1lix,  Inc.  
  • 2. h8ps://github.com/Ne1lix/astyanax    
  • 3. Useful  features   –  Load  balancing   –  ConnecDon  pooling  -­‐  resilient  with  failover  and  retries   –  Integrates  with  external  host  discovery   –  Metrics  (there  are  a  lot!)   –  Highly  configurable  and  pluggable  
  • 4. Fluent  query  syntax   ColumnList<Integer>    =      keyspace                          .readQuery(  “myCF”  )      .getRow(  “A”  )      .withColumnSlice(  new  RangeBuilder()                  .greaterThan(11)                  .lessThanEquals(18)                  .build())      .execute()      .getResult();  
  • 5. Recipes   •  All  Rows  Reader   •  Distributed  Row  Lock   •  Queue   •  Chunked  Object  Store  
  • 6. How  does  Ne1lix  use  it  
  • 7. Java  Driver  release  in  2013   •  Async  interface!   •  Cursor  support   •  Batching  for  mutaDons   •  Prepared  statements   •  Flexible  retry  policies   •  And  everything  else  in  CQL  ..  
  • 8. But  what  about  thrie    !!??   I’m  sDll  using  it.           Calm  down,  thrie  is  sDll  supported    J  
  • 9. Astyanax  can  use  both  drivers  
  • 10. Now  the  good  stuff!   What  about  performance?                If  you  use  prepared  statements,  you’re  good!  
  • 11. Reads        (about  2%)  
  • 12. Writes  (a  bit  more  5%-­‐10%)  
  • 13. Prepared  Statements  are  a  must  
  • 14. Prepared  Statements   •  There  is  no  magic  here   –  You  “prepare”   –  Then  you  re-­‐use  
  • 15. Astyanax  value  add     Structured  queries  naturally  have  some     query  signature              keyspace.prepareQuery( myCF ) .withRow( myRowKey ) .withColumnSlice( start, end) .execute(); Translates  to       select * from ks.myCF where key=? and column1 >=? and column1 <=?;
  • 16. Columns  v/s  Rows   •  Are  columns  really  columns?         •  Are  rows  sDll  rows?   •  Are  columns  really  rows?    
  • 17. Simple  schema     Key  validator  –  int   Col  comparator  –  int   Default  validator  –  u18  
  • 18. Rows  are  now  transposed  
  • 19. Astyanax  value  add   •  Astyanax  maintains  backwards  compaDbility   with  the  api   •  Hence  rows  are  sDll  rows  and  columns  are  sDll   columns  
  • 20. So  what  should  I  use?     •  Astyanax  has  recipes   •  Astyanax  is  good  for  structured  queries   •  If  all  you  want  is  CQL3,  then  use  Java  Driver  
  • 21. QuesDons?