Ravindra BagaleCourses & study guides मराठी Track your progress

Chapter 16: Amazon RDS

AWS Cloud

16.2 Engines and where the database lives

Engine Application compatibility to verify Common default port; verify actual endpoint
MySQL The application supports the chosen MySQL version and features 3306
MariaDB The application supports the chosen MariaDB version and behavior 3306
PostgreSQL You prefer PostgreSQL (psql, a different SQL dialect) 5432
Oracle An application that requires Oracle Database 1521
SQL Server An application requires the selected SQL Server edition and features 1433
IBM Db2 The application supports the selected Db2 edition, version and features 50000
Amazon Aurora A MySQL-compatible or PostgreSQL-compatible cluster with shared storage 3306 or 5432

Later creation lessons use MySQL; the expanded exercises on this page use local SQLite and supplied placement data. Aurora speaks the MySQL or PostgreSQL protocol, but its failover and replicas are not the same as standard RDS Multi-AZ. Do not mix the two pictures (section 16.7).

Storage. Standard non-Aurora RDS uses EBS-based storage managed through RDS. General Purpose and Provisioned IOPS SSD choices have service-specific limits. Select a supported configuration from measured workload and capacity needs; the actual achieved I/O rate also depends on the DB instance and workload. These local exercises need no cloud storage.

The database is a separately managed resource. A DB subnet group identifies eligible subnets in its VPC. Ordinary regional DB instance groups cover at least two AZs, including for Single-AZ instances; Local Zone requirements differ. A supported Multi-AZ DB cluster needs three-AZ coverage. Group membership does not itself create a standby. Inspect existing groups and their VPC, AZs and spare addresses rather than assume default resources exist. The application connects through the supplied DNS endpoint and configured port, not by mounting the managed database storage.

1. Follow one equipment search through the system

A college has a catalogue of laboratory equipment. Students search for an oscilloscope, a microscope or a measuring instrument before arranging a practical session. The website displays a friendly search box, but somewhere a database must hold the equipment identifier, laboratory, available quantity and maintenance status. Understanding that location helps you configure the application and investigate incorrect results.

Suppose the application asks for equipment code EQ201. It uses a database driver to send a query to a database engine. The engine finds the relevant row and returns its values. The application formats those values into a page. The browser, application, driver, engine and stored record each perform a different job. Saying “the data is in AWS” does not identify which part should be inspected when the page shows the wrong laboratory.

This lesson builds a precise map from the application to its records. You will distinguish the engine from the logical database, read an endpoint without confusing it with an AWS API address, and explain how a subnet group describes eligible placement. You will also see why two subnets do not automatically mean two running database instances.

The examples use fictional equipment and network labels. The exercises run locally with Python and SQLite or inspect small supplied configuration models. They do not create cloud resources. Their limitations are explicit because a successful local experiment cannot demonstrate AWS network permission, database failover or production performance.

At the end, try describing the catalogue in one sentence containing its engine, logical database, service environment and connection destination. If you can explain each item separately, the later create-and-connect lessons become a sequence of understandable choices instead of a list of fields to copy.

2. The engine is the software that understands database work

A database engine receives operations, interprets its supported query language, reads or changes records and coordinates access. MySQL and PostgreSQL are different engines. Their SQL has many shared ideas, such as selecting rows and filtering them, but they also differ in syntax, data types, extensions, administration and supported features. An application depends on more than the word SQL.

For the catalogue, a query might request the equipment name and available quantity for EQ201. The engine must identify the table, interpret the condition and return values in the expected form. When the application updates a quantity, the engine's transaction and constraint facilities help coordinate valid changes. The application must still express the correct operation and handle the result appropriately.

RDS manages supported engine configurations. Its non-Aurora choices include MySQL, MariaDB, PostgreSQL, Oracle Database, Microsoft SQL Server and IBM Db2. Amazon Aurora is another AWS relational database family with MySQL-compatible and PostgreSQL-compatible variants and a distinct cluster architecture. Check current support for the engine, edition, version, Region and feature combination you actually need.

