VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Cassandra Architecture.

Slides:



Advertisements
Similar presentations
Dynamo: Amazon’s Highly Available Key-value Store
Advertisements

CASSANDRA-A Decentralized Structured Storage System Presented By Sadhana Kuthuru.
Ion Stoica, Robert Morris, David Karger, M. Frans Kaashoek, Hari Balakrishnan MIT and Berkeley presented by Daniel Figueiredo Chord: A Scalable Peer-to-peer.
Pastry Peter Druschel, Rice University Antony Rowstron, Microsoft Research UK Some slides are borrowed from the original presentation by the authors.
MCTS Guide to Microsoft Windows Server 2008 Network Infrastructure Configuration Chapter 6 Managing and Administering DNS in Windows Server 2008.
Dynamo: Amazon's Highly Available Key-value Store Distributed Storage Systems CS presented by: Hussam Abu-Libdeh.
NoSQL Databases: MongoDB vs Cassandra
Scaling Distributed Machine Learning with the BASED ON THE PAPER AND PRESENTATION: SCALING DISTRIBUTED MACHINE LEARNING WITH THE PARAMETER SERVER – GOOGLE,
Group Communications Group communication: one source process sending a message to a group of processes: Destination is a group rather than a single process.
Google Bigtable A Distributed Storage System for Structured Data Hadi Salimi, Distributed Systems Laboratory, School of Computer Engineering, Iran University.
Wide-area cooperative storage with CFS
70-293: MCSE Guide to Planning a Microsoft Windows Server 2003 Network, Enhanced Chapter 7: Planning a DNS Strategy.
5.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 5: Working with File Systems.
 Structured peer to peer overlay networks are resilient – but not secure.  Even a small fraction of malicious nodes may result in failure of correct.
Workflow Steps Perform a datacenter switchover for a database availability group Version 1.2 (Updated 12/2012)
11 SERVER CLUSTERING Chapter 6. Chapter 6: SERVER CLUSTERING2 OVERVIEW  List the types of server clusters.  Determine which type of cluster to use for.
Microsoft Load Balancing and Clustering. Outline Introduction Load balancing Clustering.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation MongoDB Write Lecturer.
ADVANCED MICROSOFT ACTIVE DIRECTORY CONCEPTS
Presented by: Alvaro Llanos E.  Motivation and Overview  Frangipani Architecture overview  Similar DFS  PETAL: Distributed virtual disks ◦ Overview.
Plan for Intro to Cloud Databases
Module 12: Designing High Availability in Windows Server ® 2008.
© 2011 Cisco All rights reserved.Cisco Confidential 1 APP server Client library Memory (Managed Cache) Memory (Managed Cache) Queue to disk Disk NIC Replication.
INSTALLING MICROSOFT EXCHANGE SERVER 2003 CLUSTERS AND FRONT-END AND BACK ‑ END SERVERS Chapter 4.
Cognos TM1 Satya Mobile:
70-291: MCSE Guide to Managing a Microsoft Windows Server 2003 Network Chapter 6: Name Resolution.
70-291: MCSE Guide to Managing a Microsoft Windows Server 2003 Network, Enhanced Chapter 6: Name Resolution.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Amazon’s Dynamo Lecturer.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Trade-offs in Cloud.
Cassandra - A Decentralized Structured Storage System
Cassandra – A Decentralized Structured Storage System Lecturer : Prof. Kyungbaek Kim Presenter : I Gde Dharma Nugraha.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Data Versioning Lecturer.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Exam and Lecture Overview.
Module 7: Resolving NetBIOS Names by Using Windows Internet Name Service (WINS)
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation MongoDB Architecture.
The Replica Location Service The Globus Project™ And The DataGrid Project Copyright (c) 2002 University of Chicago and The University of Southern California.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Partitioning and Replication.
Fast Crash Recovery in RAMCloud. Motivation The role of DRAM has been increasing – Facebook used 150TB of DRAM For 200TB of disk storage However, there.
 Load balancing is the process of distributing a workload evenly throughout a group or cluster of computers to maximize throughput.  This means that.
