Architectural reasons behind sitemeta, blogs, home, site and DOMAIN_CURRENT_SITE redundancy

How do they relate to each other? What are their different uses within WordPress?

define(‘DOMAIN_CURRENT_SITE’, $_SERVER[‘HTTP_HOST’]);

define(‘PATH_CURRENT_SITE’, “https://wordpress.stackexchange.com/”);

These 2 are not the same thing, e.g. for a WP site whose root is at example.com/wp DOMAIN_CURRENT_SITE will be example.com, and PATH_CURRENT_SITE will be /wp

define(‘SITE_ID_CURRENT_SITE’, 1);

define(‘BLOG_ID_CURRENT_SITE’, 1);

Site != blog. In a multisite you can have multiple blogs, so BLOG_ID_CURRENT_SITE represents the current blog. 1 being the first blog or root blog.

Site ID on the other hand refers to the network. Networks have no UI, and a multisite install in 99% of cases has a single network. There is some confusion about terminology, hence site not network

wp_options.home

wp_options.siteurl

Home URL is the homepage of the site, but that doesn’t mean the same thing as the sites URL, the two are almost always the same, but they can be different

wp_site

wp_blogs

These tables store different things. Blogs are stored in wp_blogs, and wp_site lists the networks those blogs belong to. As I mentioned before sites have a single network unless you specifically set out to add more

wp_sitemeta.siteurl

The sites table contains a domain and path, this is a more complete version. This table also has other information, such as who is the network admin etc

What is the processing architecture behind?

Networks contain blogs, blogs contain posts.

E.g. .org is a multisite install, as it wordpress.com.

Networks allow you to have multiple multisites on the same install. This way 2 multisites can share the same users and code yet users of 1 multisite never see anything of the other. This might be so that local school authorities can give schools blogs, but administer separately.

The use cases of networks are rare, and can also be accomplished in many cases by several multisite installs with SSO

Are there any drawings?

Probably but I doubt it’d be as helpful as you’d think. Check the table scheme wiki page on the codex

Why do we need (at least) 5 similar variables to just denote where the website is at?

Because they don’t denote the same things, and they just happen to have the same values when on a single site. It’s rare that they diverge but they can and do.

Also some of them do not store the same thing as the others