Engine names describe software compatibility, not the programming language of the website
Engine familyUseful selection questionCommon port
MySQLDoes the application and its driver support the selected MySQL version and features?3306
MariaDBDoes the application support this MariaDB version, rather than merely assuming all MySQL behavior is identical?3306
PostgreSQLAre the required SQL behavior and extensions supported in the intended RDS configuration?5432
Oracle DatabaseWhich Oracle edition, features and licensing arrangement does the application require?1521
Microsoft SQL ServerWhich SQL Server edition, features and driver behavior must be retained?1433
IBM Db2Which supported Db2 edition, version and application requirements apply?50000
Aurora MySQL or Aurora PostgreSQLWhich compatibility family and cluster behaviors have been tested?Commonly 3306 or 5432 respectively

These port values are common defaults, not proof of a particular resource's configuration. Read the actual endpoint and port from the intended database. A MySQL service can use a supported non-default port; changing a port does not change the engine. Similarly, sending a PostgreSQL client to port 3306 does not turn it into a MySQL client.

A programming language does not force a particular engine. A Java, Python, PHP, Go, JavaScript or .NET application can use an appropriate supported driver for different databases. Existing application dependencies, team skills and workload requirements matter. Avoid statements such as “Windows application means SQL Server” unless you have identified a real dependency rather than an association.

3. Separate the resource name from the database and table names

An RDS DB instance identifier names a managed resource for AWS operations. For example, a fictional resource called college-catalogue-test can appear in a resource inventory. It is not automatically the name of every logical database inside that environment. An application might connect to that instance and select a logical database named equipment_catalogue.

Within that logical database, a table named equipment holds rows such as EQ201, Oscilloscope, Electronics Lab, quantity 12. Another table might hold maintenance inspections. The table name describes the kind of records; the row identifier describes one record. Keeping these levels separate prevents an incorrect diagnosis when a connection succeeds but the application cannot find its intended table.

The exact meaning of database and schema varies by engine. MySQL commonly uses database and schema as equivalent namespace terms. PostgreSQL has databases containing schemas, with tables inside those schemas. Oracle has its own database, container and schema arrangements. Learn the selected engine's naming rules rather than moving a MySQL naming assumption into every other service.

Two environments can each contain a table named equipment and still hold different information. A development catalogue might intentionally contain three demonstration items while production contains the college's actual inventory. The table name alone cannot prove that the application reached the right environment. Verify the connection destination and an agreed environment marker or known record.

For example, a test release can successfully retrieve EQ201 from a demonstration copy even though staff expect the current production quantity. There may be no SQL error at all. The operation is valid against the wrong source. This is why configuration review should identify the account, Region, resource, logical database and intended data set rather than stop at “login succeeded.”

In the first local lab, two database files deliberately contain the same table name and equipment identifier with different quantities. You will select each destination explicitly and observe different results. SQLite's arrangement is not a model of every RDS engine's namespace rules; it makes the narrower lesson visible that a familiar table name does not establish data identity.

4. A DB instance supplies an operating environment

In standard RDS, a DB instance is an isolated database environment with an engine and selected resource characteristics. The instance class relates to compute and memory capacity. Storage settings relate to the space and performance characteristics for data and logs. These are service configuration choices around the engine; they are not rows in the catalogue.

Imagine that the catalogue grows from a few demonstration records to a large inventory with frequent searches. Increasing compute capacity can provide more processing resources, but it does not automatically create a useful index or correct an application that fetches unnecessary rows. Storage capacity determines how much can be retained, while query design determines much of the work required to retrieve it.

A DB instance can contain user-created databases as supported by the selected engine and its limits. Several logical databases in one instance still share important operating resources and events. An engine maintenance operation or resource pressure can affect more than one application using that instance. Logical organization is useful, but it should not be mistaken for complete infrastructure isolation.

The AWS account and Region identify the management context in which you inspect the instance. A resource name copied from a colleague's screenshot is not enough if your console is showing another account or Region. Before assuming a resource is missing, verify those contexts and your permissions. Do not create a duplicate merely because the first inventory screen was empty.

Standard RDS does not provide ordinary SSH access to inspect its underlying host filesystem. You use supported service operations and database clients. RDS Custom has a different, engine-specific scope; it is not a switch for unrestricted access to standard MySQL. For the catalogue's standard-RDS design, understand the provided resource fields and engine tools rather than search for a Linux login command.

5. The client and driver connect the application to the engine

