0

From Software Architecture and Design Illuminated

In the master-slave architecture, slaves provide replicated services to the master, and the master selects a particular result among slaves by certain selection strategies. The slaves may perform the same functional task by different algorithms and methods or by a totally different functionality.

...

Master-slave architecture is used for the software system where reliability is critical. This is due to the replication (redundancy) of servers.

It should be noted that in database schema design, the terms master-slave or parent-child are employed to specify the dependency of one entity on another. If the master node is deleted then the slave node has reason to stay. This concept does not apply to the discussion here.

Is it correct that there are two or more different meanings of the term "master-slave" or "master-worker"?

  1. Why does the concept of "master-slave" in "in database schema design" "does not apply to the discussion" in software architecture?
  2. In database schema design, what do the following mean:

    • "the dependency of one entity on another"

    • "If the master node is deleted then the slave node has reason to stay"?

  3. In the software architecture of master-slave, "if the master node is deleted then the slave node has reason to stay", does the slave node has no reason to stay?
  4. Also in distributed systems with data replications, is the concept of "leader and follower" the same as "master and slave" in software architecture?

    From https://en.wikipedia.org/wiki/Master/slave_(technology)

    In database replication, the master database is regarded as the authoritative source, and the slave databases are synchronized to it.

Thanks.

11
  • 4
    I've never heard related database entities referred to as master/slave, only as parent/child or some kind of mapping. – Dan Wilson Mar 26 '20 at 14:17
  • 2
    "If the master node is deleted then the slave node has reason to stay" is most probably a typo, I guess the intended statement is "If the master node is deleted then the slave node has no reason to stay" – Doc Brown Mar 26 '20 at 14:19
  • @DocBrown In the software architecture of master-slave, "if the master node is deleted then the slave node has reason to stay", does the slave node has reason to stay? – Tim Mar 26 '20 at 14:23
  • 1
    Your "first principle" is effective communication. It matters less the precise definitions of these words than "are you communicating effectively with your coworkers." – Robert Harvey Mar 26 '20 at 14:44
  • 1
    [shrug] You were the one who decided to make two posts about this. Who's the one being demanding? – Robert Harvey Mar 26 '20 at 17:00
2

The "master/slave" concept usually relates to clustering. In services that need to scale outwards, or provide a fail-over concept the terms have general meaning.

I have never heard of database tables or schemas being referred to as master/slave. I have only ever heard them referred to as parent/child. In databases, an "Entity" is the logical representation of a Table, so the whole master/slave concept does not make sense at all. I recommend you take the reference material's advice: "This concept does not apply to the discussion here." In fact, if that paragraph were removed the concept would be much clearer.

At the most general abstract level, "masters" control and "slaves" work. The nature of how that controller/worker relationship plays out is slightly different depending on the type of application. With that oversimplified definition, you can understand why master/slave goes by new names these days.

In Replication

With replication, the concept is that the "master" node is considered "live" until some event happens when the master is no longer up. At that time the "slave" node becomes the "master". The architecture exists to preserve the availability of your data.

Master: The live instance of a database or file system that allows both reads and writes.

Slave: The reserve instance that only accepts writes from the master. In some cases, the slave is read-only to all other clients so reads can be load balanced.

Examples include SQL Server clustering, Windows Distributed File System

In Scale-Out Clusters

With scale out clusters, the data is spread throughout all of the "slave" nodes which helps scale out. The "master" nodes coordinate a number of aspects to ensure the health of the cluster. They have a summary view of what nodes have capacity, or even how the data is distributed across the "slaves". In the event that a "slave" node is lost, the "master" nodes coordinate redistributing data that used to live on that slave. Similarly, they redistribute data when a new "slave" node is introduced to the cluster.

Master: The server node or nodes that monitor the health of the slave nodes and coordinate work.

Slave: The server nodes that hold data and perform data updates and retrieval.

Examples include Elastic Search clusters, Kubernetes clusters

2
  • Thanks. Do slaves accept read requests directly from clients? Do clients have to know which replica is a master and which is a slave? Doesn't that make clients dependent on the replication configuration? – Tim Mar 27 '20 at 14:48
  • @Tim: "Do slaves accept read requests directly from clients?" – That depends on the particular implementation. There is no global Software Engineering Police that checks whether every single master-slave implementation on the planed behaves exactly the same. "Do clients have to know which replica is a master and which is a slave?" – That depends on the particular implementation. "Doesn't that make clients dependent on the replication configuration?" – That depends on the particular implementation. – Jörg W Mittag Mar 28 '20 at 9:43
5

I think you are looking at some very specific examples, which are tending to hide the general concept.

Conceptually, the term is simply referring to an architecture where you have a controller that has many tasks that need to be done, and a pool of workers that are given those tasks to do.

Anything beyond that is getting rather application-specific.

5
  • Thanks (1) in distributed systems with data replications, is the concept of "leader" the same as "master" in either "database schema design" or software architecture? (2) How shall I distinguish between client-server and master-worker architectures? When a client requests some resource from a server, is there a master-worker relationship between the client and the server? In a master-worker relationship, do a master and its worker(s) also have a client-server relationship? softwareengineering.stackexchange.com/questions/406975 – Tim Mar 26 '20 at 14:03
  • I often find this being referred to as "client/server" or "worker pools." Today, when I hear the term "master/slave," I think database replication. But yes, there's historic ambiguity in the use of almost any terminology. – Mike Robinson Mar 26 '20 at 14:36
  • @Tim: The concept of "leader" means exactly what whoever is using the word says it means. The concept of "master" means exactly what whoever is using the word says it means. The concept of "leader" means the same thing as "master" IFF the person who is using those two words says it does. – Jörg W Mittag Mar 26 '20 at 15:10
  • @Tim people are deliberately avoiding the terms "master" and "slave" these days. So expect mixed terminology from different people. – Simon B Mar 26 '20 at 15:16
  • @Tim: Master/slave is about a master issuing orders to a slave. Client/server is about communication roles, which is a different issue; for example, a client might be a master, or a slave, or neither. If you want more information about how relationships compare, you may want to ask a new question; there's no reason for people to explain alternative relationships here as they weren't asked about. – Nat Mar 26 '20 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.