🎓 A1Learner
🔍
0 of 47 lessons completed

High-Level Design First

A high-level design is a sketch that names the main parts of a system and how they connect. Detail comes later, after the sketch holds together.

Parts, jobs, and one path

A sketch can live as plain data before any drawing happens. The path line shows the order a request follows.

parts = [
    ("client", "asks for a page"),
    ("app server", "builds the answer"),
    ("database", "stores the data"),
]
path = " -> ".join(name for name, job in parts)
print("request path:", path)
for name, job in parts:
    print(f"{name}: {job}")

Connections join the parts

Connections show where a request travels next. A straight line of parts has one fewer connection than it has parts.

connections = [("client", "app server"), ("app server", "database")]
for left, right in connections:
    print(f"{left} -> {right}")
print("connections:", len(connections))
print("parts:", len(connections) + 1)

One request, step by step

A trace walks a single request through the sketch. Each step names the part acting at that moment.

steps = [
    "client sends a request",
    "app server receives the request",
    "database supplies the data",
    "app server builds the answer",
    "client receives the answer",
]
for number, step in enumerate(steps, start=1):
    print(f"step {number}: {step}")

Example

parts = [
    ("client", "asks for a profile page"),
    ("app server", "builds the profile page"),
    ("database", "stores the profiles"),
]
path = " -> ".join(name for name, job in parts)
print("request path:", path)
for name, job in parts:
    print(f"{name}: {job}")
print("parts in the sketch:", len(parts))

Key points

  • Client: the program that asks, like a browser or an app.
  • App server: the program that takes a request and builds the answer.
  • Database: a store that keeps data so the system can find the data again.
  • High-level design: the main parts and their connections, with detail left for later.

In this example, the sketch names every main part and its job before any part gets detailed treatment, and the path shows how the parts connect.

Note

Give each part one job in the sketch, stated in one line.

Try it Yourself

Edit the code, then press Run.

Running is simulated

Exercise

What belongs in a high-level design first?