A command-line client is a program you can use to connect and issue database operations interactively. A driver is a library an application uses to communicate with the engine. Installing a client or importing a driver does not create a remote database, configure its network access or populate its tables. It supplies one component of the conversation.

The driver must understand the server's protocol and the selected authentication and encryption options. It sends the query in the expected form, receives results and reports errors to the application. A port number is only part of locating the service; it cannot translate an incompatible protocol or repair an unsupported query feature.

Consider a catalogue request that connects successfully and then receives a table-not-found error. That tells you something different from a network timeout. The first has reached a database conversation far enough to attempt an operation; investigate the selected database, schema, table and privileges. A timeout before connection needs investigation of destination, path and service reachability.

Connection settings commonly include host, port, logical database or engine-specific service name, identity, authentication material and TLS options. Different drivers express these fields differently. Some use a structured object, some a connection string and some environment-derived settings. Read the driver's syntax rather than paste a JDBC URL into an unrelated client and expect it to understand the same format.

Configuration should be observable without exposing secrets. An application can report a safe environment label, selected engine and database name while withholding credentials and sensitive data. When investigating a wrong destination, record only what the team's handling rules allow. The teaching examples use fictional values and never require placing a real password into a page or source file.

6. Put Region, Availability Zone and subnet on the correct map

A Region is a geographic area containing multiple Availability Zones. An Availability Zone provides an isolated infrastructure location within that Region; it is not another name for the entire Region. A VPC is a logically isolated network in a Region, and a subnet belongs to one Availability Zone. A VPC can therefore contain subnets distributed across several AZs.

Draw one Region boundary for the college's example. Inside it draw one VPC boundary. Then place subnet A in one AZ and subnet B in another AZ. Avoid drawing the entire VPC inside only one AZ, because that would hide the regional scope of the VPC. Also avoid drawing one ordinary subnet across both zones; its zone association is specific.

These boundaries answer different questions. Region affects where the resource is operated and which regional service options are available. An AZ is relevant to placement and failure isolation. A VPC identifies the logical network. A subnet identifies an address range and zone-local placement. None of those labels, by itself, grants the catalogue application permission to read a database table.

The EC2 application and database can use different subnets within the same VPC, but RDS does not universally require them to be in different subnets. A design often separates application and database subnets for deliberate routing and organization. Explain that design choice through the actual configuration, rather than teaching the separation as an unavoidable property of a managed database.

Likewise, placing the application in a private subnet is not a universal prerequisite for talking to a private RDS endpoint. Reachability depends on the path and controls. A resource in a public subnet can still communicate with a private address through the appropriate VPC routing and permissions. The word public describes a network arrangement; it does not require every connection to leave through the internet.

For cross-account or shared-network work, compare stable resource identifiers and the relevant Availability Zone identifiers rather than assuming a familiar display label proves identical placement. In this lesson's fictional model, AZ-A, AZ-B and AZ-C are labels only. They are not actual resource names to paste into a console or command.

7. A DB subnet group lists eligible locations

A DB subnet group is a collection of subnets supplied to RDS for database placement in a VPC. It is a selection of network locations, not a database engine, a security group or an instruction to start one database in every subnet. When RDS places a DB instance, it uses an appropriate subnet and address from that arrangement.

For ordinary regional DB instance deployments, the subnet group spans at least two Availability Zones, including when you choose a Single-AZ DB instance. This provides eligible placement for supported operations and future configuration changes. A Local Zone DB subnet group is a documented special case with different requirements. Read the rules for the intended deployment rather than making “two” universal across every RDS product.

Suppose the catalogue subnet group contains a subnet in AZ-A and another in AZ-B. A Single-AZ instance currently placed in AZ-A is still a Single-AZ instance. The unused eligible subnet in AZ-B is not evidence of an active standby. You must inspect the deployment configuration to know whether another running database resource exists.

Address availability also matters. Subnets need spare addresses for operations such as recovery and scaling. Counting the total size of a VPC does not show whether the relevant subnet has room. A large unused subnet outside the DB subnet group does not automatically solve an address shortage in the selected placement.

Before using an existing group, inspect its VPC, member subnets, AZ coverage and relevant network mode support. A name containing default is not a guarantee that the group is present, suitable or unchanged. Accounts can have default resources removed or modified, and creation workflows can offer automatic setup. Inspect the actual state instead of assuming a tutorial's starting environment.

