SlideShare a Scribd company logo
Introduction to Apache Cassandra and support within WSO2 Platform Srinath Perera WSO2 Inc.
Cassandra within the WSO2 Platform We support Apache Cassandra within WSO2 Platform This is to provide NoSQL data support within the platform Cassandra can be used for both Column family or Key-value pair usecases.  Fully integrated with the Platform We will discuss what this means.
What is Cassandra?  Apache Cassandra http://cassandra.apache.org/ NoSQL column family implementation (more about it later) Highly scalable, available and no Single Point of Failure. Very high write throughput and good read throughput. It is pretty fast.  SQL like query language (from 0.8) and support search through secondary indexes (well no JOINs, Group By etc. ..).  Tunable consistency and support replication Flexible Schema
Column Family Data Model Column – name, value, and a timestamp (ignore this for now). Column is bit of a misnomer, may be they should have called it a named cell.  E.g. author=“Asimov” .  Row – row is a collection of Columns with a name. entries are sorted by the column names. You can do a slice and get some of the columns only.  E.g. “Second Foundation”->{author=“Asmiov”, publishedDate=“..”, 	tag=“sci-fi”, tag2=“asimov”	} Column family – Collection of rows, usually no sort order among rows*.  Books->{ 	 “Foundation”->{author=“Asmiov”, publishedDate=“..”}, “Second Foundation”->{author=“Asmiov”, publishedDate=“..”}, ….. } There are other stuff, but these are the key.
Column Family Data Model (Contd.) It is crucial to understand that Cassandra Columns are very different from RDBMS Columns.  Columns are only applied within a given row, different row may have different columns.  You can have thousands to millions of column for a row (2 million max, and a row should fit in one node). Column names may represent data, not just metadata like with RDBMS.  You will understand more with the example.
OK?? How can I do something useful withthis?
Example: Book Rating Site Let us take a Book rating site as an example. Users add books, comment them and tag them.  Can Add books (author, rank, price, link) Can add Comments for books (text, time, name) Can add tags for books Need to list books sorted by rank Need to list books by tag  Need to list comments for a book
Relational Approach Schema  Books(bookid, author, rank, price, link)  Comments->(id, text, user, time, bookid)  Tags(id, bookid, tag) Queries  Select * from Books orderby rank; Select text, time, user from Comments where bookid=? Orderby time Select tag from Tags where bookid=? Select bookid from Tags where tag=“” Select distinct author from Tags, Books where Tags.bookid=Books.bookidand  tag=?
Cassandra Approach Schema Books[BookID->(author, rank, price, link, tag1, tag2 ..) ]  Tags2Books[TagID->(timestamp1=bookID1, timestamp2=bookID2, ..) ]  Tags2Authors[TagID->(timestamp1=bookID1, timestamp2=bookID2, ..) ] Comments[BookID-> (timestamp1= text + “-” +  author …)] Ranks[“RANK” -> (rank=bookID)]  Example data snapshot
Potential Solution [Contd.] Handling Queries
Some Queries You Can Not Do Above setup can do some queries it designed for.  It can not queries it can not designed for For example, it can not do following Select * from Books where price > 50;  Select * from Books where author=“Asimov” Select * from Books, Comments where rank> 9 && Comments.bookid=Books.bookid; Well it can, but by writing code to walk through. It is like supporting search by going through all the data.  This is a limitation, specially when queries are provided at the runtime.
A Sample Program Cluster cluster = HFactory.createCluster("TestCluster", 			    new CassandraHostConfigurator("localhost:9160”)); Keyspacekeyspace = HFactory.createKeyspace(keyspaceName, cluster); Mutator<String> mutator = HFactory.createMutator(keyspace, sser); mutator.insert(“wso2”, columnFamily,  HFactory.createStringColumn("address", ”4131 El Camino Real Suite 200, Palo Alto, CA 94306")); ColumnQuery<String, String, String> columnQuery = HFactory.createStringColumnQuery(keyspace); columnQuery.setColumnFamily(columnFamily).setKey(”wso2”).setName("address"); QueryResult<HColumn<String, String>> result = columnQuery.execute(); System.out.println("received "+ result.get().getName() + "= "  + result.get().getValue() + " ts = "+ result.get().getClock());
Cassandra: How does it work? Nodes are arranged in a circle according to a key space(P2P networkand uses consistent hashing).  Each node owns the next clockwise address space. If replicated, each node owns next two clockwise address spaces.  Any node can accept any request and route it to the correct node.
Cassandra: How does it work? (Contd.) Writes are written to enough nodes, and Cassandra repairs data while reading. (As you would guess, that is how writes are fast.) Data is updated in the memory, and it keeps an append only commit log to recover from failures. (This avoid rotational latency at the disk). Can do about 80-360MB/sec per node.  When ever a read happens, Cassandra will sync all the nodes having replicas (read repair).
All these are great, but what is the catch? Do not get me wrong, Cassandra is a great tool, but you have to know where it does not work.
Surprises if you are using Cassandra No transactions, no JOINs. Hope there is no surprise here.  No foreign keys, and keys are immutable. (well no JOINs, and use surrogate keys if you need to change keys) Keys has to be unique (use composite keys) Super Columns and order preserving partitioner are discouraged. Searching is complicated  No Search coming from the core. Secondary indexes are layered on top, and they do not do range search or pattern search.   When secondary indexes does not work, have to learn the data model and build your indexes using sort orders and slices.  Sort orders are complicated Column are always sorted by name, but row order depends on the partitioner. Sort orders are crucial when you build your own indexes.
Surprises if you are using Cassandra (Cont.) Failed Operations may  leave changes  If operation is successful, all is well If it failed, actually changes may have been applied. But operations are idempotent, so you can retry until successful.  Batch operations are not atomic, but you can retry until successful (as operations are idempotent).  If a node fails, Cassandra does not figure it out and do a self healing. Assuming you have replicas, things will continue to work. But the whole system recovers only when a manual recover operation is done.  It remembers deletes  When we delete a data item, a node may be down at the time and may come back after the delete is done. To avoid this, Cassandra mark the as deleted (Tombstones) but does not delete this until configurable timeout or a repair. Space is actually freed up only then.
Cassandra within WSO2 Platform
Cassandra within the WSO2 Platform As a part of WSO2 data solutions  Because one storage cannot handle all cases Specifically for applications that need to scale. For applications that can work with a single DB, we have “Database as a Service” Two offerings Provide Cassandra as a Service Provide Cassandra within Carbon as a standalone product (integrated with WSO2 security model)
Apache Cassandra as a Service Users can log in to the  Web Console (both in Stratos and in WSO Data Server) and create Cassandra key spaces.
Apache Cassandra as a Service (Contd.)  Key spaces  will be allocated from a Cassandra cluster they are isolated from other tenants in Stratos it is integrated with WSO2 Security model.  Users can manage and share his key spaces through Stratos Web Console and use those key spaces through Hector Client (Java Client for Cassandra) In essence we provide  Cassandra as a part of Stratos as a Service Multi-tenancy support Security integration with WSO2 security model
A sample Program Map<String, String> credentials = new HashMap<String, String>(); credentials.put(USERNAME_KEY, "admin@srinath.org"); credentials.put(PASSWORD_KEY, "admin1234"); Cluster cluster = HFactory.createCluster("TestCluster", 			    new CassandraHostConfigurator("localhost:9160”, credentials)); Keyspacekeyspace = HFactory.createKeyspace(keyspaceName, cluster); Mutator<String> mutator = HFactory.createMutator(keyspace, sser); mutator.insert(“wso2”, columnFamily,  HFactory.createStringColumn("address", ”4131 El Camino Real Suite 200, Palo Alto, CA 94306")); ColumnQuery<String, String, String> columnQuery = HFactory.createStringColumnQuery(keyspace); columnQuery.setColumnFamily(columnFamily).setKey(”wso2”).setName("address"); QueryResult<HColumn<String, String>> result = columnQuery.execute(); System.out.println("received "+ result.get().getName() + "= "  	+ result.get().getValue() + " ts = "+ result.get().getClock());
Implementation
Implementation (Contd.)  Cassandra includes a plug point to add support for different security models at the server (Authentication and authorization for server).  We do security integration and support isolation among tenants (multi-tenancy) by writing new implementation of this plug point. Also we provide a Web console to manage Cassandra Key spaces.  Cassandra is highly scalable and highly available, so no work needed at that department.
Cassandra within Carbon Platform Users may choose to run Carbon enabled Cassandra also in two other alternative settings.  Running whole Stratos within a private Cloud Gets full support for the Multi-tenancy and other cloud benefits   Let user run it in his own controlled environment  Running a standalone Cassandra node (without Multi-tenancy) Get seamless integration with WSO2 Security model  Use the Configuration Console for Cassandra
Demo
Summary We discuss what Cassandra is, its strength, weaknesses, and Column Family Data Model.  Has a data model very different from relational style  Need users to rethink their data model There is a complexity at design, which is a tradeoff for achieving higher scalability.  Of course, Cassandra is not the solution for everything. It should be used when it make sense based on the usecase.   We discuss Cassandra integration to WSO2 platform  Carbon  integration – how to run Cassandra that is integrated with WSO2 Carbon platform security model.  Cassandra as a Service – how to use Cassandra as a Service from WSO2 Stratos Platform as a Service offering.
References Apache Cassandra  http://cassandra.apache.org Understanding Column family Model - http://arin.me/blog/wtf-is-a-supercolumn-cassandra-data-model Hector Client  http://github.com/rantav/hector http://prettyprint.me/2010/08/06/hector-api-v2/  Some Theory Malae, N., Cassandra--A Decentralized Structured Storage System Chang, F. and Dean, J. and Ghemawat, S. and Hsieh, W.C. and Wallach, D.A. and Burrows, M. and Chandra, T. and Fikes, A. and Gruber, R.E., Bigtable: A distributed storage system for structured data, ACM Transactions on Computer Systems (TOCS), 2008
Questions?

