liveBook · Manning

Performance

As explained in Grokking Software Architecture

Performance is the measurable responsiveness and efficiency of a software system, including the time it takes to serve requests.

Performance measures how quickly a system responds and how much work it handles. Faster responses can improve the user experience, but performance has a price: tighter targets require more investment. section 2.4

Two useful ways to describe performance are:

  • Latency: how long a request takes to receive a response. section 2.4
  • Throughput: how much work the system completes per unit of time. section 2.4

Speeding up a dashboard

A dashboard that runs three slow database queries for every request can create 300 queries when 100 users visit at once. Add a cache: check it first, and, on a miss, run the queries and store the result. Later requests can return the saved summary quickly. The tradeoff is extra complexity and data that may not be fully up to date. section 2.4.4

Figure 2.8 By checking a fast cache first, the system avoids expensive database queries. A Cache Miss creates a temporary delay to fetch and save data, but each subsequent request becomes nearly instantaneous.

Shows how a cache hit avoids database queries, while a cache miss requires fetching and saving the data. section 2.4.4

Performance is a quality to balance, not a goal to maximize blindly. A social platform might favor fast page loads over perfectly up-to-date connections; the right priority depends on the business and user experience. section 1.7.3

How Grokking Software Architecture covers it

How deep it goes
Defines latency and throughput, then works through caching and its tradeoffs without detailing cache operations.
Examples
Contrasts Friendster's slow experience with faster social platforms and demonstrates caching with a database-backed dashboard.
What it assumes
Defines performance and caching directly, while using database-backed requests in its worked example.
What you can do after
Apply caching with Redis or Memcached to reduce repeated database work, while weighing added complexity and freshness.
How it connects
Connects performance to latency, throughput, caching, consistency, availability, and non-functional requirements.

Also explained in

Compare how 55 books explain performance →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Software Architecture. The section links point to the parts of the book it draws on.