For the catalogue, prepare a small inventory with one row per selected subnet: resource identifier, VPC identifier, AZ, address range and available addresses. Add notes about routes and network controls in separate columns. This separates placement evidence from access evidence and makes it easier to find a mistaken subnet before creating anything.

8. Read the deployment type before counting database copies

The terms Single-AZ DB instance, Multi-AZ DB instance and Multi-AZ DB cluster describe different arrangements. Do not shorten all of them to “RDS with several subnets” and expect the picture to remain accurate. Eligible subnets and running database roles belong on separate parts of the drawing.

A conventional Single-AZ DB instance runs in one AZ. A conventional Multi-AZ DB instance deployment maintains a primary and a synchronous standby in another AZ. That standby is used for availability and does not serve ordinary application read traffic. The application must still handle connection interruption and the supported failover behavior.

An RDS Multi-AZ DB cluster for supported MySQL or PostgreSQL configurations has a writer and two readable instances in three different AZs. Its DB subnet group must cover at least three AZs. This is a distinct deployment type, with its own endpoints and behavior. A two-AZ DB instance diagram cannot simply be renamed to describe it.

The catalogue might use a small Single-AZ environment for an explicitly disposable learning exercise, while a real deployment has different availability requirements. Explain the selected purpose and its consequences. “Production” is not a configuration value that makes every design suitable, and adding another instance does not correct a missing backup history or an incorrect update query.

Draw running roles with solid boxes and eligible but unused locations with an outline. Label the writer, standby or reader according to the chosen product. Then trace which destination the catalogue uses for a write and which destination, if any, serves a report. This drawing should answer an operation question, not merely display several database icons.

The local placement worksheet below checks a few of these distinctions. It rejects two subnets in the same zone when the selected ordinary deployment requires multiple zones. It also shows that the same two-zone group can be eligible for a Single-AZ configuration without implying a standby. It is a learning model, not an AWS validator or proof of deployability.

9. A DNS endpoint finds a service; it does not identify a table

The application normally uses the database's DNS endpoint as its host. DNS resolves that name to an address, and the client connects to the configured port using the appropriate protocol. After reaching the service, authentication and logical database selection determine what operations the connection can perform.

Use the endpoint supplied for the intended resource instead of inventing one from its name. In explanations, a reserved example hostname such as catalogue-db.example.invalid is a clear placeholder; it is not a working RDS endpoint. A copied screenshot value can refer to another account or an obsolete environment. Confirm the live resource fields through an authorised inventory.

RDS can change the underlying address during supported infrastructure operations, including failover. Hard-coding an observed address bypasses the intended hostname arrangement and can leave the client pointing at the wrong destination. Applications also need sensible connection handling; using DNS does not guarantee that an already broken connection repairs itself.

Distinguish the database endpoint from the regional RDS service API endpoint. The AWS CLI uses a regional management API to describe or modify resources. A SQL client connects to the database endpoint to query records. Permission to call a management API and permission to query a table are different. One successful operation does not establish the other.

Also distinguish a database hostname from a URL for a website. A SQL client generally expects its driver's host and connection fields, not a browser URL beginning with https and a page path. TLS can protect a database protocol without making that protocol ordinary HTTPS. Follow the actual driver documentation rather than adding URL components by analogy.

If the client reaches the service but selects the wrong logical database, DNS has done its job while the application configuration remains wrong. Troubleshooting should preserve that distinction. Record the successful stage and investigate the next one, instead of repeatedly changing network rules after the database has already returned a clear SQL error.

10. RDS storage is managed through the service

Standard non-Aurora RDS DB instances use EBS-based storage for database and log data. That underlying technology does not mean the application receives an ordinary EBS device to format and mount. You select supported storage settings through RDS, and the managed environment uses the storage for its database engine.

Compare this with a self-managed database on EC2. There the operator may attach a suitable volume, inspect its identity, prepare a filesystem when appropriate and configure the engine's data location. Standard RDS has a different operating boundary. Commands such as a filesystem format or mount on the application EC2 machine do not resize or attach the RDS database storage.

Capacity, IOPS and throughput describe different aspects of storage. Capacity is the amount of space. IOPS expresses operations per second. Throughput expresses the amount transferred per unit of time. A workload's I/O size and other system limits influence how these relate. Provisioning an IOPS value does not guarantee that an arbitrary query or undersized DB instance achieves that rate.