More Related Content

What's hot

Cassandra, Modeling and Availability at AMUG
Cassandra, Modeling and Availability at AMUGCassandra, Modeling and Availability at AMUG
Cassandra, Modeling and Availability at AMUG
Matthew Dennis
 
Oak Lucene Indexes
Oak Lucene IndexesOak Lucene Indexes
Oak Lucene Indexes
Chetan Mehrotra
 
Getting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NETGetting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NET
Tomas Jansson
 
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
 
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
 
ElasticSearch for .NET Developers
ElasticSearch for .NET DevelopersElasticSearch for .NET Developers
ElasticSearch for .NET Developers
Ben van Mol
 
Using Spark to Load Oracle Data into Cassandra
Using Spark to Load Oracle Data into CassandraUsing Spark to Load Oracle Data into Cassandra
Using Spark to Load Oracle Data into Cassandra
Jim Hatcher
 
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
 
Apache Cassandra Lesson: Data Modelling and CQL3
Apache Cassandra Lesson: Data Modelling and CQL3Apache Cassandra Lesson: Data Modelling and CQL3
Apache Cassandra Lesson: Data Modelling and CQL3
Markus Klems
 
Omnisearch in AEM 6.2 - Search All the Things
Omnisearch in AEM 6.2 - Search All the ThingsOmnisearch in AEM 6.2 - Search All the Things
Omnisearch in AEM 6.2 - Search All the Things
Justin Edelson
 