11 CLUSTERING AND AVAILABILITY Chapter 11. Chapter 11: CLUSTERING AND AVAILABILITY2 OVERVIEW  Describe the clustering capabilities of Microsoft Windows.
Chord Advanced issues. Analysis Theorem. Search takes O (log N) time (Note that in general, 2 m may be much larger than N) Proof. After log N forwarding.
HDB++: High Availability with
Chapter 7: Consistency & Replication IV - REPLICATION MANAGEMENT By Jyothsna Natarajan Instructor: Prof. Yanqing Zhang Course: Advanced Operating Systems.
Introduction to Active Directory
You there? Yes Network Health Monitoring Heartbeats are sent to monitor health status of network interfaces Are sent over all cluster.
GPFS: A Shared-Disk File System for Large Computing Clusters Frank Schmuck & Roger Haskin IBM Almaden Research Center.
70-294: MCSE Guide to Microsoft Windows Server 2003 Active Directory, Enhanced Chapter 6: Active Directory Physical Design.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Introduction to Cloud.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Amazon’s Dynamo Lecturer.
1 Group Communications: Host Group and IGMP Dr. Rocky K. C. Chang 19 March, 2002.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Cassandra Tools and.
Plan for Final Lecture What you may expect to be asked in the Exam?
Cassandra The Fortune Teller
Services DFS, DHCP, and WINS are cluster-aware.
Cassandra - A Decentralized Structured Storage System
Cassandra Tools and Config Files
MongoDB Distributed Write and Read
Network Load Balancing
Dynamo: Amazon’s Highly Available Key-value Store
Cassandra Transaction Processing
Cluster Communications
Lecturer : Dr. Pavle Mogin
CHAPTER 3 Architectures for Distributed Systems
Storage Virtualization
Chapter 16: Distributed System Structures
Replication Middleware for Cloud Based Storage Service
Chapter 7: Consistency & Replication IV - REPLICATION MANAGEMENT -Sumanth Kandagatla Instructor: Prof. Yanqing Zhang Advanced Operating Systems (CSC 8320)
Providing Secure Storage on the Internet
Overview Multimedia: The Role of WINS in the Network Infrastructure
Windows Name Resolution
Presentation transcript:

VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Cassandra Architecture Lecturer : Dr. Pavle Mogin

Advanced Database Design and Implementation 2016 Architecture 1 Plan for Cassandra Architecture Prologue Internode Communication Data Distribution and Replication Partitioners Snitches CREATE KEYSPACE command

Advanced Database Design and Implementation 2016 Architecture 2 Prologue Cassandra documentation describes the architecture in terms of: –Data centres, –Clusters, –Internode communication, –Data distribution and replication, –Snitches, and –Keyspaces Important structural information is held in two configuration files: –cassandra.yaml, and –cassandra-topology.properties

Advanced Database Design and Implementation 2016 Architecture 3 Prologue Data Centre –A collection of related nodes –Data centre is synonymous with replication group, that is, a grouping of nodes configured together for replication purposes –A data centre can be physical or virtual –If a cluster spans more then one data centre Replication is set by data centre The same data is written in all data centre –Using separate data centres allows: Dedicating each data centre for different processing tasks Satisfying requests from a datacentre close to client, and Improving availability for the same level of consistency Data centres should never span physical locations Cluster –A cluster contains nodes belonging to one or more data centres – It can span physical locations

Advanced Database Design and Implementation 2016 Architecture 4 Internode Communication Cassandra uses Gossip communication protocol in which nodes periodically exchange state information about themselves and other nodes they know about The gossip process runs every second and exchanges messages with up to three other nodes in the cluster Gossip messages are versioned –During a gossip exchange, older information is overwritten with the most current state for a particular node

Advanced Database Design and Implementation 2016 Architecture 5 Configuring Gossip Settings and Seeds When a node first starts up, it looks at its cassandra.yaml configuration file to determine: –The name of the Cassandra cluster it belongs to, –Which nodes (called seeds) to contact to obtain information about the other nodes in the cluster, and –Other parameters for determining port and range information All these parameters are set by an administrator and have to be the same for all nodes of a cluster The property seed_provider is a list of comma- delimited hosts (IP addresses) In multiple data-center clusters, the seeds list should include at least one node from each data centre

