SlideShare uma empresa Scribd logo
1 de 29
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?

Mais conteúdo relacionado

Mais procurados

Cassandra, Modeling and Availability at AMUG
Cassandra, Modeling and Availability at AMUGCassandra, Modeling and Availability at AMUG
Cassandra, Modeling and Availability at AMUGMatthew Dennis
 
Getting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NETGetting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NETTomas 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* developersChristopher 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 SparkChristopher Batey
 
ElasticSearch for .NET Developers
ElasticSearch for .NET DevelopersElasticSearch for .NET Developers
ElasticSearch for .NET DevelopersBen 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 CassandraJim Hatcher
 
Manchester Hadoop Meetup: Spark Cassandra Integration
Manchester Hadoop Meetup: Spark Cassandra IntegrationManchester Hadoop Meetup: Spark Cassandra Integration
Manchester Hadoop Meetup: Spark Cassandra IntegrationChristopher 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 CQL3Markus 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 ThingsJustin 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 MongoDBVyacheslav
 
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. SQLMongoDB
 
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 ElasticSearchFlorian 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 clonePtidej Team
 
Learn Ajax here
Learn Ajax hereLearn Ajax here
Learn Ajax herejarnail
 
The State of NoSQL
The State of NoSQLThe State of NoSQL
The State of NoSQLBen Scofield
 

Mais procurados (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
 

Semelhante a Introduction to Apache Cassandra Support in WSO2 Platform

Learning Cassandra NoSQL
Learning Cassandra NoSQLLearning Cassandra NoSQL
Learning Cassandra NoSQLPankaj Khattar
 
White paper on cassandra
White paper on cassandraWhite paper on cassandra
White paper on cassandraNavanit 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 Datavinayiqbusiness
 
Hadoop Integration in Cassandra
Hadoop Integration in CassandraHadoop Integration in Cassandra
Hadoop Integration in CassandraJairam Chandar
 
Compass Framework
Compass FrameworkCompass Framework
Compass FrameworkLukas 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 CassandraDave Gardner
 
Scala with mongodb
Scala with mongodbScala with mongodb
Scala with mongodbKnoldus 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 dataChen Robert
 
Perl and Elasticsearch
Perl and ElasticsearchPerl and Elasticsearch
Perl and ElasticsearchDean 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 modelAndrey 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 nosqlDavid Daeschler
 
Apache Cassandra 2.0
Apache Cassandra 2.0Apache Cassandra 2.0
Apache Cassandra 2.0Joe Stein
 
Cassandra - A decentralized storage system
Cassandra - A decentralized storage systemCassandra - A decentralized storage system
Cassandra - A decentralized storage systemArunit Gupta
 

Semelhante a Introduction to Apache Cassandra Support in 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
 

Mais de Srinath Perera

Book: Software Architecture and Decision-Making
Book: Software Architecture and Decision-MakingBook: Software Architecture and Decision-Making
Book: Software Architecture and Decision-MakingSrinath Perera
 
Data science Applications in the Enterprise
Data science Applications in the EnterpriseData science Applications in the Enterprise
Data science Applications in the EnterpriseSrinath 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 ProfessionalsSrinath 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 & ChallengesSrinath 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 IntegrationsSrinath 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 BlockchainSrinath 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 TechnologiesSrinath Perera
 
Privacy in Bigdata Era
Privacy in Bigdata  EraPrivacy in Bigdata  Era
Privacy in Bigdata EraSrinath Perera
 
Blockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and RisksBlockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and RisksSrinath 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 LandscapeSrinath Perera
 
An Emerging Technologies Timeline
An Emerging Technologies TimelineAn Emerging Technologies Timeline
An Emerging Technologies TimelineSrinath 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 ApplicationsSrinath 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 UglySrinath Perera
 
Transforming a Business Through Analytics
Transforming a Business Through AnalyticsTransforming a Business Through Analytics
Transforming a Business Through AnalyticsSrinath 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 TechnologySrinath Perera
 

Mais de 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
 

Último

HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 

Último (20)

HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 

Introduction to Apache Cassandra Support in 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