Choose among the supported storage options for the engine and deployment, using current limits and measured needs. General Purpose and Provisioned IOPS SSD families have different characteristics. Do not copy an EC2 gp3 limit into an RDS calculation just because the label looks familiar. The RDS service has its own documented configurations and engine-specific behavior.

Older material can also describe options that are no longer current. As of this lesson's review on 23 November 2026, AWS documents magnetic RDS storage as deprecated and unavailable for new DB instances; snapshot restoration to magnetic storage ended on 1 July 2026. The practical lesson is to check current service rules before treating an old storage screenshot as a valid choice.

For the college catalogue, measure the stored data and logs, expected growth, query workload and recovery needs separately. Buying storage capacity does not create a recovery plan, and enabling a backup mechanism does not create extra working space for normal writes. The engine, operating resources and historical copies work together but solve different problems.

11. Aurora compatibility does not mean identical architecture

Aurora offers MySQL-compatible and PostgreSQL-compatible database families. Compatibility can allow existing applications and drivers to work with the selected family, subject to supported versions and features. It does not mean every administrative command, extension, replication arrangement or performance characteristic is identical to the corresponding standard engine deployment.

An Aurora cluster includes database compute and a cluster storage volume spanning multiple AZs. A typical cluster has one writer and can include reader instances. Even a cluster with only one DB instance is still a cluster because the storage architecture is separate from the count of compute instances. Do not infer the entire design from a single database icon.

The writer handles data modifications. Reader instances can serve suitable read work, and endpoint types help applications address the intended roles. Creating readers does not automatically rewrite the catalogue's connection configuration or route each query according to its business meaning. The application and selected connection arrangement need an explicit plan.

For example, showing an equipment update immediately after saving it may require different freshness behavior from generating yesterday's usage report. A compatible SQL statement alone does not answer where to send that operation. Test the intended reader and writer behavior with the actual engine family, driver and application expectations.

When evaluating Aurora for an existing catalogue, list the database features the application uses and rehearse them. Include schema creation, representative queries, error handling, authentication and maintenance procedures. Keep this evaluation separate from a generic performance claim. A service comparison becomes useful when it explains which tested behavior matters to the application.

12. Investigate from the first unproven stage

Use the catalogue request as a chain of evidence. First confirm the application selected the intended environment configuration. Then confirm the hostname and port, the network path, the negotiated connection and authentication, the selected logical database, and finally the query result. Each stage adds information; none should be assumed merely because a later-looking screen is attractive.

If the hostname does not resolve from the relevant environment, changing a SQL grant will not repair that name-resolution problem. If authentication fails after the service responds, randomly enlarging a subnet will not correct the identity. If the result contains two demonstration instruments instead of twelve catalogue instruments, inspect the destination and data meaning before replacing the server.

Write observations in a form another student can check: the error category, the operation attempted, the environment involved and the next focused check. Avoid copying credentials into notes. “The catalogue query succeeded against the demonstration marker” is far more informative than “RDS is broken,” because it identifies both the success and the remaining mistake.

Also preserve uncertainty. A timeout is not enough to prove that a security group is the only cause. A successful connection is not enough to prove the correct database. A group spanning two zones is not enough to prove a standby. Good troubleshooting narrows the unknowns using evidence instead of turning one symptom into a universal explanation.

13. Lab: identify two catalogues with identical table names

Use Python 3 with its SQLite module for this local experiment. Save the code as catalogue_names.py, then run python3 catalogue_names.py. It creates two temporary files containing the same table and equipment code, inspects them and removes the temporary directory. Both copies contain fictional learning data.

  1. Predict the two quantities before running the script. The table name is equipment in both files, and the equipment code is EQ201 in both.
  2. Read the environment marker returned with each result. Decide which result satisfies the explicit college-training-copy expectation.
  3. Explain why the query can execute correctly while returning the wrong environment's information.
  4. Inspect the missing-destination result. Read-only inspection prevents an accidental new empty file from disguising the wrong path.
  5. Keep the printed evidence with your explanation and confirm the cleanup message.
from pathlib import Path
from tempfile import TemporaryDirectory
import sqlite3