Advanced Database Design and Implementation 2016 Architecture 6 Node Failure Detection During gossiping, every node maintains a sliding window of inter-arrival times of gossip messages from other nodes in the cluster –That mechanism is called dynamic snitch If a node does not respond during an adjustable time period, it is either down or experiencing transient problems Cassandra uses this information to avoid routing client requests to unreachable nodes (if possible), or nodes that are performing poorly The live nodes periodically try to re-establish contact with failed nodes to see if they are back up

Advanced Database Design and Implementation 2016 Architecture 7 Data Distribution and Partitioning Data distribution is done by Consistent Hashing Partitioning –A partitioner determines how data is distributed across the nodes in the cluster –Basically, a partitioner is a function for deriving a token representing a row from its partition key –Cassandra default partitioner is a hash function named Murmur3Partitioner –This hashing function creates a 64-bit value of the partition key –The possible range of hash values is from to

Advanced Database Design and Implementation 2016 Architecture 8 Hashing Values in a Cluster A B D C Cluster Only physical nodes assumed to to to to

Advanced Database Design and Implementation 2016 Architecture 9 Virtual Nodes Virtual nodes are used to: –Balance the work load. –Add or remove nodes in an easy way, and –Rebuild a dead node faster For each physical node of a cluster, the administrator specifies the number of virtual nodes in its cassandra.yaml configuration file The property num_tokens defines the number of tokens randomly assigned to this node on the ring –One token for each virtual node

Advanced Database Design and Implementation 2016 Architecture 10 Data Replication Cassandra supports a number of replication strategies: –Simple Strategy, –Network Topology Strategy, –Gossiping Network Topology Strategy, –Amazon Worldwide Services (EC2 and EC2 Multi Region) We consider the Simple Strategy and Network Topology Strategy, only Simple Strategy is used for single data centres only –Places the first replica on a node determined by the partitioner –Additional replicas are placed on the next nodes clockwise in the ring without considering topology (rack or data centre location)

Advanced Database Design and Implementation 2016 Architecture 11 Network Topology Strategy Network Topology Strategy (NTS) should be used for clusters deployed across multiple data centres NTS is: –Data Centre aware and –Rack aware This strategy specifies the number of replicas in each data centre NTS places replicas in the same data centre by walking the ring clockwise until reaching the first node in another rack – NTS attempts to place replicas on distinct racks because nodes in the same rack (or similar physical grouping) often fail at the same time due to power, cooling, or network issues

Advanced Database Design and Implementation 2016 Architecture 12 Configuring Data Centre Replication Primary considerations when configuring replicas in a multi data centre cluster are: –Being able to satisfy reads locally, without incurring cross data-centre latency, and –Failure scenarios Failure scenarios: –Two replicas in each data centre tolerates the failure of a single node per replication group and still allows local reads at a consistency level of ONE. –Three replicas in each data centre tolerates either the failure of one node per replication group at a strong consistency level of LOCAL_QUORUM or multiple node failures per data centre using consistency level ONE –Asymmetrical replication groupings are also possible: Three replicas in one data centre for real-time applications, and A single replica in the other for running analytics

Advanced Database Design and Implementation 2016 Architecture 13 Example 1 Assume: –A six node cluster has been deployed using a single data centre –The availability requirements are: Strong consistency for 100% of data when one node is down Strong consistency for 100% of data when one rack is down How many racks the cluster should be deployed to and how many nodes per a rack to achieve availability requirements? What should be the replication factor? Answer: n = Rack Rack Rack 3

Advanced Database Design and Implementation 2016 Architecture 14 Example 2 Assume: –A twelve node cluster has been deployed using two data centres, containing six nodes each –Each physical node has only one virtual node –The availability requirements are: Strong consistency for 100% of data when two nodes are down Strong consistency for 100% of data when two racks are down How many racks the cluster should be deployed to and how many nodes per a rack to achieve availability requirements? What should be the replication factor?

