commit d9e4657a17b5f2a32b37534f355737433770a88a
Author: David G. Johnston <david.g.johnston@gmail.com>
Date:   Mon Nov 9 23:07:29 2020 +0000

    v0012-architecture-suggestions

diff --git a/doc/src/sgml/architecture.sgml b/doc/src/sgml/architecture.sgml
index b7589f9a4f..bd22ada939 100644
--- a/doc/src/sgml/architecture.sgml
+++ b/doc/src/sgml/architecture.sgml
@@ -28,10 +28,11 @@
    </para>
 
    <para>
-    The first step when an Instance starts is the start of the
+    All aspects of an Instance are launched and managed using a single primary
+    process termed the
     <glossterm linkend="glossary-postmaster">Postmaster</glossterm>.
-    It loads the configuration files, allocates Shared Memory, and
-    starts the other processes of the Instance:
+    It loads configuration files, allocates Shared Memory, and
+    starts the other collaborating processes of the Instance:
     <glossterm linkend="glossary-background-writer">Background Writer</glossterm>,
     <glossterm linkend="glossary-checkpointer">Checkpointer</glossterm>,
     <glossterm linkend="glossary-wal-writer">WAL Writer</glossterm>,
@@ -39,9 +40,10 @@
     <glossterm linkend="glossary-autovacuum">Autovacuum</glossterm>,
     <glossterm linkend="glossary-stats-collector">Statistics Collector</glossterm>,
     <glossterm linkend="glossary-logger">Logger</glossterm>, and more.
-    Later, the Postmaster starts
+    Later, the Postmaster listens on its configured system port(s) and in response
+    to client connection attempts launches
     <glossterm linkend="glossary-backend">Backend</glossterm> processes
-    which communicate with clients and handle their requests.
+    to which it delegates authentication, communication, and the handling of their requests.
     <xref linkend="tutorial-ram-proc-file-figure"/> visualizes the processes
     of an Instance and the main aspects of their collaboration.
    </para>
@@ -62,14 +64,6 @@
     </mediaobject>
    </figure>
 
-   <para>
-    When a client application tries to connect to a
-    <glossterm linkend="glossary-database">database</glossterm>,
-    this request is handled initially by the Postmaster. It
-    starts a new Backend process, which handles all further
-    client's requests.
-   </para>
-
    <para>
     Client requests like <command>SELECT</command> or
     <command>UPDATE</command> usually lead to the
@@ -84,9 +78,9 @@
    <para>
     Shared Memory is limited in size and it can become necessary
     to evict pages. As long as the content of such pages hasn't
-    changed, this is not a problem. But in Shared Memory also
-    write actions take place. Modified pages are called dirty
-    pages or dirty buffers and before they can be evicted they
+    changed, this is not a problem. But writes directly modify
+    the pages in Shared Memory. Modified pages are called dirty
+    pages (or dirty buffers) and before they can be evicted they
     must be written to disk. This happens regularly by the
     Checkpointer and the Background Writer processes to ensure
     that the disk version of the pages are up-to-date.
@@ -98,7 +92,7 @@
     <glossterm linkend="glossary-wal-record">WAL record</glossterm>
     is created from the delta-information (difference between the
     old and the new content) and stored in another area of
-    Shared Memory. The parallel running WAL Writer process
+    Shared Memory. The concurrently running WAL Writer process
     reads them and appends them to the end of the current
     <glossterm linkend="glossary-wal-record">WAL file</glossterm>.
     Such sequential writes are faster than writes to random
@@ -108,8 +102,8 @@
    </para>
 
    <para>
-    Second, the transfer of dirty buffers from Shared Memory to
-    files must take place. This is the primary task of the
+    Second, the instance transfers dirty buffers from Shared Memory to
+    files. This is the primary task of the
     Background Writer process. Because I/O activities can block
     other processes, it starts periodically and
     acts only for a short period. Doing so, its extensive (and
@@ -123,14 +117,8 @@
     <glossterm linkend="glossary-checkpoint">Checkpoints</glossterm>.
     A Checkpoint is a point in time when all older dirty buffers,
     all older WAL records, and finally a special Checkpoint record
-    are written and flushed to disk. Heap and index files,
-    and WAL files are now in sync.
-    Older WAL is no longer required. In other words,
-    a possibly occurring recovery, which integrates the delta
-    information of WAL into heap and index files, will happen
-    by replaying only WAL past the last-recorded checkpoint.
-    This limits the amount of WAL to be replayed
-    during recovery in the event of a crash.
+    are written and flushed to disk.
+    Older WAL files are no longer required to recover the system from a crash.
    </para>
 
    <para>
@@ -141,8 +129,10 @@
     less common). Options and details are covered
     in the backup and restore section (<xref linkend="backup"/>).
     For our purposes here, just note that the WAL Archiver process