def create_catalogue(path, label, quantity):
    connection = sqlite3.connect(path)
    try:
        connection.execute('CREATE TABLE environment (label TEXT NOT NULL)')
        connection.execute('INSERT INTO environment VALUES (?)', (label,))
        connection.execute('CREATE TABLE equipment (code TEXT PRIMARY KEY, name TEXT, quantity INTEGER)')
        connection.execute('INSERT INTO equipment VALUES (?, ?, ?)',
                           ('EQ201', 'Oscilloscope', quantity))
        connection.commit()
    finally:
        connection.close()


def inspect(path):
    connection = sqlite3.connect(path.resolve().as_uri() + '?mode=ro', uri=True)
    try:
        label = connection.execute('SELECT label FROM environment').fetchone()[0]
        row = connection.execute(
            'SELECT code, name, quantity FROM equipment WHERE code=?', ('EQ201',)
        ).fetchone()
        return label, row
    finally:
        connection.close()


with TemporaryDirectory(prefix='catalogue-names-') as directory:
    root = Path(directory)
    college, demo = root / 'college.db', root / 'demo.db'
    create_catalogue(college, 'college-training-copy', 12)
    create_catalogue(demo, 'demonstration-copy', 2)
    first, second = inspect(college), inspect(demo)
    print('First destination:', first)
    print('Second destination:', second)
    assert first[1][:2] == second[1][:2]
    assert first[1][2] != second[1][2]
    assert second[0] != 'college-training-copy'
    print('Same table and equipment code; wrong environment: REJECT')
    assert first == ('college-training-copy', ('EQ201', 'Oscilloscope', 12))
    print('Expected environment and equipment values: PASS')
    try:
        inspect(root / 'unknown.db')
    except sqlite3.OperationalError:
        print('Unknown inspection destination rejected')
    else:
        raise AssertionError('Unknown path should not open')
    assert not (root / 'unknown.db').exists()
assert not root.exists()
print('Temporary catalogues cleaned')

The engine in both cases is SQLite. The application uses the same inspection function and query text, yet changing the selected file changes the records. This demonstrates a useful configuration principle without pretending SQLite files reproduce RDS networking. A real RDS client selects its remote service and logical database using the appropriate driver settings instead of this local file path.

The environment marker is deliberately simple for teaching. It is not a security mechanism, and an attacker or mistaken administrator could change it. In a real deployment, combine approved inventory, connection configuration, permissions and representative record checks. A label helps explain intent; it does not replace trustworthy resource identification.

For an extension, add another fictional equipment row to only the demonstration copy and predict the result of querying that identity against each destination. Keep the changes inside this temporary exercise. Describe the expected missing-row case before running it. The purpose is to practice distinguishing an absent record from a failed connection.

14. Lab: check eligible subnets separately from running roles

This worksheet uses supplied Python dictionaries, not an AWS account. Save it as catalogue_placement.py and run python3 catalogue_placement.py. The fictional inventory represents ordinary regional IPv4 subnets in one VPC. The code evaluates only the explicitly listed teaching rules and prints planned roles from the selected deployment type.

One VPC, two eligible subnets and one selected primaryThe VPC contains subnet A in AZ A and subnet B in AZ B. Both are members of the DB subnet group. The selected Single-AZ example has a primary only in subnet A; subnet B is eligible placement, not a running standby.One regional VPCDB subnet group: A and BSubnet A in AZ-APrimary DB instanceSubnet B in AZ-BEligible network locationNo standby in this example
Group membership describes eligible network locations. The selected deployment determines the running database roles.
from copy import deepcopy
from ipaddress import ip_network

# Fictional ordinary regional IPv4 inventory, not AWS resource identifiers.
subnets = [
    {'id': 'A', 'vpc': 'college', 'region': 'example-region',
     'az': 'AZ-A', 'cidr': '10.44.10.0/24', 'free': 20},
    {'id': 'B', 'vpc': 'college', 'region': 'example-region',
     'az': 'AZ-B', 'cidr': '10.44.20.0/24', 'free': 18},
    {'id': 'C', 'vpc': 'college', 'region': 'example-region',
     'az': 'AZ-C', 'cidr': '10.44.30.0/24', 'free': 16},
]