10gen Presents Schema Design and Data Modeling
10gen Presents Schema Design and Data Modeling10gen Presents Schema Design and Data Modeling
10gen Presents Schema Design and Data ModelingDATAVERSITY
 
CQL performance with Apache Cassandra 3.0 (Aaron Morton, The Last Pickle) | C...
CQL performance with Apache Cassandra 3.0 (Aaron Morton, The Last Pickle) | C...CQL performance with Apache Cassandra 3.0 (Aaron Morton, The Last Pickle) | C...
CQL performance with Apache Cassandra 3.0 (Aaron Morton, The Last Pickle) | C...
DataStax
 
Storing tree structures with MongoDB
Storing tree structures with MongoDBStoring tree structures with MongoDB
Storing tree structures with MongoDB
Vyacheslav
 
Reducing Development Time with MongoDB vs. SQL
Reducing Development Time with MongoDB vs. SQLReducing Development Time with MongoDB vs. SQL
Reducing Development Time with MongoDB vs. SQL
MongoDB
 
Indexing and Query Optimization
Indexing and Query OptimizationIndexing and Query Optimization
Indexing and Query OptimizationMongoDB
 
Search Evolution - Von Lucene zu Solr und ElasticSearch
Search Evolution - Von Lucene zu Solr und ElasticSearchSearch Evolution - Von Lucene zu Solr und ElasticSearch
Search Evolution - Von Lucene zu Solr und ElasticSearch
Florian Hopf
 
130919 jim cordy - when is a clone not a clone
130919   jim cordy - when is a clone not a clone130919   jim cordy - when is a clone not a clone
130919 jim cordy - when is a clone not a clone
Ptidej Team
 
Learn Ajax here
Learn Ajax hereLearn Ajax here
Learn Ajax here
jarnail
 
The State of NoSQL
The State of NoSQLThe State of NoSQL
The State of NoSQL
Ben Scofield
 
CQL3 in depth
CQL3 in depthCQL3 in depth
CQL3 in depth
Yuki Morishita
 

What's hot (20)

Cassandra, Modeling and Availability at AMUG
Cassandra, Modeling and Availability at AMUGCassandra, Modeling and Availability at AMUG
Cassandra, Modeling and Availability at AMUG
 
Oak Lucene Indexes
Oak Lucene IndexesOak Lucene Indexes
Oak Lucene Indexes
 
Getting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NETGetting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NET
 
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
 
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
 
ElasticSearch for .NET Developers
ElasticSearch for .NET DevelopersElasticSearch for .NET Developers
ElasticSearch for .NET Developers
 
Using Spark to Load Oracle Data into Cassandra
Using Spark to Load Oracle Data into CassandraUsing Spark to Load Oracle Data into Cassandra
Using Spark to Load Oracle Data into Cassandra
 
Manchester Hadoop Meetup: Spark Cassandra Integration
Manchester Hadoop Meetup: Spark Cassandra IntegrationManchester Hadoop Meetup: Spark Cassandra Integration
Manchester Hadoop Meetup: Spark Cassandra Integration
 
Apache Cassandra Lesson: Data Modelling and CQL3
Apache Cassandra Lesson: Data Modelling and CQL3Apache Cassandra Lesson: Data Modelling and CQL3
Apache Cassandra Lesson: Data Modelling and CQL3
 
Omnisearch in AEM 6.2 - Search All the Things
Omnisearch in AEM 6.2 - Search All the ThingsOmnisearch in AEM 6.2 - Search All the Things
Omnisearch in AEM 6.2 - Search All the Things
 