Advanced Database Design and Implementation 2016 Architecture 15 Answer 4 1 Rack Rack Rack 3 Data Centre Rack Rack Rack 3 Data Centre 2 Local replication factors n 1 = 3 and n 2 = 3 Global replication factor n = 6 Local quorums q 1 = 2 and q 2 = 2 Global quorum q = 4

Advanced Database Design and Implementation 2016 Architecture 16 Snitches A snitch determines which data centres and racks nodes belong to They inform Cassandra about the network topology so that requests are routed efficiently and allows Cassandra to distribute replicas by grouping machines into data centres and racks Cassandra supports: –SimpleSnitch, –PropertyFileSnitch, –Others Simple Snitch: –The SimpleSnitch is the default snitch –It is used for single-data centre deployments, only –It does not recognize data centre or rack information

Advanced Database Design and Implementation 2016 Architecture 17 Property File Snitch This snitch determines proximity by rack and data centre It uses the network details located in the cassandra-topology.properties file When using this snitch, the administrator can define data centre names to be whatever he/she wants Data centre names have to correlate to the name of data centres in the keyspace definition Every node in the cluster should be described in the cassandra-topology.properties file, and this file should be exactly the same on every node in the cluster

Advanced Database Design and Implementation 2016 Architecture 18 CREATE KEYSPACE The replication strategy and the replication configuration are defined within the CREATE KEYSPACE CQL command CREATE KEYSPACE IF NOT EXISTS keyspace_name WITH REPLICATION = map AND DURABLE_WRITES = ( true | false ) The map is used to declare: –replica placement strategy class (either Simple or Network Topology), and –Replication configuration (factor)

Advanced Database Design and Implementation 2016 Architecture 19 The map of CREATE KEYSPACE The two different types of keyspaces: { 'class' : 'SimpleStrategy', 'replication_factor' : }; { 'class' : 'NetworkTopologyStrategy‘ [, ' ' :, ' ' : ]... }; The SimpleStrategy is used for evaluating and testing Cassandra –It is correlated with the SimpleSnitch The NetworkTopologyStrategy should be used for production or for use with mixed workloads –It is correlated with PropertyFileSnitch that uses information in cassandra-topology.properties file

Advanced Database Design and Implementation 2016 Architecture 20 Configuring NTS Before creating a keyspace for use with multiple data centres, the cluster has to be configured to use a network-aware snitch –The cassanra.yaml configuration file of each node has to be configured before starting the cluster –One of settings to be checked and (possibly) done is endpoint_snitch: PropertyFileSnitch For a cluster spanning multiple data centres, data centre names and rack information have to be checked and possibly changed in cassandra- topology.properties files of each node –Cassandra uses dci, i = 1,…, as the default data centre name –Centre names in.properties file and in the map of CREATE KEYSPACE have to match exactly, otherwise Cassandra will fail to find a node, to complete a write request

Advanced Database Design and Implementation 2016 Architecture 21 Setting Durable_Writes DURABLE_WRITES is an option whose default is yes When set to false, data written to the keyspace bypasses the commit log –A risk of losing data –Not to use on a key space using the SimpleStrategy

Advanced Database Design and Implementation 2016 Architecture 22 Summary(1) A data centre is a collection of nodes configured for replication purposes A cluster contains nodes from one or more data centres Internode communication is accomplished through gossiping The dynamic snitch is a mechanism for detecting poorly performing or failing nodes Data distribution is done by Consistent Hashing –Partitioning is performed by deriving a token from the partition key of a row and storing the row on a node assigned to the first greater token on the consistent hashing ring

Advanced Database Design and Implementation 2016 Architecture 23 Summary (2) Data replication is performed according to one of replication strategies: –Simple Strategy, –Network Topology Strategy A snitch contains information about the network topology –Each snitch corresponds to one replication strategy and vice versa The replication strategy and the replication configuration (factor) are declared within a keyspace declaration