DOC PREVIEW
UT Dallas CS 6350 - Cassandenra

This preview shows page 1-2-3-4-26-27-28-53-54-55-56 out of 56 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8MembershipSlide 10Slide 11Slide 12Slide 13Slide 14Slide 15Data ModelIssues with today’s workloadsSchema-free Sparse-tableData ModelEasier to show from the bottom upData ModelData ModelData ModelSlide 24Slide 25Slide 26Slide 27Slide 28Slide 29Slide 30Slide 31Read and Write in CassandraReadSlide 34Slide 35Slide 36Slide 37Slide 38Slide 39WritesWrites at a replica nodeDeletes and ReadsSlide 43Slide 44Slide 45Slide 46Partitioning and ReplicationSlide 48Slide 49Slide 50Slide 51Slide 52Slide 53Slide 54Slide 55Slide 56Prof. Latifur KhanDepartment of Computer ScienceSchool of Engineering & Computer ScienceUT Dallashttp://jonathanhui.com/how-cassandra-read-persists-data-and-maintain-consistencyA little of both..Architecture OverviewMembershipCluster membership in Cassandra is based on Scuttlebutt, a very efficient anti-entropy Gossip based mechanism.8 / 66MembershipGossip protocol is used for cluster membership.Super lightweight with mathematically provable properties.State disseminated in O(logN) rounds where N is the number of nodes in the cluster.Every T seconds each member increments its heartbeat counter and selects one other member to send its list to.A member merges the list with its own list .9 / 6610 / 6611 / 6612 / 6613 / 66Architecture OverviewData ModelA table in Cassandra is a distributed multi dimensional map indexed by a key. The value is an object which is highly structured.Cassandra exposes two kinds of columns familiesSimple column familiesSuper column families16 / 66Issues with today’s workloads Data: Large and unstructuredLots of random reads and writesForeign keys rarely neededNeedIncremental ScalabilitySpeedNo Single point of failureLow TCO and adminScale out, not upSchema-free Sparse-tableFlexible column namingYou define the sort orderNot required to have a specific column just because another row doesData Model•Keyspace•ColumnFamily•Row (indexed)•Key•ColumnsName (sorted)ValueEasier to show from the bottom upData ModelA single columnData ModelA single rowData ModelSource: datastaxRead and Write in CassandraReadQueryClosest replicaCassandra ClusterReplica AResultReplica B Replica CDigest QueryResultClient33 / 66Writes Need to be lock-free and fast (no reads or disk seeks)Client sends write to one front-end node in Cassandra cluster (Coordinator)Which (via Partitioning function) sends it to all replica nodes responsible for keyAlways writable: Hinted HandoffIf any replica is down, the coordinator writes to all other replicas, and keeps the write until down replica comes back up.When all replicas are down, the Coordinator (front end) buffers writes (for up to an hour). Provides Atomicity for a given key (i.e., within ColumnFamily)One ring per datacenterCoordinator can also send write to one replica per remote datacenterWrites at a replica nodeOn receiving a write1. log it in disk commit log2. Make changes to appropriate memtablesIn-memory representation of multiple key-value pairsLater, when memtable is full or old, flush to diskData File: An SSTable (Sorted String Table) – list of key value pairs, sorted by keyIndex file: An SSTable – (key, position in data sstable) pairsAnd a Bloom filterCompaction: Data udpates accumulate over time and sstables and logs need to be compactedMerge key updates, etc.Reads need to touch log and multiple SSTablesMay be slower than writesDeletes and Reads Delete: don’t delete item right awayadd a tombstone to the log Compaction will remove tombstone and delete itemRead: Similar to writes, exceptCoordinator can contact closest replica (e.g., in same rack)Coordinator also fetches from multiple replicascheck consistency in the background, initiating a read-repair if any two values are differentMakes read slower than writes (but still fast)Read repair: uses gossip (remember this?)BootstrappingWhen a node starts for the first time, it chooses a random token for its position in the ring.43 / 66Scaling The ClusterWhen a new node is added into the system, it gets assigned a token such that it can alleviate a heavily loaded node.44 / 66Local PersistenceThe Cassandra system relies on the local file system for data persistence.45 / 66PartitioningOne of the key design features for Cassandra is the ability to scale incrementally.46 / 66011/2FEDCBAN=3h(key2)h(key1)Partitioning and ReplicationPartitioning1•In cassandra, the total data managed by the cluster is represented as a circular space or ring.•The ring is divided up into ranges equal to the number of nodes, which each node being responsible for one or more ranges of the overall data.•Before a node can join the ring, it must be assigned a token.•The token determines the node’s position on the ring and the range of data it is responsible for.1 http://www.datastax.com/docs/0.8/cluster_architecture48 / 66Partitioning – Single Data Center(Continue)11 http://www.datastax.com/docs/0.8/cluster_architectureA cluster with 4 nodes, the row keys managed by the cluster were numbers in the range of 0 to 100.Each node is assigned a token that represents a point in this range.In this simple example, the token values are 0, 25, 50, and 75.49 / 66Partitioning – Replica Placement(Continue)11 http://www.datastax.com/docs/0.8/cluster_architecture•In multi-data center deployments, replica placement is calculated per data center.•Additional replicas in the same data center are placed by walking the ring clockwise until it reaches the first node in another rack.50 / 66Replication Factor & Replication In Cassandra• Replication factor The total number of replicas across the cluster is often referred to as the replication factor.•A replication factor of 1 means that there is only one copy of each row, and a replication factor of 2 means two copies of each row.• Replication Is the process of storing copies of data on multiple nodes.51 / 66Replication Factor In CassandraReplication is the process of storing copies of data on multiple nodes.52 / 66About Client Request•All nodes in cassandra are peers.•A client read/write request can go to any node in the cluster.•When a client connect to a node and issues a read/write request , that node serves as a proxy the coordinator for that particular operation.•The job of the coordinator is to act between the client application and the nodes(replicas)that own the data being requested.53 / 66About Client Request(Continue)•The coordinator sends the write request to all replicas


View Full Document

UT Dallas CS 6350 - Cassandenra

Documents in this Course
HW3

HW3

5 pages

NOSQL-CAP

NOSQL-CAP

23 pages

BigTable

BigTable

39 pages

HW3

HW3

5 pages

Load more
Download Cassandenra
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Cassandenra and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Cassandenra 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?