Apache Cassandra یک دیتابیس توضیع شده کاملاً Open source و رایگان است که قابلیت ذخیره اطلاعات بسیار زیادی را بر روی سرور های مختلف دارد و High availability بسیار بالایی را بدون داشتن Single point of failure ارایه می دهد.
The Apache Cassandra database is the right choice when you need scalability and high availability without compromising performance. Linear scalability and proven fault-tolerance on commodity hardware or cloud infrastructure make it the perfect platform for mission-critical data.Cassandra's support for replicating across multiple datacenters is best-in-class, providing lower latency for your users and the peace of mind of knowing that you can survive regional outages.
2. CASSANDRA NAME
A daughter of the Trojan king Priam, who was given the gift of prophecy by Apollo. When she cheated him,
however, he turned this into a curse by causing her prophecies, though true, to be disbelieved.
5. ACID GUARANTEE TRANSACTIONS ARE PROCESSED
• Atomic: Atomic means “all or nothing”
• Consistent: Consistent means that data moves from one correct state to another correct state
• Isolated: Isolated means that transactions executing concurrently will not become entangled with each
• other
• Durable: Once a transaction has succeeded, the changes will not be lost
6. INTRODUCTION
• Original authors: Avinash Lakshman, Prashant Malik
• Developer: Apache Software Foundation (Initially developed by Facebook to power their Inbox Search feature)
• Initial release: 2008
• Stable release: 3.4 / March 8,2016
• Written in: Java
• Type: Database / NoSQL
• License: Apache License 2.0 (permissive free software license)
Apache Cassandra is an open source distributed database management system designed to handle
large amounts of data across many commodity servers, providing high availability with no single
point of failure.
7. MAIN FEATURES
• Decentralized: Data located, stored, and maintained in a single
location
• Supports replication and multi data center replication
• Scalability (Elastic Scaling)
• Fault-tolerant
• Tunable consistency: Strong consistency or eventual?
• MapReduce support: programming model and an
associated implementation for processing and generating
large data sets with a parallel, distributed algorithm on a
cluster.
• Cassandra Query language (CQL)
• Fast write
8. WHAT PROBLEM DO YOU HAVE?
RDBMS, NoSQL. The horse, the car, the plane. They each build on prior art, they each
attempt to solve certain problems, and so they’re each good at certain things—and less
good at others. They each coexist, even now.
Do u need to fully support transactions with ACID guarantee?
Do u need to have high availability and horizontal scalability?
9. CAP THEOREM
• Consistency (all nodes see the same data at the same time - every read would get you the most recent
write)
• Availability (a guarantee that every request receives a response about whether it succeeded or failed)
• Partition tolerance (the system continues to operate despite arbitrary partitioning due to network
failures)
12. REPLICATION
• Simple Strategy: Specifies a simple replication factor for the cluster.
• Network Topology Strategy: Using this option, you can set the
replication factor for each data-center independently.
• Old Network Topology Strategy: This is a legacy replication strategy.
14. COMMANDS
[saberi@linux bin]$ cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 2.1.2 | CQL spec 3.2.0 | Native protocol v3]
Use HELP for help.
cqlsh>
- CREATE KEYSPACE “KeySpace Name WITH replication = {'class': ‘Strategy name’, 'replication_factor' : ‘No.Of replicas’};
- CREATE TABLE tablename(
column1 name datatype PRIMARYKEY,
column2 name data type,
column3 name data type.
)
- INSERT INTO <tablename>
(<column1 name>, <column2 name>....)
VALUES (<value1>, <value2>....)
USING <option>
- SELECT FROM <tablename>