Your SlideShare is downloading. ×
0
Astyanax	
  
Puneet	
  Oberai	
  
Ne1lix,	
  Inc.	
  
h8ps://github.com/Ne1lix/astyanax	
  
	
  
Useful	
  features	
  
–  Load	
  balancing	
  
–  ConnecDon	
  pooling	
  -­‐	
  resilient	
  with	
  failover	
  and	
  ...
Fluent	
  query	
  syntax	
  
ColumnList<Integer>	
  	
  =	
  	
  
	
  keyspace	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
...
Recipes	
  
•  All	
  Rows	
  Reader	
  
•  Distributed	
  Row	
  Lock	
  
•  Queue	
  
•  Chunked	
  Object	
  Store	
  
How	
  does	
  Ne1lix	
  use	
  it	
  
Java	
  Driver	
  release	
  in	
  2013	
  
•  Async	
  interface!	
  
•  Cursor	
  support	
  
•  Batching	
  for	
  muta...
But	
  what	
  about	
  thrie	
  	
  !!??	
  
I’m	
  sDll	
  using	
  it.	
  	
  	
  
	
  
	
  
Calm	
  down,	
  thrie	
  ...
Astyanax	
  can	
  use	
  both	
  drivers	
  
Now	
  the	
  good	
  stuff!	
  
What	
  about	
  performance?	
  	
  
	
  	
  	
  	
  	
  	
  If	
  you	
  use	
  prepared...
Reads	
  	
  	
  	
  (about	
  2%)	
  
Writes	
  (a	
  bit	
  more	
  5%-­‐10%)	
  
Prepared	
  Statements	
  are	
  a	
  must	
  
Prepared	
  Statements	
  
•  There	
  is	
  no	
  magic	
  here	
  
–  You	
  “prepare”	
  
–  Then	
  you	
  re-­‐use	
  
Astyanax	
  value	
  add	
  
	
  
Structured	
  queries	
  naturally	
  have	
  some	
  	
  
query	
  signature	
  
	
  	
...
Columns	
  v/s	
  Rows	
  
•  Are	
  columns	
  really	
  columns?	
  	
  	
  	
  
•  Are	
  rows	
  sDll	
  rows?	
  
•  ...
Simple	
  schema	
  
	
  
Key	
  validator	
  –	
  int	
  
Col	
  comparator	
  –	
  int	
  
Default	
  validator	
  –	
  ...
Rows	
  are	
  now	
  transposed	
  
Astyanax	
  value	
  add	
  
•  Astyanax	
  maintains	
  backwards	
  compaDbility	
  
with	
  the	
  api	
  
•  Hence	
  ...
So	
  what	
  should	
  I	
  use?	
  	
  
•  Astyanax	
  has	
  recipes	
  
•  Astyanax	
  is	
  good	
  for	
  structured...
QuesDons?	
  
Upcoming SlideShare
Loading in...5
×

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

1,225

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 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,225
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
11
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

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

  1. 1. Astyanax   Puneet  Oberai   Ne1lix,  Inc.  
  2. 2. h8ps://github.com/Ne1lix/astyanax    
  3. 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. 4. Fluent  query  syntax   ColumnList<Integer>    =      keyspace                          .readQuery(  “myCF”  )      .getRow(  “A”  )      .withColumnSlice(  new  RangeBuilder()                  .greaterThan(11)                  .lessThanEquals(18)                  .build())      .execute()      .getResult();  
  5. 5. Recipes   •  All  Rows  Reader   •  Distributed  Row  Lock   •  Queue   •  Chunked  Object  Store  
  6. 6. How  does  Ne1lix  use  it  
  7. 7. Java  Driver  release  in  2013   •  Async  interface!   •  Cursor  support   •  Batching  for  mutaDons   •  Prepared  statements   •  Flexible  retry  policies   •  And  everything  else  in  CQL  ..  
  8. 8. But  what  about  thrie    !!??   I’m  sDll  using  it.           Calm  down,  thrie  is  sDll  supported    J  
  9. 9. Astyanax  can  use  both  drivers  
  10. 10. Now  the  good  stuff!   What  about  performance?                If  you  use  prepared  statements,  you’re  good!  
  11. 11. Reads        (about  2%)  
  12. 12. Writes  (a  bit  more  5%-­‐10%)  
  13. 13. Prepared  Statements  are  a  must  
  14. 14. Prepared  Statements   •  There  is  no  magic  here   –  You  “prepare”   –  Then  you  re-­‐use  
  15. 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. 16. Columns  v/s  Rows   •  Are  columns  really  columns?         •  Are  rows  sDll  rows?   •  Are  columns  really  rows?    
  17. 17. Simple  schema     Key  validator  –  int   Col  comparator  –  int   Default  validator  –  u18  
  18. 18. Rows  are  now  transposed  
  19. 19. Astyanax  value  add   •  Astyanax  maintains  backwards  compaDbility   with  the  api   •  Hence  rows  are  sDll  rows  and  columns  are  sDll   columns  
  20. 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. 21. QuesDons?  
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×