A
A
ArrayPop2020-02-09 11:43:06
MySQL
ArrayPop, 2020-02-09 11:43:06

How does mysql clustering or other db cluster work?

Let's say there is a query "SELECT * FROM table LIMIT 1000000". Such a request will be very slow. If I make a cluster architecture, then the same request will become faster due to distribution over servers or not. If not, what does the cluster do, and is it necessary to rewrite all queries after creating the cluster, if you need to rewrite queries for special ones, then what queries should be written?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivan Shumov, 2020-02-09
@ArrayPop

It's just that with basic clustering, we get fault tolerance and synchronous replication of nodes. Therefore, the recording becomes slower. To accelerate further, you need to configure sharding and participation. Partitioning can be done without a cluster

M
Melkij, 2020-02-09
@melkij

This request will be very slow.

Why? Well, if only table is not a table, but a sprawling view.
If the table - we read the data in a stream convenient for the subd (sorting is not requested - the subd will choose a convenient reading order for itself) and send it to the requester. A simple thing, and if performance is not enough here, then this is not a question for the database and its scaling, but for the application: why was this non-deterministic million rows from the table needed there at all.
Cluster is a very general word.
Replica master cold standby - cluster
Replica master hot standby - cluster
Master master - cluster
N shards - cluster
Heterogeneous system with two-phase commit - still a cluster
what does the cluster do

You are asking the wrong question.
First, determine why you need a headache, for what purpose you want to add a second DBMS server and why one is not enough for you - then look in which direction you need to move to solve this problem.

A
anikavoi, 2020-02-09
@anikavoi

Clustering != sharding

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question