def review(group, deployment):
    requirements = {'single-instance': (2, ['primary']),
                    'multi-az-instance': (2, ['primary', 'standby']),
                    'multi-az-cluster': (3, ['writer', 'reader', 'reader'])}
    zones_needed, planned_roles = requirements[deployment]
    if len({row['id'] for row in group}) != len(group):
        raise ValueError('Repeated subnet identity')
    if any(row['vpc'] != 'college' or row['region'] != 'example-region'
           for row in group):
        raise ValueError('Wrong VPC or Region')
    if len({row['az'] for row in group}) < zones_needed:
        raise ValueError('Insufficient distinct AZ coverage')
    networks = [ip_network(row['cidr']) for row in group]
    if any(not network.subnet_of(ip_network('10.44.0.0/16'))
           for network in networks):
        raise ValueError('Outside example VPC address range')
    if any(a.overlaps(b) for i, a in enumerate(networks)
           for b in networks[i + 1:]):
        raise ValueError('Overlapping example subnets')
    if any(row['free'] < 1 for row in group):
        raise ValueError('No spare address in an eligible subnet')
    return planned_roles


def rejected(label, group, deployment):
    try:
        review(group, deployment)
    except ValueError as error:
        print(label + ': REJECT - ' + str(error))
    else:
        raise AssertionError('Invalid example was accepted')


assert review(subnets[:2], 'single-instance') == ['primary']
print('Two-zone group; Single-AZ selection plans ONE primary')
assert review(subnets[:2], 'multi-az-instance') == ['primary', 'standby']
print('Same group; Multi-AZ instance selection plans primary + standby')
rejected('Cluster with only two zones', subnets[:2], 'multi-az-cluster')
assert review(subnets, 'multi-az-cluster') == ['writer', 'reader', 'reader']
print('Three-zone cluster worksheet: writer + two readers')
bad = deepcopy(subnets[:2]); bad[1]['az'] = 'AZ-A'
rejected('Two subnets in the same AZ', bad, 'single-instance')
bad = deepcopy(subnets[:2]); bad[1]['vpc'] = 'another-vpc'
rejected('Mixed VPCs', bad, 'single-instance')
bad = deepcopy(subnets[:2]); bad[1]['free'] = 0
rejected('No spare address', bad, 'single-instance')
bad = deepcopy(subnets[:2]); bad[1]['cidr'] = '10.44.10.0/25'
rejected('Overlapping subnet ranges', bad, 'single-instance')
print('Model checks only: no AWS validation or resources created')

Notice that the first two passing examples use exactly the same two subnets. The selected deployment changes the planned roles. The subnet group did not create a standby by itself. The cluster example needs three distinct zones in this model, while two differently named subnets in the same zone still fail the ordinary two-zone requirement.

The spare-address check is intentionally minimal. One spare address passing this worksheet is not proof that a real subnet has sufficient capacity for the planned workload, maintenance and recovery events. A real review includes current service requirements, actual available addresses and the operational plan. The example also excludes Local Zones, IPv6 support, quotas, engine availability and network permissions.

Before reading each rejection message, identify the changed field. Then explain the failed requirement in one sentence. For the overlap case, use the actual address ranges to show why one is inside the other. For the VPC case, explain why similar-looking private addresses do not make two resource inventories part of the same logical network.

Finish by drawing the selected configuration from the returned roles. Keep eligible subnets visible even when no database role is placed in one. Add the application and label its configured endpoint separately. Another student should be able to tell which facts came from the inventory and which came from the deployment choice.

15. Interview questions with complete reasoning

1. Explain engine, DB instance, logical database and table using the catalogue.

The engine is the database software, such as MySQL, that executes supported operations. The RDS DB instance is the managed environment supplying the engine and operating resources. The logical database organizes application objects according to the engine's rules, and equipment is a table containing individual equipment rows. A client connects to a service and selects the intended database context; naming the table alone does not identify the correct environment.

2. A DB subnet group covers two AZs. Does that prove the database has a standby?

No. It proves eligible subnet coverage, assuming the inventory is accurate. A Single-AZ instance can use an ordinary two-zone group without a running standby. Inspect the deployment type and current resource state. A conventional Multi-AZ DB instance has a standby, while a supported Multi-AZ DB cluster has a writer and readable instances with different requirements. Group membership and running topology are separate evidence.

3. Why should an application use the supplied endpoint rather than an observed IP?