-    can be enabled and configured to run a script on filled WAL
-    files &mdash; usually to copy them to a remote location.
+    can be enabled and configured to run a script on completed WAL
+    files &mdash; usually to copy them to a remote location. Note
+    that when a Checkpoint record is written to the WAL the current
+    file is immediately completed.
    </para>
 
    <para>
@@ -166,20 +156,29 @@
     A <glossterm linkend="glossary-server">server</glossterm> contains one or more
     <glossterm linkend="glossary-db-cluster">database clusters</glossterm>
     (<glossterm linkend="glossary-db-cluster">clusters</glossterm>
-    for short). Each cluster contains three or more
-    <glossterm linkend="glossary-database">databases</glossterm>.
-    Each database can contain many
-    <glossterm linkend="glossary-schema">schemas</glossterm>.
-    A schema can contain
+    for short). By default each newly initialized cluster contains three
+    <glossterm linkend="glossary-database">databases</glossterm>
+    (one interactive and two templates, see <xref linkend="app-initdb"/>).
+    Each database can contain many user-writable
+    <glossterm linkend="glossary-schema">schemas</glossterm>
+    (public, by name and permissiveness, by default) and three system generated
+    user-facing schemas (pg_catalog, pg_temp, and information_schema).
+    Schemas contain
     <glossterm linkend="glossary-table">tables</glossterm>,
     <glossterm linkend="glossary-view">views</glossterm>, and a lot
-    of other objects. Each table or view belongs to a single schema
-    only; they cannot belong to another schema as well. The same is
-    true for the schema/database and database/cluster relation.
+    of other objects.
     <xref linkend="tutorial-cluster-db-schema-figure"/> visualizes
     this hierarchy.
    </para>
 
+   <para>
+    Every object uniquely resides in a single schema,
+    though a single client connection can access multiple schemas within
+    the same database simultaneously. Special configuration is required to
+    access multiple databases, even within the same cluster, from a single
+    client connection.
+   </para>
+
    <figure id="tutorial-cluster-db-schema-figure">
     <title>Cluster, Database, Schema</title>
     <mediaobject>
@@ -196,61 +195,12 @@
     </mediaobject>
    </figure>
 
-   <para>
-    A cluster is the outer container for a
-    collection of databases. Clusters are created by the command
-    <xref linkend="app-initdb"/>.
-   </para>
-
-   <para>
-    <literal>template0</literal> is the very first
-    database of any cluster. Database <literal>template0</literal>
-    is created during the initialization phase of the cluster.
-    In a second step, database <literal>template1</literal> is generated
-    as a copy of <literal>template0</literal>, and finally database
-    <literal>postgres</literal> is generated as a copy of
-    <literal>template1</literal>. Any
-    <glossterm linkend="app-createdb">new databases</glossterm>
-    of the cluster that a user might need,
-    such as <literal>my_db</literal>, will be copied from the
-    <literal>template1</literal> database. Due to the unique
-    role of <literal>template0</literal> as the pristine original
-    of all other databases, no client can connect to it.
-   </para>
-
-   <para>
-    Every database must contain at least one schema because all
-    <glossterm linkend="glossary-sql-object">SQL Objects</glossterm>
-    must be contained in a schema.
-    Schemas are namespaces for SQL objects and ensure
-    (with one exception) that the SQL object names are used only once within
-    their scope across all types of SQL objects. E.g., it is not possible
-    to have a table <literal>employee</literal> and a view
-    <literal>employee</literal> within the same schema. But it is
-    possible to have two tables <literal>employee</literal> in two
-    different schemas. In this case, the two tables
-    are separate objects and independent of each
-    other. The only exception to this cross-type uniqueness is that
-    <glossterm linkend="glossary-unique-constraint">unique constraints
-    </glossterm> and the according unique index
-    (<xref linkend="indexes-unique"/>) use the same name.
-   </para>
-
-   <para>
-    Some schemas are predefined. <literal>public</literal>
-    acts as the default schema and contains all SQL objects
-    which are created within <literal>public</literal> or
-    without using an explicit schema name. <literal>public</literal>
-    should not contain user-defined SQL objects. Instead, it is
-    recommended to create a separate schema that holds individual
-    objects like application-specific tables or views.
-    <literal>pg_catalog</literal> is a schema for all tables and views of the
-    <glossterm linkend="glossary-system-catalog">System Catalog</glossterm>.
-    <literal>information_schema</literal> is a schema for several
-    tables and views of the System Catalog in a way that conforms
-    to the SQL standard.
-   </para>
-
+   <!-- The reference to initdb should suffice here -->
+   
+   <!-- DGJ: And these next two paragraphs probably can be trimmed down to usage
+        with the incorporation of the references to default objects above, which
+        ideally would point the user to reference material for the same -->
+   
    <para>
     There are many different SQL object
     types: <firstterm>database, schema, table, view, materialized