10gen Presents Schema Design and Data Modeling
10gen Presents Schema Design and Data Modeling10gen Presents Schema Design and Data Modeling
10gen Presents Schema Design and Data Modeling
 
CQL performance with Apache Cassandra 3.0 (Aaron Morton, The Last Pickle) | C...
CQL performance with Apache Cassandra 3.0 (Aaron Morton, The Last Pickle) | C...CQL performance with Apache Cassandra 3.0 (Aaron Morton, The Last Pickle) | C...
CQL performance with Apache Cassandra 3.0 (Aaron Morton, The Last Pickle) | C...
 
Storing tree structures with MongoDB
Storing tree structures with MongoDBStoring tree structures with MongoDB
Storing tree structures with MongoDB
 
Reducing Development Time with MongoDB vs. SQL
Reducing Development Time with MongoDB vs. SQLReducing Development Time with MongoDB vs. SQL
Reducing Development Time with MongoDB vs. SQL
 
Indexing and Query Optimization
Indexing and Query OptimizationIndexing and Query Optimization
Indexing and Query Optimization
 
Search Evolution - Von Lucene zu Solr und ElasticSearch
Search Evolution - Von Lucene zu Solr und ElasticSearchSearch Evolution - Von Lucene zu Solr und ElasticSearch
Search Evolution - Von Lucene zu Solr und ElasticSearch
 
130919 jim cordy - when is a clone not a clone
130919   jim cordy - when is a clone not a clone130919   jim cordy - when is a clone not a clone
130919 jim cordy - when is a clone not a clone
 
Learn Ajax here
Learn Ajax hereLearn Ajax here
Learn Ajax here
 
The State of NoSQL
The State of NoSQLThe State of NoSQL
The State of NoSQL
 
CQL3 in depth
CQL3 in depthCQL3 in depth
CQL3 in depth
 

Similar to Introduction to Apache Cassandra and support within WSO2 Platform

Learning Cassandra NoSQL
Learning Cassandra NoSQLLearning Cassandra NoSQL
Learning Cassandra NoSQL
Pankaj Khattar
 
White paper on cassandra
White paper on cassandraWhite paper on cassandra
White paper on cassandra
Navanit Katiyar
 
Storage cassandra
Storage   cassandraStorage   cassandra
Storage cassandraPL dream
 
Introduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhgIntroduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhgzznate
 
Cassandra Tutorial | Data types | Why Cassandra for Big Data
 Cassandra Tutorial | Data types | Why Cassandra for Big Data Cassandra Tutorial | Data types | Why Cassandra for Big Data
Cassandra Tutorial | Data types | Why Cassandra for Big Data
vinayiqbusiness
 
Hadoop Integration in Cassandra
Hadoop Integration in CassandraHadoop Integration in Cassandra
Hadoop Integration in Cassandra
Jairam Chandar
 
NoSql Database
NoSql DatabaseNoSql Database
NoSql Database
Suresh Parmar
 
Compass Framework
Compass FrameworkCompass Framework
Compass Framework
Lukas Vlcek
 
Cassandra's Sweet Spot - an introduction to Apache Cassandra
Cassandra's Sweet Spot - an introduction to Apache CassandraCassandra's Sweet Spot - an introduction to Apache Cassandra
Cassandra's Sweet Spot - an introduction to Apache Cassandra
Dave Gardner
 
Scala with mongodb
Scala with mongodbScala with mongodb
Scala with mongodb
Knoldus Inc.
 
Database Performance Tuning
Database Performance Tuning Database Performance Tuning
Database Performance Tuning
Arno Huetter
 
NOSQL and Cassandra
NOSQL and CassandraNOSQL and Cassandra
NOSQL and Cassandrarantav
 
Cassandra implementation for collecting data and presenting data
Cassandra implementation for collecting data and presenting dataCassandra implementation for collecting data and presenting data
Cassandra implementation for collecting data and presenting data
Chen Robert
 
Perl and Elasticsearch
Perl and ElasticsearchPerl and Elasticsearch
Perl and Elasticsearch
Dean Hamstead
 
Apache Cassandra, part 1 – principles, data model
Apache Cassandra, part 1 – principles, data modelApache Cassandra, part 1 – principles, data model
Apache Cassandra, part 1 – principles, data model
Andrey Lomakin
 
Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)
zznate
 
Scaling opensimulator inventory using nosql
Scaling opensimulator inventory using nosqlScaling opensimulator inventory using nosql
Scaling opensimulator inventory using nosql
David Daeschler
 
Apache Cassandra 2.0
Apache Cassandra 2.0Apache Cassandra 2.0
Apache Cassandra 2.0
Joe Stein
 
Cassandra - A decentralized storage system
Cassandra - A decentralized storage systemCassandra - A decentralized storage system
Cassandra - A decentralized storage system
Arunit Gupta
 

Similar to Introduction to Apache Cassandra and support within WSO2 Platform (20)

Learning Cassandra NoSQL
Learning Cassandra NoSQLLearning Cassandra NoSQL
Learning Cassandra NoSQL
 