The hostname is the intended connection destination while the underlying address can change during service operations. Hard-coding the observed address can leave the application tied to an obsolete destination. The application still needs correct DNS and connection behavior; the hostname does not guarantee uninterrupted in-flight work. Also use the actual database endpoint and port, rather than the regional AWS management API address.

4. Can the same equipment table name return different correct query results?

Yes. Two environments can each contain that table and hold different records. A query can be valid and successful against a demonstration database while being wrong for the intended college catalogue. Verify the destination, logical database or schema, expected environment and meaningful record values. The local lab demonstrates this with identical equipment codes and different quantities, without relying on a query error to reveal the mistake.

5. RDS uses EBS-based storage. Should the application server mount that volume?

For standard non-Aurora RDS, no. The service manages the database storage environment, and the application communicates using a database client. It does not receive that storage as an ordinary device to format or mount on its EC2 host. Self-managed MySQL on EC2 has a different boundary where the team may manage attached storage directly. Identify the service arrangement before choosing an operating-system command.

6. A MySQL application connects to Aurora MySQL. Has compatibility been fully demonstrated?

A connection demonstrates only part of compatibility. Test the queries, data types, features, administration requirements and application behavior that matter. Aurora also has a distinct cluster and storage design, so endpoint roles, failover and reader behavior require their own understanding. Similar protocol support is useful, but it does not make all operational characteristics identical or prove the workload's correctness.

16. Quiz: choose the missing evidence

Open each answer after making a prediction. Try to name the specific boundary involved rather than answer with a service slogan.

1. The AWS CLI can describe the instance. Does the catalogue account have SQL read permission?

That has not been established. The CLI management operation and the SQL connection use different authorization contexts. Verify the database identity and its privileges for the intended table using an appropriate authorised check.

2. Two subnets have different CIDRs but the same AZ. Do they supply two-AZ coverage?

No. Different address ranges do not create different infrastructure zones. Check the actual zone association of each subnet and the selected deployment's coverage requirement.

3. The client uses port 5432. Can you conclude the resource is PostgreSQL?

The port is consistent with a common PostgreSQL default, but it is not proof. Verify the engine and actual endpoint configuration. Port numbers identify service listeners; they do not independently establish protocol or resource identity.

4. The website is on a public subnet. Must its private database traffic use the internet?

No. Its destination and effective routing determine the path. A resource in a public subnet can communicate with private addresses through the appropriate VPC path and controls. The subnet label alone does not describe every connection.

5. A table query returns the demo marker. Should you first increase storage?

No. The evidence points to the selected environment or data configuration. Confirm the intended destination and meaningful records before changing capacity. A successful query against the wrong source is a configuration problem, not proof of insufficient storage.

17. Revision cards and practice tasks

Engine
The software and supported behavior that interpret database operations. Verify version and feature compatibility with the application.
Instance identifier
The managed resource's name in its AWS context. It is not automatically the logical database or table name.
Logical database and schema
Engine-specific organization of objects. Learn the chosen engine's hierarchy and privileges instead of assuming all engines use the same terminology.
Subnet group
Eligible network locations for the intended RDS deployment. Membership does not create a running standby.
Endpoint and port
The service destination used by the driver. Keep them separate from the AWS management API endpoint and the selected table.
Storage boundary
Standard RDS storage is operated through service facilities. The application uses the database protocol rather than mounting the database's managed volume.

Task 1: Write a configuration card for a fictional PostgreSQL catalogue. Include the engine family, resource label, database and schema names, placeholder host, actual-to-be-verified port, driver and authentication approach. Mark which values are invented for the exercise and which would require an authorised resource inventory.

Task 2: Draw a Single-AZ instance and a conventional Multi-AZ DB instance using the same eligible two-zone subnet group. Label every running role. Then draw the separate three-zone Multi-AZ DB cluster arrangement. Explain the difference between a readable instance and a standby in those drawings.

Task 3: Write a short troubleshooting note for a successful query returning the wrong quantity. Include the observed environment marker, expected source and next focused check. Do not invent a network failure when the evidence shows the engine already returned a result.

Task 4: Explain the storage boundary to a classmate who wants to run a filesystem resize command on the web server to enlarge RDS. Identify which machine that command would affect and which supported service settings should instead be investigated. Include workload and capacity evidence rather than proposing an arbitrary larger value.

Primary sources