Advanced MySQL 8
eBook - ePub

Advanced MySQL 8

Discover the full potential of MySQL and ensure high performance of your database

Eric Vanier, Birju Shah, Tejaswi Malepati

Buch teilen
  1. 286 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Advanced MySQL 8

Discover the full potential of MySQL and ensure high performance of your database

Eric Vanier, Birju Shah, Tejaswi Malepati

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

Design cost-efficient database solutions, scale enterprise operations and reduce overhead business costs with MySQL

Key Features

  • Explore the new and advanced features of MySQL 8.0
  • Use advanced techniques to optimize MySQL performance
  • Create MySQL-based applications for your enterprise with the help of practical examples

Book Description

Advanced MySQL 8 teaches you to enhance your existing database infrastructure and build various tools to improve your enterprise applications and overall website performance. The book starts with the new and exciting MySQL 8.0 features and how to utilize them for maximum efficiency. As you make your way through the chapters, you will learn to optimize MySQL performance using indexes and advanced data query techniques for large queries. You will also discover MySQL Server 8.0 settings and work with the MySQL data dictionary to boost the performance of your database. In the concluding chapters, you will cover MySQL 8.0 Group Replication, which will enable you to create elastic, highly available, and fault-tolerant replication topologies. You will also explore backup and recovery techniques for your databases and understand important tips and tricks to help your critical data reach its full potential.

By the end of this book, you'll have learned about new MySQL 8.0 security features that allow a database administrator (DBA) to simplify user management and increase the security of their multi-user environments.

What you will learn

  • Explore new and exciting features of MySQL 8.0
  • Analyze and optimize large MySQL queries
  • Understand MySQL Server 8.0 settings
  • Master the deployment of Group Replication and use it in an InnoDB cluster
  • Monitor large distributed databases
  • Discover different types of backups and recovery methods for your databases
  • Explore tips to help your critical data reach its full potential

Who this book is for

Advanced MySQL 8 is for database administrators, data architects, and database developers who want to dive deeper into building advanced database applications in the MySQL environment.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Advanced MySQL 8 als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Advanced MySQL 8 von Eric Vanier, Birju Shah, Tejaswi Malepati im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Informatique & Traitement des données. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2019
ISBN
9781788833790

InnoDB Cluster in MySQL 8.0

In the previous chapter, we learned about MySQL Group Replication. We discussed Group Replication internals and also looked at its step-by-step configuration. We went through all of the important MySQL variables that can be used to fine-tune the performance of Group Replication. In this chapter, we shall focus on MySQL InnoDB, concentrating on the following topics:
  • What InnoDB cluster is
  • InnoDB cluster requirements
  • Creating a MySQL InnoDB cluster
  • Routers in InnoDB cluster
  • Managing InnoDB cluster
  • InnoDB cluster limitations
  • Storage engines
We highly recommend that you refer to Chapter 7, Group Replication in MySQL 8.0, before proceeding with this chapter, to have a thorough understanding of Group Replication.

What is InnoDB cluster?

InnoDB cluster is a complete, high-availability solution provided by MySQL. InnoDB cluster uses a Group Replication mechanism at its heart to replicate data; on top of that, InnoDB cluster provides a built-in failover mechanism, as illustrated in the following diagram:
To ensure high-availability, a seamless failover mechanism and the ability to load-balance are essential. MySQL provides this with MySQL Router. The router is an important component in InnoDB cluster but is a separate component that needs to be downloaded and installed. The router acts as middleware that provides routing between clients and servers. InnoDB cluster can operate in multi-primary mode or single-primary mode. In the case of primary server failure, applications do not need to manage the failover logic, as it is automatically taken care of by MySQL Router. It acts as lightweight middleware that routes READWRITE and READONLY transactions, as well as appropriately routing data requests to either primary or slave servers. This functionality can help to achieve scalability at the MySQL level.
MySQL Router should be installed near to applications or on the same host as applications. After installation, MySQL Router fetches the metadata or configuration from InnoDB cluster and caches it locally. If the availability of servers on InnoDB cluster changes, router updates its local data to reflect any changes where necessary.
Application connections that are shut down are disconnected from the MySQL server and then moved to a closed state. Note that applications are required to reconnect, to re-establish the connection, as the router will not take care of such a failover.
MySQL Router 8.0 supports both MySQL 5.7 and MySQL 8.0. If you are using an older version, such as 2.0 or 2.1, you must upgrade to MySQL Router 8.0.
MySQL Shell is an advanced client and code editor for MySQL server. You can install MySQL Shell separately. Refer to the official documentation of MySQL Shell for more information.
In addition to existing SQL functionality, MySQL Shell provides scripting capabilities for JavaScript and Python. Shell also uses X DevAPI, which is helpful for developers who want to use MySQL as a document store or RDBMS. Shell also includes X AdminAPI for architects who want to manage MySQL InnoDB cluster and do not want to configure and manage everything manually.
By using X AdminAPI, we can do the following:
  • Configure, create, and check the status of groups
  • Configure, add members, and remove members
  • Create sandbox environments for testing
Shell also provides us with a way to configure colors, to customize the look and feel of an application.
Let's now deep dive into these programs and explore which APIs will be useful for us going forward.
By now, you should have downloaded the latest versions of MySQL server, MySQL Shell, and MySQL Router. Let's first try to configure a sandbox environment before going through the production setup. We'll start with identifying cluster requirements.

InnoDB cluster requirements

InnoDB cluster uses Group Replication to replicate data across various machines, so we need to make sure that our server instances meet the minimum requirements necessary; they are as follows:
  • Python Version 2.7 or higher is required for MySQL Shell to work, and is required for all machines that are part of a group; for Windows, MySQL Shell bundles Python
  • MySQL Router, MySQL Shell, and MySQL server should already be downloaded and installed on the servers before configuring InnoDB cluster
  • InnoDB must be used as a storage engine for all tables
Please refer to Chapter 7, Group Replication in MySQL 8.0, for more information on the preceding requirements.
Let's now configure a testing scenario to understand these components and how they work.

Installing MySQL Shell

First, download the zip file for MySQL Shell for Windows (Windows X86, 64-bit) from the official MySQL website, http://dev.mysql.com/downloads/shell/. Extract it, and you should see the mysqlsh.exe file in the bin folder. Configure the environment and path variables so that they can access mysqlsh.exe from the command prompt.
For Linux distributions, either the MySQL APT repository or the MySQL Yum repository is required. Make sure you select MySQL 8.0 as the release. Please follow the official MySQL documentation for more details.
You can install MySQL Shell with the following command:
sudo apt-get update
sudo apt-get install mysql-shell
If you already have a MySQL APT Repository configuration, use the following commands:
> sudo apt-get update
> sudo apt-get install mysql-apt-config
Make sure you choose MySQL 8.0 as the release series before running the following command:
> sudo apt-get install mysql-shell
For Yum repositories, use the following command. Configure the MySQL Yum repository with the new release package, mysql80-community-release. Once complete, run the following command:
> sudo yum install mysql-shell

How to use ...

Inhaltsverzeichnis