White paper on cassandra
White paper on cassandraWhite paper on cassandra
White paper on cassandra
 
Storage cassandra
Storage   cassandraStorage   cassandra
Storage cassandra
 
Introduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhgIntroduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhg
 
Cassandra Tutorial | Data types | Why Cassandra for Big Data
 Cassandra Tutorial | Data types | Why Cassandra for Big Data Cassandra Tutorial | Data types | Why Cassandra for Big Data
Cassandra Tutorial | Data types | Why Cassandra for Big Data
 
Hadoop Integration in Cassandra
Hadoop Integration in CassandraHadoop Integration in Cassandra
Hadoop Integration in Cassandra
 
NoSql Database
NoSql DatabaseNoSql Database
NoSql Database
 
Compass Framework
Compass FrameworkCompass Framework
Compass Framework
 
Cassandra's Sweet Spot - an introduction to Apache Cassandra
Cassandra's Sweet Spot - an introduction to Apache CassandraCassandra's Sweet Spot - an introduction to Apache Cassandra
Cassandra's Sweet Spot - an introduction to Apache Cassandra
 
Scala with mongodb
Scala with mongodbScala with mongodb
Scala with mongodb
 
Database Performance Tuning
Database Performance Tuning Database Performance Tuning
Database Performance Tuning
 
Scala with MongoDB
Scala with MongoDBScala with MongoDB
Scala with MongoDB
 
NOSQL and Cassandra
NOSQL and CassandraNOSQL and Cassandra
NOSQL and Cassandra
 
Cassandra implementation for collecting data and presenting data
Cassandra implementation for collecting data and presenting dataCassandra implementation for collecting data and presenting data
Cassandra implementation for collecting data and presenting data
 
Perl and Elasticsearch
Perl and ElasticsearchPerl and Elasticsearch
Perl and Elasticsearch
 
Apache Cassandra, part 1 – principles, data model
Apache Cassandra, part 1 – principles, data modelApache Cassandra, part 1 – principles, data model
Apache Cassandra, part 1 – principles, data model
 
Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)
 
Scaling opensimulator inventory using nosql
Scaling opensimulator inventory using nosqlScaling opensimulator inventory using nosql
Scaling opensimulator inventory using nosql
 
Apache Cassandra 2.0
Apache Cassandra 2.0Apache Cassandra 2.0
Apache Cassandra 2.0
 
Cassandra - A decentralized storage system
Cassandra - A decentralized storage systemCassandra - A decentralized storage system
Cassandra - A decentralized storage system
 

More from Srinath Perera

Book: Software Architecture and Decision-Making
Book: Software Architecture and Decision-MakingBook: Software Architecture and Decision-Making
Book: Software Architecture and Decision-Making
Srinath Perera
 
Data science Applications in the Enterprise
Data science Applications in the EnterpriseData science Applications in the Enterprise
Data science Applications in the Enterprise
Srinath Perera
 
An Introduction to APIs
An Introduction to APIs An Introduction to APIs
An Introduction to APIs
Srinath Perera
 
An Introduction to Blockchain for Finance Professionals
An Introduction to Blockchain for Finance ProfessionalsAn Introduction to Blockchain for Finance Professionals
An Introduction to Blockchain for Finance Professionals
Srinath Perera
 
AI in the Real World: Challenges, and Risks and how to handle them?
AI in the Real World: Challenges, and Risks and how to handle them?AI in the Real World: Challenges, and Risks and how to handle them?
AI in the Real World: Challenges, and Risks and how to handle them?
Srinath Perera
 
Healthcare + AI: Use cases & Challenges
Healthcare + AI: Use cases & ChallengesHealthcare + AI: Use cases & Challenges
Healthcare + AI: Use cases & Challenges
Srinath Perera
 
How would AI shape Future Integrations?
How would AI shape Future Integrations?How would AI shape Future Integrations?
How would AI shape Future Integrations?
Srinath Perera
 
The Role of Blockchain in Future Integrations
The Role of Blockchain in Future IntegrationsThe Role of Blockchain in Future Integrations
The Role of Blockchain in Future Integrations
Srinath Perera
 
Future of Serverless
Future of ServerlessFuture of Serverless
Future of Serverless
Srinath Perera
 
Blockchain: Where are we? Where are we going?
Blockchain: Where are we? Where are we going? Blockchain: Where are we? Where are we going?
Blockchain: Where are we? Where are we going?
Srinath Perera
 
Few thoughts about Future of Blockchain
Few thoughts about Future of BlockchainFew thoughts about Future of Blockchain
Few thoughts about Future of Blockchain
Srinath Perera
 
A Visual Canvas for Judging New Technologies
A Visual Canvas for Judging New TechnologiesA Visual Canvas for Judging New Technologies
A Visual Canvas for Judging New Technologies
Srinath Perera
 
Privacy in Bigdata Era
Privacy in Bigdata  EraPrivacy in Bigdata  Era
Privacy in Bigdata Era
Srinath Perera
 
Blockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and RisksBlockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and Risks
Srinath Perera
 
