What Is System Design? Functional vs Non-Functional
On this page
The demo works. Production doesn't.
A checkout feature passes every test. Payments go through, emails go out, the demo is flawless. Then Black Friday arrives, traffic is 20 times normal, and checkout takes 30 seconds or fails outright. Nothing in the feature list was wrong. What was missing was a different kind of requirement.
System design is deciding how a system is put together (its services, data stores and network boundaries) so that it meets its requirements. It sits a level above software design: instead of classes and methods, you're thinking about which parts exist, how they talk, and how they behave under load and failure.
Functional vs non-functional requirements, plus constraints
Functional requirements say what the system does: the features and business rules. "Users can search products." "Admins can void an order." They read like a product spec.
Non-functional requirements, also called quality attributes, say how well it works: speed, scale, uptime, security, cost. They rarely appear in a product spec, which is why they get skipped, and they're the ones that decide the architecture.
Same feature, both sides:
- Functional: "Process the payment."
- Non-functional: "Process the payment in under 500 ms for 99 percent of requests, stay available 99.95 percent of the time, and handle 20 times normal traffic."
Notice the numbers. "Fast" and "reliable" can't be tested or designed for. "Under 500 ms at the 99th percentile" can.
Constraints are the third input, and the one most often left unsaid: the budget, the deadline, the team's skills, the cloud you're already on, and rules like GDPR or PCI DSS. A design that needs a Kafka expert is wrong for a three-person .NET team with a six-week deadline, however elegant it is.
The quality attributes you'll meet in this roadmap: scalability (Day 2), performance (Day 3), availability and reliability (Day 4), security (Days 81 to 85) and observability (Days 86 to 88). Cost never gets a day of its own, so treat it as a requirement in every design.
How to gather non-functional requirements
Nobody hands you non-functional requirements. You ask for them:
- How many users, and how many at the busiest moment?
- What does an hour of downtime cost the business?
- Can a user ever see data a few seconds old?
- What data is personal or regulated?
If the answer is "I don't know", propose a number and write it down. A wrong number that people can argue with is more useful than none.
These answers pull against each other. Stronger consistency costs latency (Days 5 and 6), and more nines cost money (Day 4). Rank them: for a payment, correctness beats speed; for a news feed, speed beats freshness.
Example: requirements for a course enrollment system
Functional: students browse the catalog, enroll if a seat is free, and get a confirmation email; admins create and edit courses.
Non-functional:
- The last seat is never given to two students, even under many simultaneous requests.
- Catalog pages respond in under 200 ms for 95 percent of requests.
- Registration day brings 10 times normal traffic.
- 99.9 percent uptime during registration windows.
- The confirmation email arrives within a minute.
- Student personal data is encrypted at rest.
The functional list gives no hint about architecture. The non-functional list does. "10 times traffic" suggests a cache or read replica for the catalog. "99.9 percent uptime" rules out a single server. "Within a minute" lets the email go out in the background (Day 41).
"Never double-book the last seat" means the database has to enforce it, not the application. Checking seats_taken < capacity in C# and then saving lets two requests both pass the check. Making the check and the update one atomic statement can't race:
UPDATE courses
SET seats_taken = seats_taken + 1
WHERE id = 42 AND seats_taken < capacity;
-- 1 row updated: enrolled. 0 rows: the course is full.What a missing requirement costs: Knight Capital
On August 1, 2012, Knight Capital deployed new trading code to seven of its eight servers. The eighth kept running old code that the new release reactivated. In the first 45 minutes of trading, the firm lost more than 460 million dollars (SEC order, 2013). The features were fine. The missing requirement was operational: every deployment verified on every server, and a fast way to stop.
Check yourself
Put a number, a percentile and a load on it, such as "results in under 300 ms for 95 percent of queries at 500 queries per second".
Both requests read one free seat and both save. Make the check and the update one atomic database statement, or use a constraint, so the database rejects the second.
A constraint: the team's skills and the cost of operating the system. Constraints are requirements too, alongside functional and non-functional ones. A simpler design that four ASP.NET and SQL Server developers can build, debug at 3 a.m. and afford to run beats a more scalable one they can't operate safely.
A functional requirement says what the system does, such as "a student can enroll in a course with open seats". A non-functional requirement says how well it must do it, such as "enrollment responds within 300 ms at p95 during registration week" or "no course is ever overbooked". Designs are usually shaped far more by the second kind.
Systems fail at the peak. An enrollment system may be quiet most of the year and then receive most of its traffic in the first hour of registration. Designing for the average leaves you with a system that collapses exactly when it matters most.