@@ -261,8 +211,8 @@
     strict hierarchy: All <firstterm>database names</firstterm>,
     all <firstterm>tablespace names</firstterm>, and all
     <firstterm>role names</firstterm> are automatically
-    available throughout the cluster, independent from
-    the database or schema in which they were defined originally.
+    available throughout the cluster, not just the database in which
+    the SQL Command was executed.
     <xref linkend="tutorial-internal-objects-hierarchy-figure"/>
     shows the relation between the object types.
    </para>
@@ -286,7 +236,7 @@
   </sect1>
 
   <sect1 id="tutorial-directories">
-   <title>The physical Perspective: Directories and Files</title>
+   <title>The Physical Perspective: Directories and Files</title>
 
    <para>
     <productname>PostgreSQL</productname> organizes long-lasting (persistent)
@@ -297,7 +247,7 @@
     variable <literal>PGDATA</literal> points to this directory.
     The example shown in
     <xref linkend="tutorial-directories-figure"/> uses
-    <literal>data</literal> as the name of this root directory.
+    <literal>pgdata</literal> as the name of this root directory.
    </para>
 
    <figure id="tutorial-directories-figure">
@@ -317,16 +267,16 @@
    </figure>
 
    <para>
-    <literal>data</literal> contains many subdirectories and
+    <literal>pgdata</literal> contains many subdirectories and
     some files, all of which are necessary to store long-lasting
     as well as temporary data. The following paragraphs
     describe the files and subdirectories in
-    <literal>data</literal>.
+    <literal>pgdata</literal>.
    </para>
 
    <para>
-    <literal>base</literal> is a subdirectory in which one
-    subdirectory per database exists. The names of those
+    <literal>base</literal> is a subdirectory containing one
+    subdirectory per database. The names of those
     subdirectories consist of numbers. These are the internal
     Object Identifiers (OID), which are numbers to identify
     the database definition in the
@@ -335,7 +285,7 @@
 
    <para>
     Within the database-specific
-    subdirectories, there are many files: one or more for
+    subdirectories there are many files: one or more for
     every table and every index to store heap and index
     data. Those files are accompanied by files for the
     <link linkend="storage-fsm">Free Space Maps</link>
@@ -348,10 +298,12 @@
     Another subdirectory is <literal>global</literal> which
     contains files with information about
     <glossterm linkend="glossary-sql-object">Global SQL Objects</glossterm>.
-    One type of such Global SQL Objects are
-    <glossterm linkend="glossary-tablespace">tablespaces</glossterm>.
-    In <literal>global</literal> there is information about
-    the tablespaces; not the tablespaces themselves.
+   </para>
+
+   <para>
+    In <literal>pg_tblspc</literal>, there are symbolic links
+    that point to directories containing SQL objects
+    that exist within a non-default tablespace.
    </para>
 
    <para>
@@ -370,17 +322,12 @@
    </para>
 
    <para>
-    In <literal>pg_tblspc</literal>, there are symbolic links
-    that point to directories containing SQL objects
-    that exist within a non-default tablespace.
-   </para>
-
-   <para>
-    In the root directory <literal>data</literal>
+    In the root directory <literal>pgdata</literal>
     there are also some files. In many cases, the configuration
     files of the cluster are stored here. If the
     instance is up and running, the file
     <literal>postmaster.pid</literal> exists here
+    (by default)
     and contains the process ID (pid) of the
     Postmaster which started the instance.
    </para>