Today's Technology and Emerging Technology Landscape
Today's Technology and Emerging Technology LandscapeToday's Technology and Emerging Technology Landscape
Today's Technology and Emerging Technology Landscape
Srinath Perera
 
An Emerging Technologies Timeline
An Emerging Technologies TimelineAn Emerging Technologies Timeline
An Emerging Technologies Timeline
Srinath Perera
 
The Rise of Streaming SQL and Evolution of Streaming Applications
The Rise of Streaming SQL and Evolution of Streaming ApplicationsThe Rise of Streaming SQL and Evolution of Streaming Applications
The Rise of Streaming SQL and Evolution of Streaming Applications
Srinath Perera
 
Analytics and AI: The Good, the Bad and the Ugly
Analytics and AI: The Good, the Bad and the UglyAnalytics and AI: The Good, the Bad and the Ugly
Analytics and AI: The Good, the Bad and the Ugly
Srinath Perera
 
Transforming a Business Through Analytics
Transforming a Business Through AnalyticsTransforming a Business Through Analytics
Transforming a Business Through Analytics
Srinath Perera
 
SoC Keynote:The State of the Art in Integration Technology
SoC Keynote:The State of the Art in Integration TechnologySoC Keynote:The State of the Art in Integration Technology
SoC Keynote:The State of the Art in Integration Technology
Srinath Perera
 

More from Srinath Perera (20)

Book: Software Architecture and Decision-Making
Book: Software Architecture and Decision-MakingBook: Software Architecture and Decision-Making
Book: Software Architecture and Decision-Making
 
Data science Applications in the Enterprise
Data science Applications in the EnterpriseData science Applications in the Enterprise
Data science Applications in the Enterprise
 
An Introduction to APIs
An Introduction to APIs An Introduction to APIs
An Introduction to APIs
 
An Introduction to Blockchain for Finance Professionals
An Introduction to Blockchain for Finance ProfessionalsAn Introduction to Blockchain for Finance Professionals
An Introduction to Blockchain for Finance Professionals
 
AI in the Real World: Challenges, and Risks and how to handle them?
AI in the Real World: Challenges, and Risks and how to handle them?AI in the Real World: Challenges, and Risks and how to handle them?
AI in the Real World: Challenges, and Risks and how to handle them?
 
Healthcare + AI: Use cases & Challenges
Healthcare + AI: Use cases & ChallengesHealthcare + AI: Use cases & Challenges
Healthcare + AI: Use cases & Challenges
 
How would AI shape Future Integrations?
How would AI shape Future Integrations?How would AI shape Future Integrations?
How would AI shape Future Integrations?
 
The Role of Blockchain in Future Integrations
The Role of Blockchain in Future IntegrationsThe Role of Blockchain in Future Integrations
The Role of Blockchain in Future Integrations
 
Future of Serverless
Future of ServerlessFuture of Serverless
Future of Serverless
 
Blockchain: Where are we? Where are we going?
Blockchain: Where are we? Where are we going? Blockchain: Where are we? Where are we going?
Blockchain: Where are we? Where are we going?
 
Few thoughts about Future of Blockchain
Few thoughts about Future of BlockchainFew thoughts about Future of Blockchain
Few thoughts about Future of Blockchain
 
A Visual Canvas for Judging New Technologies
A Visual Canvas for Judging New TechnologiesA Visual Canvas for Judging New Technologies
A Visual Canvas for Judging New Technologies
 
Privacy in Bigdata Era
Privacy in Bigdata  EraPrivacy in Bigdata  Era
Privacy in Bigdata Era
 
Blockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and RisksBlockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and Risks
 
Today's Technology and Emerging Technology Landscape
Today's Technology and Emerging Technology LandscapeToday's Technology and Emerging Technology Landscape
Today's Technology and Emerging Technology Landscape
 
An Emerging Technologies Timeline
An Emerging Technologies TimelineAn Emerging Technologies Timeline
An Emerging Technologies Timeline
 
The Rise of Streaming SQL and Evolution of Streaming Applications
The Rise of Streaming SQL and Evolution of Streaming ApplicationsThe Rise of Streaming SQL and Evolution of Streaming Applications
The Rise of Streaming SQL and Evolution of Streaming Applications
 
Analytics and AI: The Good, the Bad and the Ugly
Analytics and AI: The Good, the Bad and the UglyAnalytics and AI: The Good, the Bad and the Ugly
Analytics and AI: The Good, the Bad and the Ugly
 
Transforming a Business Through Analytics
Transforming a Business Through AnalyticsTransforming a Business Through Analytics
Transforming a Business Through Analytics
 
SoC Keynote:The State of the Art in Integration Technology
SoC Keynote:The State of the Art in Integration TechnologySoC Keynote:The State of the Art in Integration Technology
SoC Keynote:The State of the Art in Integration Technology
 

Recently uploaded

How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 

Recently uploaded (20)

How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 

