Bachelor Degree Project

Total Page:16

File Type:pdf, Size:1020Kb

Bachelor Degree Project Performance comparison between NewSQL and SQL Sharded TiDB vs MariaDB Bachelor Degree Project in Information Technology Basic level 30 ECTS Spring 2020 Mathias Johansson, Jonatan Röör Supervisor: András Márki Examiner: Yacine Atif Bachelor Degree Project Abstract Databases are used extensively for websites and a large amount of websites are built upon Wordpress. Wordpress uses MySQL compatible databases and for many larger websites it can be imperative to have the best possible performance. Recently, NewSQL databases have been appearing that combine the features of NoSQL databases with SQL compatibility and ACID compliance that is usually not found in NoSQL databases. Due to their recency, there is a knowledge gap in the literature regarding NewSQL databases. Therefore, this work compares the performance of the NewSQL database TiDB against the SQL database MariaDB in a performance benchmark. The benchmark includes three testing approaches with an aim of testing multiple performance aspects. These include load testing, complex queries and performance in a realistic environment. Results from this thesis show that TiDB achieves better average response time for complex queries and in load testing where the databases and load is large but gets worse results for simple queries and small datasets. MariaDB performs better when used with a web server and with tests that involve write-operations. Keywords: Database, Performance comparison, NewSQL, TiDB, SQL, MariaDB ​ 1 Table of contents 1 Introduction 3 2 Background 4 2.1 Databases 4 2.2 SQL 4 2.3 NoSQL 5 2.4 NewSQL 6 2.5 TiDB 8 2.6 Wordpress 9 3 Problem 10 3.1 Problem background 10 3.2 Problem description 10 3.3 Aim 10 3.4 Research questions 11 3.5 Objectives 11 3.6 Hypotheses 12 4 Method 13 4.1 Empirical Strategies 13 4.2 Related research 13 4.3 Approach 15 5 Experiment 17 5.1 Benchmarking tools and relevant variables in the domain 17 5.1.1 Sysbench 17 5.1.2 Siege 18 5.1.3 Database queries 18 5.2 Benchmarking setup 19 5.3 Results 20 2 5.3.1 Sysbench 20 5.3.2 Database queries 22 5.3.3 Wordpress - Siege load testing 23 5.4 Analysis & Conclusions 24 6 Discussion 26 6.1 General discussion 26 6.1.1 Documentation and community 27 6.1.2 TiDB write performance 27 6.2 Research usefulness 27 6.3 Ethics and Validity threats 28 6.3.1 Ethics 28 6.3.2 Validity threats 28 6.4 Future work 29 7 References 32 3 1 Introduction Websites that require persistent storage usually use databases to store data such as user information and product catalogs. As the number of users increases on a website it becomes necessary to improve the server architecture to keep up with demand. The web server layer can be improved by adding more hardware resources to the web server, called vertical scaling or by adding new web servers, called horizontal scaling. More resources can be added to the database server as well to improve performance, however adding new database servers introduces a number of problems. NoSQL databases are able to make use of sharding to split their databases across several physical locations referred to as nodes, improving query response times and redundancy. NoSQL databases also do not enforce strict table structure and can get better response times than traditional databases even on single nodes. Győrödi, Győrödi, Pecherle & Olah (2015) compared the relational SQL database MySQL to the NoSQL MongoDB and found that MongoDB gave lower execution times for all operations tested. However NoSQL databases also require the website to be built around the NoSQL database. This makes it difficult to move existing websites to non-relational NoSQL databases. NoSQL databases also often cannot guarantee full ACID compliance (Grolinger, Higashino, Tiwari, Capretz 2013). NewSQL databases amend this by providing full ACID compliance and SQL interfaces while still allowing for horizontal partitioning. TiDB is one of these NewSQL implementations that provides a MySQL compatible SQL interface and sharding capabilities to potentially increase scalability and general performance. Many studies have been conducted that compare NoSQL databases to SQL databases but NewSQL databases have not been thoroughly compared to SQL databases. This thesis compares TiDB to MariaDB to see how they compare in performance and see when it might make sense to use a NewSQL database over a traditional SQL database. This study consists of a series of benchmarks that test various different use cases and load configurations to see when each database gets the lowest response time. The Wordpress website framework is used to evaluate how well the databases would work with a real website. 4 2 Background 2.1 Databases Almost everything today that needs to store a large amount of data uses a database of some kind. Whether it is an online store that uses a database for storing products and customer information or a bank that stores account balance, databases can be used to store all kinds of data. There are a multitude of different database implementations that have different characteristics and features and the database management systems can be controlled through specific programming languages and APIs. Most database implementations can be categorized into one of the following groups: SQL, NoSQL and recently NewSQL. 2.2 SQL Structured Query Language (SQL) is used for managing structured data in relational database management systems. Elmasri & Navathe (2011) describes the relational model as a representation of the database as a collection of relations. A relation can be represented as a table of data. Each relation consists of a number of attributes defining what values each row will contain as well as what datatype will be used to store them. The actual definition for the relational model is based in mathematics and uses set theory and first-order predicate logic to reason about databases. A common feature of relational databases is to support transactions. Transactions group together several queries into a single unit of work that is either performed completely or not at all. Using transactions, a system can avoid the situation of an operation being half-completed because a query failed in the middle of the operation (The PostgreSQL Global Development Group 2020). ACID is a set of properties that database transactions should possess in order to guarantee validity under all circumstances. These properties are Atomicity, Consistency preservation, Isolation and Durability (Elmasri & Navathe 2011). ● Atomicity means that a transaction should always be performed entirely or not at all. ​ In practice this means that in case a transaction fails, e.g in the case of the system crashing during the query, the database must recover from and remove any trace of the transaction from the database. ● Consistency preservation, that a transaction should take the database from a consistent ​ state to another, without interference from other transactions. ● Isolation, that transactions should appear to be executed in isolation and not have any ​ interference with other transactions executing concurrently. 5 ● Durability, that all changes to the database must persist and that no data should be lost ​ due to failure. Some notable SQL databases are MySQL and MariaDB: ● MySQL is an open source relational database management system originally created by MySQL AB. Following a series of acquisitions, MySQL changed ownership to first Sun Microsystems and then Oracle Corporation. ● MariaDB is a MySQL compatible database that was forked from MySQL in 2010 after the Oracle acquisition. Its lead developer is one of the core developers behind MySQL and the project is being developed with an emphasis on providing a high level of compatibility with MySQL. Both MySQL and MariaDB can be ACID compliant depending on which storage engine is being used. The default storage engine in both databases provide ACID compliance. (Oracle Corporation 2020). SQL is one of the most popular database types, but there are others like NoSQL where different implementations focus on better query performance or include specific features not usually found in SQL. 2.3 NoSQL Non-relational databases, also called NoSQL are mainly thought of as dissimilar to SQL databases but can also be referred to as “not only SQL” since it is possible for a NoSQL database to support query languages like SQL. In comparison to traditional relational databases like SQL, NoSQL can provide different storage mechanisms for data. Relational SQL databases use a tabular structure which can be read and understood without additional explanations (Meier & Kaufmann 2019). NoSQL databases however, utilize different storage strategies that do not necessarily have a common or easily understandable structure for how data is stored. The categorization of NoSQL databases is based on the type of data storage mechanism they employ. Meier & Kaufmann (2019) describes that there are four general strategies NoSQL databases use: Key-value stores, Document Stores, Column stores and Graph databases. ● Key-value databases are one of the simplest NoSQL types as data is simply represented with a key-value pair where a unique key points to a specific value in the database. This structure resembles a hash table in function and does not enforce any particular structure in the value fields. ● Document stores are based on the key-value structure but save data into documents such as JSON, BSON, XML and YAML. This means that each document can store many fields, similar to how a relational database would store data. Different 6 documents are free to contain different fields from each other, in contrast with relational databases where each row needs to contain all the fields that its table has defined. ● Column stores are similar to key-value databases except a single key can link to multiple columns and a variable number of columns can exist in a single record.
Recommended publications
  • Towards a Library for Deterministic Failure Testing of Distributed Systems
    UC Irvine UC Irvine Electronic Theses and Dissertations Title Towards a Library for Deterministic Failure Testing of Distributed Systems Permalink https://escholarship.org/uc/item/6h90g8rz Author Balalaie, Armin Publication Date 2020 License https://creativecommons.org/licenses/by/4.0/ 4.0 Peer reviewed|Thesis/dissertation eScholarship.org Powered by the California Digital Library University of California UNIVERSITY OF CALIFORNIA, IRVINE Towards a Library for Deterministic Failure Testing of Distributed Systems THESIS submitted in partial satisfaction of the requirements for the degree of MASTER OF SCIENCE in Software Engineering by Armin Balalaie Thesis Committee: Associate Professor James A. Jones, Chair Professor Cristina V. Lopes Professor Michael J. Carey 2020 c 2020 Armin Balalaie DEDICATION To Sara, my love, without whom and her patience, this wasn't possible .. and My mom without her help, dedication and sacrifices, I wouldn't be where I am today .. ii TABLE OF CONTENTS Page LIST OF FIGURES v LIST OF LISTINGS vi LIST OF TABLES vii ACKNOWLEDGMENTS viii ABSTRACT OF THE THESIS ix 1 Introduction 1 2 Existing Work 5 2.1 Deployment-Focused Testing Frameworks . .5 2.2 Random Failure Injection . .6 2.3 Systematic Failure Injection . .8 2.4 Failure-specific Frameworks . .9 2.5 Model-based Approaches . .9 3 Example Failify Test Case for HDFS 11 4 Design Goals 14 4.1 Minimum Learning Curve . 14 4.2 Easy and Deterministic Failure Injection and Environment Manipulation . 15 4.3 Cross-Platform and Multi Language . 16 4.4 Seamless Integration . 17 4.5 Multiple Runtime Engines . 17 4.6 Research Infrastructure . 17 5 Architecture and Implementation 19 5.1 Java-based DSL .
    [Show full text]
  • Go in Tidb Yao Wei | Pingcap About Me
    Go in TiDB Yao Wei | PingCAP About me ● Yao Wei (姚维) ● TiDB Kernel Expert, General Manager of South Region, China ● 360 Infra team / Alibaba-UC / PingCAP ● Atlas/MySQL-Sniffer ● Infrastructure software engineer Why a new database? Brief History RDBMS NoSQL NewSQL ● Standalone RDBMS 1970s 2010 2015 Present ● NoSQL MySQL Redis Google Spanner PostgreSQL HBase Google F1 Oracle Cassandra TiDB ● Middleware & Proxy DB2 MongoDB ... ... ● NewSQL Architecture Stateless SQL Layer Metadata / Timestamp request TiDB ... TiDB ... TiDB Placement Driver (PD) Raft Raft Raft TiKV ... TiKV TiKV TiKV Control flow: Balance / Failover Distributed Storage Layer TiKV - Overview • Region: a set of continuous key-value pairs • Data is organized/stored/replicated by Regions • Highly layered TiKV Key Space RPC (gRPC) Node A Transaction 256MB MVCC [ start_key, Raft end_key) RocksDB (-∞, +∞) Raft Raft Sorted Map Node B Node C Raft PD - Overview ● Meta data management ● Load balance management Route Info TiKV Client PD Node/Region Management Info Command TiKV TiKV TiKV TiKV … ... TiKV Cluster TiKV - Multi-Raft Multiple raft groups in the cluster, one group for each region. Client RPC RPC RPC RPC Store 1 Store 2 Store 3 Store 4 Region 1 Region 1 Region 2 Region 1 Region 3 Region 2 Region 5 Region 2 Raft Region 5 Region 4 Region 3 Region 5 Group Region 4 Region 3 Region 4 TiKV node 1 TiKV node 2 TiKV node 3 TiKV node 4 TiKV - Horizontal Scale Node B Region 1^ Region 1 Region 2 Region 3 Region 1* Node D Region 2 Region 2 Region 3 Region 3 Node C Node A Add Replica Three
    [Show full text]
  • Architecting Cloud-Native NET Apps for Azure (2020).Pdf
    EDITION v.1.0 PUBLISHED BY Microsoft Developer Division, .NET, and Visual Studio product teams A division of Microsoft Corporation One Microsoft Way Redmond, Washington 98052-6399 Copyright © 2020 by Microsoft Corporation All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. This book is provided “as-is” and expresses the author’s views and opinions. The views, opinions, and information expressed in this book, including URL and other Internet website references, may change without notice. Some examples depicted herein are provided for illustration only and are fictitious. No real association or connection is intended or should be inferred. Microsoft and the trademarks listed at https://www.microsoft.com on the “Trademarks” webpage are trademarks of the Microsoft group of companies. Mac and macOS are trademarks of Apple Inc. The Docker whale logo is a registered trademark of Docker, Inc. Used by permission. All other marks and logos are property of their respective owners. Authors: Rob Vettor, Principal Cloud System Architect/IP Architect - thinkingincloudnative.com, Microsoft Steve “ardalis” Smith, Software Architect and Trainer - Ardalis.com Participants and Reviewers: Cesar De la Torre, Principal Program Manager, .NET team, Microsoft Nish Anil, Senior Program Manager, .NET team, Microsoft Jeremy Likness, Senior Program Manager, .NET team, Microsoft Cecil Phillip, Senior Cloud Advocate, Microsoft Editors: Maira Wenzel, Program Manager, .NET team, Microsoft Version This guide has been written to cover .NET Core 3.1 version along with many additional updates related to the same “wave” of technologies (that is, Azure and additional third-party technologies) coinciding in time with the .NET Core 3.1 release.
    [Show full text]
  • Using Rust to Build a Distributed Transactional Key-Value Database Liutang | [email protected] About Me
    Using Rust to Build a Distributed Transactional Key-Value Database LiuTang | [email protected] About me ● Chief Architect at PingCAP ● TiDB and TiKV ● Open source projects ○ LedisDB ○ go-mysql ○ go-mysql-elasticsearch ○ rust-prometheus ○ ... Agenda ● Introduction ● Hierarchy ○ Storage ○ Raft ○ Transaction ○ RPC Framework ○ Monitor ○ Test ● Combine them all When we want to build a distributed transactional key-value database... Consistency Performance Scalability ACID Stability HA Others… A High Building, A Low Foundation Language Let’s start from scratch!!! RocksDB Immutable Memory Memory Table Table WAL Flush Memory Disk Compaction SST Info Log Level 0 SST SST …... SST Manifest Level 1 Current SST SST …... SST Level 2 https://github.com/pingcap/rust-rocksdb Raft Client State State State Machine Raft Machine Raft Machine Raft a = 1 Module a = 1 Module a = 1 Module b = 2 b = 2 b = 2 Log a = 1 b = 2 Log a = 1 b = 2 Log a = 1 b = 2 Multi-Raft Key Space A - B Raft Group Region 1 Region 1 Region 1 Raft Group Region 2 Region 2 Region 2 B - C Raft Group Region 3 Region 3 Region 3 C - D Multi-Raft - Scalability A B C D Region 1 Region 1 Region 1 Region 2 Region 2 Region 2 Multi-Raft - Scalability A B C D Region 1 Region 1 Region 1 Region 2 Region 2 Region 2 Region 2 Raft ConfChange - AddNode Multi-Raft - Scalability A B C D Region 1 Region 1 Region 1 Region 2 Region 2 Region 2 Raft ConfChange - RemoveNode https://github.com/pingcap/raft-rs Transaction Transaction How to keep consistency crossing multi-Raft Groups? let mut txn = store.begin() let value1 = txn.get(region1_key) let value2 = txn.get(region2_key) // do something with value txn.set(region1_key, new_value1) txn.set(region2_key, new_value2) txn.commit() // or txn.rollback() Transaction 1.
    [Show full text]
  • Towards a Library for Deterministic Failure Testing of Distributed Systems
    UNIVERSITY OF CALIFORNIA, IRVINE Towards a Library for Deterministic Failure Testing of Distributed Systems THESIS submitted in partial satisfaction of the requirements for the degree of MASTER OF SCIENCE in Software Engineering by Armin Balalaie Thesis Committee: Associate Professor James A. Jones, Chair Professor Cristina V. Lopes Professor Michael J. Carey 2020 c 2020 Armin Balalaie DEDICATION To Sara, my love, without whom and her patience, this wasn't possible .. and My mom without her help, dedication and sacrifices, I wouldn't be where I am today .. ii TABLE OF CONTENTS Page LIST OF FIGURES v LIST OF LISTINGS vi LIST OF TABLES vii ACKNOWLEDGMENTS viii ABSTRACT OF THE THESIS ix 1 Introduction 1 2 Existing Work 5 2.1 Deployment-Focused Testing Frameworks . .5 2.2 Random Failure Injection . .6 2.3 Systematic Failure Injection . .8 2.4 Failure-specific Frameworks . .9 2.5 Model-based Approaches . .9 3 Example Failify Test Case for HDFS 11 4 Design Goals 14 4.1 Minimum Learning Curve . 14 4.2 Easy and Deterministic Failure Injection and Environment Manipulation . 15 4.3 Cross-Platform and Multi Language . 16 4.4 Seamless Integration . 17 4.5 Multiple Runtime Engines . 17 4.6 Research Infrastructure . 17 5 Architecture and Implementation 19 5.1 Java-based DSL . 19 5.1.1 Deterministic Failure Injection . 21 5.2 Verification Engine . 23 5.3 Workspace Manager . 24 5.4 Instrumentation Engine . 24 5.5 Runtime Engine . 25 iii 6 Evaluation 28 6.1 Compactness and Generality of the Deployment API . 28 6.2 Effectiveness of Deterministic Environment Manipulation API .
    [Show full text]
  • Cloud Container Engine
    Cloud Container Engine FAQs Issue 01 Date 2021-08-09 HUAWEI TECHNOLOGIES CO., LTD. Copyright © Huawei Technologies Co., Ltd. 2021. All rights reserved. No part of this document may be reproduced or transmitted in any form or by any means without prior written consent of Huawei Technologies Co., Ltd. Trademarks and Permissions and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd. All other trademarks and trade names mentioned in this document are the property of their respective holders. Notice The purchased products, services and features are stipulated by the contract made between Huawei and the customer. All or part of the products, services and features described in this document may not be within the purchase scope or the usage scope. Unless otherwise specified in the contract, all statements, information, and recommendations in this document are provided "AS IS" without warranties, guarantees or representations of any kind, either express or implied. The information in this document is subject to change without notice. Every effort has been made in the preparation of this document to ensure accuracy of the contents, but all statements, information, and recommendations in this document do not constitute a warranty of any kind, express or implied. Issue 01 (2021-08-09) Copyright © Huawei Technologies Co., Ltd. i Cloud Container Engine FAQs Contents Contents 1 Common Questions.................................................................................................................1 2 Billing........................................................................................................................................
    [Show full text]
  • Duplicate-Sensitivity Guided Transformation Synthesis for DBMS Correctness Bug Detection
    Duplicate-sensitivity Guided Transformation Synthesis for DBMS Correctness Bug Detection Yushan Zhang Peisen Yao Department of Computer Science and Engineering Department of Computer Science and Engineering HKUST HKUST Hong Kong, China Hong Kong, China [email protected] [email protected] Rongxin Wu Charles Zhang Department of Cyber Space Security Department of Computer Science and Engineering School of School of Informatics HKUST Xiamen University Hong Kong, China Xiamen, China [email protected] [email protected] Abstract—Database Management System (DBMS) plays a core skills [4] and the hand-written test cases only cover a very role in modern software from mobile apps to online banking. It is small part of the possible input query space [5], leading to critical that the DBMS provides correct data to all applications. insufficient testing of the DBMS. In what follows, we refer to When the DBMS returns incorrect data, a correctness bug is triggered. Current production-level DBMSs still suffer from a test case for the purpose of DBMS correctness testing as a insufficient testing due to the limited hand-written test cases. test query and an expected result set. Recently several works proposed to automatically generate many Recent studies [6]–[10] have proposed several approaches test cases with query transformation, a process of generating an to better explore the query space. They all use automated equivalent query pair and testing a DBMS by checking whether random query generation to enlarge the explored query space. the system returns the same result set for both queries. However, all of them still heavily rely on manual work to provide a However, the key challenge is the test oracle problem, i.e., transformation which largely confines their exploration of the how to find the expected result set of a given query.
    [Show full text]
  • Sunhao | Pingcap Agenda
    Deep Dive into TiDB SunHao | PingCAP Agenda ▪ Why we need a new database ▪ The goal of TiDB ▪ Design && Architecture ▪ Storage Layer ▪ Scheduler ▪ SQL Layer ▪ Spark integration ▪ TiDB on Kubernetes Why we Need a NewSQL Database RDBMS NoSQL NewSQL ● From scratch 1970s 2010 2015 Present ● What’s wrong with the existing DBs? ● RDBMS MySQL Redis Google PostgreSQL HBase Spanner ● NoSQL & Middleware Oracle Cassandra Google F1 DB2 MongoDB TiDB ... ... ● NewSQL: F1 & Spanner What to build? ● Scalability ● High Availability ● ACID Transaction ● SQL A Distributed, Consistent, Scalable, SQL Database that supports the best features of both traditional RDBMS and NoSQL Open source, of course What problems we need to solve ▪ Data storage ▪ Data distribution ▪ Data replication ▪ Auto balance ▪ ACID Transaction ▪ SQL at scale Overview Applications BI Tools Data scientist MySQL MySQL MySQL Analytical Analytical Payload Payload Payload workload workload Stateless SQL Stateless SQL SparkSQL & RDD instances instances Spark Plugin RPC RPC RPC Distributed Transactional Key-value storage TiDB Project Overview TiDB TiSpark Stateless SQL instance Spark Plugin Distributed Transactional Key-value storage TiKV Where the data is actually stored TiKV as a KV engine A fast KV engine: RocksDB ● Good start! RocksDB is fast and stable. ● Atomic batch write ● Snapshot ● However… It’s a locally embedded KV store. ● Can’t tolerate machine failures ● Scalability depends on the capacity of the disk Let’s fix Fault Tolerance ● Use Raft to replicate data ● Key features of Raft ● Strong leader: leader does most of the work, issue all log updates ● Leader election ● Membership changes ● Implementation: ● Ported from etcd ● Replicas are distributed across machines/racks/data-centers Let’s fix Fault Tolerance Raft Raft RocksDB RocksDB RocksDB Machine 1 Machine 2 Machine 3 How about Scalability? ● What if we SPLIT data into many regions? ● We got many Raft groups.
    [Show full text]
  • Automatically Detecting and Fixing Concurrency Bugs in Go Software Systems
    Automatically Detecting and Fixing Concurrency Bugs in Go Software Systems Ziheng Liu Shuofei Zhu Boqin Qin Pennsylvania State University Pennsylvania State University Beijing Univ. of Posts and Telecom. USA USA China Hao Chen Linhai Song University of California, Davis Pennsylvania State University USA USA ABSTRACT In Proceedings of the 26th ACM International Conference on Architectural Go is a statically typed programming language designed for efficient Support for Programming Languages and Operating Systems (ASPLOS ’21), and reliable concurrent programming. For this purpose, Go provides April 19–23, 2021, Virtual, MI, USA. ACM, New York, NY, USA, 14 pages. https://doi.org/10.1145/3445814.3446756 lightweight goroutines and recommends passing messages using channels as a less error-prone means of thread communication. Go has become increasingly popular in recent years and has been adopted to build many important infrastructure software systems. 1 INTRODUCTION However, a recent empirical study shows that concurrency bugs, Go is a statically typed programming language designed by Google especially those due to misuse of channels, exist widely in Go. These in 2009 [13]. In recent years, Go has gained increasing popularity in bugs severely hurt the reliability of Go concurrent systems. building software in production environments. These Go programs To fight Go concurrency bugs caused by misuse of channels, range from libraries [5] and command-line tools [1, 6] to systems this paper proposes a static concurrency bug detection system, software, including container systems [12, 22], databases [3, 8], and GCatch, and an automated concurrency bug fixing system, GFix. blockchain systems [16]. After disentangling an input Go program, GCatch models the com- One major design goal of Go is to provide an efficient and safe plex channel operations in Go using a novel constraint system and way for developers to write concurrent programs [14].
    [Show full text]
  • Replicating Mysql Data to Tidb for Near Real-Time Analytics
    Replicating MySQL Data to TiDB For Near Real-Time Analytics Francisco Bordenave Percona Who am I? • PerconaMarco Architect • Microbrewer 2 TiDB at a Glance 3 TiDB at a Glance • TiDB Cluster server process SQL and interacts with clients - MySQL compatibility - SQL Processing 4 TiDB at a Glance • PD (placement driver) cluster stores metadata, load balancing and monitor storage 5 TiDB at a Glance • TiKV distributed storage, RocksDB 6 MySQL compatibility • MySQL clients and drivers. • DML, DDL compatibility - some limitations • Easy to start querying DB 7 Replication Goals • Consistency - Resume from previous checkpoint - Verifying consistency. • Performance - Can we avoid replication lag? • Observability - Is the process broken? - Are we querying stale data? 8 Toolbox Ready to use tools Toolbox • mydumper/loader/syncer • Data Migration (full suite) - dm-master - dm-worker - dmctl • tidb-lighting • DIY 1 0 mydumper • https://github.com/maxbube/mydumper fork - Additional customizations • Uncompressed dump only for loader • mydumper -B percona -o . -C -t 3 -h 10.3.4.4 -u tidb -p tidb -v 3 1 1 loader (1) • Loads mydumper data in parallel, ~1MB chunk per load, resumable. • Uncompressed dump only. • myloader is possible too - Be aware of trx size limits (i.e. use -q1) - Not resumable • Database/table filters • loader -d ./ -h 127.0.0.1 -P 4000 -uroot -t 3 -rm-checkpoint -L info • myloader -d ./ -B percona -h 127.0.0.1 -uroot -P 4000 -t3 -q 1 1 2 loader (2) • Database/table filters { "log-level": "info", "log-file": "", "status-addr": ":8272", "pool-size": 3, "dir": "./", "db": { "host": "127.0.0.1", "user": "root", "port": 4000, "sql-mode": "@DownstreamDefault" }, "checkpoint-schema": "tidb_loader", "config-file": "", "route-rules": null, "do-table": null, "do-db": null, "ignore-table": null, "ignore-db": null, 1 3 "rm-checkpoint": false} loader status • Available from tidb_loader.checkpoint by default mysql> select * from tidb_loader.checkpoint \G *************************** 1.
    [Show full text]
  • Running Databases in a Kubernetes Cluster
    RUNNING DATABASES IN A KUBERNETES CLUSTER An evaluation Olle Larsson Master esis, 30 credits Supervisor: Johan Tordsson External supervisor: Johan Tordsson Civilingenjorsprogrammet¨ i teknisk datavetenskap 2019 Abstract A recent trend in soware engineering is to build applications composed of a set of small independent services – microservices. Kubernetes has become the common denominator for hosting stateless microservices. It oers foundational features such as deployment and replication of microservices as well as cluster resource management. Whereas stateless microservices are well suited to be- ing hosted in Kubernetes, stateful microservices such as databases are generally hosted outside of Kubernetes and managed by domain experts. It is desirable to run stateful services such as databases in Kubernetes to leverage its features, ease of operation, and to harmonize the environment across the entire applica- tion stack. e purpose of this thesis is to investigate and evaluate the current support for hosting stateful applications in the form of databases in Kubernetes, and to show how dierent databases are able to operate in Kubernets. An ex- perimental setup was used where a set of databases – MySQL, TiDB, and Cock- roachDB, were deployed in a Kubernetes cluster. For each of these databases, a set of operational tasks were performed that concerned backup, upgrading, and capacity re-scaling. During the operations a number of server-sided and client- sided metrics related to the performance and resource eciency of the databases were captured. e results showed that Kubernetes has got the native capabil- ities necessary to deploy and run databases, but not to fully operate them cor- rectly. Furthermore, it was concluded that the operations had a widely dierent performance impact depending on the database solution.
    [Show full text]
  • Contributions to Large-Scale Distributed Systems the Infrastructure Viewpoint - Toward Fog and Edge Computing As the Next Utility Computing Paradigm? Adrien Lebre
    Contributions to Large-scale Distributed Systems The infrastructure Viewpoint - Toward Fog and Edge Computing as The Next Utility Computing Paradigm? Adrien Lebre To cite this version: Adrien Lebre. Contributions to Large-scale Distributed Systems The infrastructure Viewpoint - To- ward Fog and Edge Computing as The Next Utility Computing Paradigm?. Distributed, Parallel, and Cluster Computing [cs.DC]. Université de Nantes, 2017. tel-01664343 HAL Id: tel-01664343 https://tel.archives-ouvertes.fr/tel-01664343 Submitted on 14 Dec 2017 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Université Bretagne Loire Habilitation à Diriger des recherches Presentée par Adrien Lebre École Doctorale Sciences et technologies de l’information, et mathématiques Discipline : Informatique et applications, section CNU 27 Unité de recherche : IMT Atlantique, Inria, LS2N Soutenue le 1er Sept. 2017 Contributions to Large-scale Distributed Systems The infrastructure Viewpoint Toward Fog and Edge Computing as The Next Utility Computing Paradigm? Contributions aux systèmes distribués à large échelle la vision infrastructure Vers le Fog et l’Edge computing comme nouveau modèle d’informatique utilitaire ? M. Claude Jard, Président Professor in Computer Science at University of Nantes Head of Nantes Digital Science Laboratory (LS2N).
    [Show full text]