Introduction to Apache Cassandra and support within WSO2 Platform

  • 1. Introduction to Apache Cassandra and support within WSO2 Platform Srinath Perera WSO2 Inc.
  • 2. Cassandra within the WSO2 Platform We support Apache Cassandra within WSO2 Platform This is to provide NoSQL data support within the platform Cassandra can be used for both Column family or Key-value pair usecases. Fully integrated with the Platform We will discuss what this means.
  • 3. What is Cassandra? Apache Cassandra http://cassandra.apache.org/ NoSQL column family implementation (more about it later) Highly scalable, available and no Single Point of Failure. Very high write throughput and good read throughput. It is pretty fast. SQL like query language (from 0.8) and support search through secondary indexes (well no JOINs, Group By etc. ..). Tunable consistency and support replication Flexible Schema
  • 4. Column Family Data Model Column – name, value, and a timestamp (ignore this for now). Column is bit of a misnomer, may be they should have called it a named cell. E.g. author=“Asimov” . Row – row is a collection of Columns with a name. entries are sorted by the column names. You can do a slice and get some of the columns only. E.g. “Second Foundation”->{author=“Asmiov”, publishedDate=“..”, tag=“sci-fi”, tag2=“asimov” } Column family – Collection of rows, usually no sort order among rows*. Books->{ “Foundation”->{author=“Asmiov”, publishedDate=“..”}, “Second Foundation”->{author=“Asmiov”, publishedDate=“..”}, ….. } There are other stuff, but these are the key.
  • 5. Column Family Data Model (Contd.) It is crucial to understand that Cassandra Columns are very different from RDBMS Columns. Columns are only applied within a given row, different row may have different columns. You can have thousands to millions of column for a row (2 million max, and a row should fit in one node). Column names may represent data, not just metadata like with RDBMS. You will understand more with the example.
  • 6. OK?? How can I do something useful withthis?
  • 7. Example: Book Rating Site Let us take a Book rating site as an example. Users add books, comment them and tag them. Can Add books (author, rank, price, link) Can add Comments for books (text, time, name) Can add tags for books Need to list books sorted by rank Need to list books by tag Need to list comments for a book
  • 8. Relational Approach Schema Books(bookid, author, rank, price, link) Comments->(id, text, user, time, bookid) Tags(id, bookid, tag) Queries Select * from Books orderby rank; Select text, time, user from Comments where bookid=? Orderby time Select tag from Tags where bookid=? Select bookid from Tags where tag=“” Select distinct author from Tags, Books where Tags.bookid=Books.bookidand tag=?
  • 9. Cassandra Approach Schema Books[BookID->(author, rank, price, link, tag1, tag2 ..) ] Tags2Books[TagID->(timestamp1=bookID1, timestamp2=bookID2, ..) ] Tags2Authors[TagID->(timestamp1=bookID1, timestamp2=bookID2, ..) ] Comments[BookID-> (timestamp1= text + “-” + author …)] Ranks[“RANK” -> (rank=bookID)] Example data snapshot
  • 10. Potential Solution [Contd.] Handling Queries
  • 11. Some Queries You Can Not Do Above setup can do some queries it designed for. It can not queries it can not designed for For example, it can not do following Select * from Books where price > 50; Select * from Books where author=“Asimov” Select * from Books, Comments where rank> 9 && Comments.bookid=Books.bookid; Well it can, but by writing code to walk through. It is like supporting search by going through all the data. This is a limitation, specially when queries are provided at the runtime.
  • 12. A Sample Program Cluster cluster = HFactory.createCluster("TestCluster", new CassandraHostConfigurator("localhost:9160”)); Keyspacekeyspace = HFactory.createKeyspace(keyspaceName, cluster); Mutator<String> mutator = HFactory.createMutator(keyspace, sser); mutator.insert(“wso2”, columnFamily, HFactory.createStringColumn("address", ”4131 El Camino Real Suite 200, Palo Alto, CA 94306")); ColumnQuery<String, String, String> columnQuery = HFactory.createStringColumnQuery(keyspace); columnQuery.setColumnFamily(columnFamily).setKey(”wso2”).setName("address"); QueryResult<HColumn<String, String>> result = columnQuery.execute(); System.out.println("received "+ result.get().getName() + "= " + result.get().getValue() + " ts = "+ result.get().getClock());
  • 13. Cassandra: How does it work? Nodes are arranged in a circle according to a key space(P2P networkand uses consistent hashing). Each node owns the next clockwise address space. If replicated, each node owns next two clockwise address spaces. Any node can accept any request and route it to the correct node.
  • 14. Cassandra: How does it work? (Contd.) Writes are written to enough nodes, and Cassandra repairs data while reading. (As you would guess, that is how writes are fast.) Data is updated in the memory, and it keeps an append only commit log to recover from failures. (This avoid rotational latency at the disk). Can do about 80-360MB/sec per node. When ever a read happens, Cassandra will sync all the nodes having replicas (read repair).
  • 15. All these are great, but what is the catch? Do not get me wrong, Cassandra is a great tool, but you have to know where it does not work.
  • 16. Surprises if you are using Cassandra No transactions, no JOINs. Hope there is no surprise here. No foreign keys, and keys are immutable. (well no JOINs, and use surrogate keys if you need to change keys) Keys has to be unique (use composite keys) Super Columns and order preserving partitioner are discouraged. Searching is complicated No Search coming from the core. Secondary indexes are layered on top, and they do not do range search or pattern search. When secondary indexes does not work, have to learn the data model and build your indexes using sort orders and slices. Sort orders are complicated Column are always sorted by name, but row order depends on the partitioner. Sort orders are crucial when you build your own indexes.
  • 17. Surprises if you are using Cassandra (Cont.) Failed Operations may leave changes If operation is successful, all is well If it failed, actually changes may have been applied. But operations are idempotent, so you can retry until successful. Batch operations are not atomic, but you can retry until successful (as operations are idempotent). If a node fails, Cassandra does not figure it out and do a self healing. Assuming you have replicas, things will continue to work. But the whole system recovers only when a manual recover operation is done. It remembers deletes When we delete a data item, a node may be down at the time and may come back after the delete is done. To avoid this, Cassandra mark the as deleted (Tombstones) but does not delete this until configurable timeout or a repair. Space is actually freed up only then.
  • 19. Cassandra within the WSO2 Platform As a part of WSO2 data solutions Because one storage cannot handle all cases Specifically for applications that need to scale. For applications that can work with a single DB, we have “Database as a Service” Two offerings Provide Cassandra as a Service Provide Cassandra within Carbon as a standalone product (integrated with WSO2 security model)
  • 20. Apache Cassandra as a Service Users can log in to the Web Console (both in Stratos and in WSO Data Server) and create Cassandra key spaces.
  • 21. Apache Cassandra as a Service (Contd.) Key spaces will be allocated from a Cassandra cluster they are isolated from other tenants in Stratos it is integrated with WSO2 Security model. Users can manage and share his key spaces through Stratos Web Console and use those key spaces through Hector Client (Java Client for Cassandra) In essence we provide Cassandra as a part of Stratos as a Service Multi-tenancy support Security integration with WSO2 security model
  • 22. A sample Program Map<String, String> credentials = new HashMap<String, String>(); credentials.put(USERNAME_KEY, "admin@srinath.org"); credentials.put(PASSWORD_KEY, "admin1234"); Cluster cluster = HFactory.createCluster("TestCluster", new CassandraHostConfigurator("localhost:9160”, credentials)); Keyspacekeyspace = HFactory.createKeyspace(keyspaceName, cluster); Mutator<String> mutator = HFactory.createMutator(keyspace, sser); mutator.insert(“wso2”, columnFamily, HFactory.createStringColumn("address", ”4131 El Camino Real Suite 200, Palo Alto, CA 94306")); ColumnQuery<String, String, String> columnQuery = HFactory.createStringColumnQuery(keyspace); columnQuery.setColumnFamily(columnFamily).setKey(”wso2”).setName("address"); QueryResult<HColumn<String, String>> result = columnQuery.execute(); System.out.println("received "+ result.get().getName() + "= " + result.get().getValue() + " ts = "+ result.get().getClock());
  • 24. Implementation (Contd.) Cassandra includes a plug point to add support for different security models at the server (Authentication and authorization for server). We do security integration and support isolation among tenants (multi-tenancy) by writing new implementation of this plug point. Also we provide a Web console to manage Cassandra Key spaces. Cassandra is highly scalable and highly available, so no work needed at that department.
  • 25. Cassandra within Carbon Platform Users may choose to run Carbon enabled Cassandra also in two other alternative settings. Running whole Stratos within a private Cloud Gets full support for the Multi-tenancy and other cloud benefits Let user run it in his own controlled environment Running a standalone Cassandra node (without Multi-tenancy) Get seamless integration with WSO2 Security model Use the Configuration Console for Cassandra
  • 26. Demo
  • 27. Summary We discuss what Cassandra is, its strength, weaknesses, and Column Family Data Model. Has a data model very different from relational style Need users to rethink their data model There is a complexity at design, which is a tradeoff for achieving higher scalability. Of course, Cassandra is not the solution for everything. It should be used when it make sense based on the usecase. We discuss Cassandra integration to WSO2 platform Carbon integration – how to run Cassandra that is integrated with WSO2 Carbon platform security model. Cassandra as a Service – how to use Cassandra as a Service from WSO2 Stratos Platform as a Service offering.
  • 28. References Apache Cassandra http://cassandra.apache.org Understanding Column family Model - http://arin.me/blog/wtf-is-a-supercolumn-cassandra-data-model Hector Client http://github.com/rantav/hector http://prettyprint.me/2010/08/06/hector-api-v2/ Some Theory Malae, N., Cassandra--A Decentralized Structured Storage System Chang, F. and Dean, J. and Ghemawat, S. and Hsieh, W.C. and Wallach, D.A. and Burrows, M. and Chandra, T. and Fikes, A. and Gruber, R.E., Bigtable: A distributed storage system for structured data, ACM Transactions on Computer Systems (TOCS), 2008