Skip to content

Compute

Compute is where your code runs: the services that receive a request, apply the business rules and call storage, messaging and external providers. The design questions are always the same β€” how much state does it keep, how does it scale, how long can a request take, and what happens when a dependency is slow? Stateless request handlers scale by adding replicas; long or heavy work moves to background workers; spiky, short work can go serverless; and some capabilities (identity, search, notifications, analytics) are so common that they become dedicated services.

In BoxOffice, catalog, inventory and order are app servers; e-mails and PDF tickets are generated by workers; the "doors open in 1 hour" reminders are fired by a scheduler; login is the auth service; event search is the search service; and every page view and purchase feeds analytics.

Component One-liner Playground id
App Server Stateless service handling synchronous requests; scales horizontally app
Worker Background process that consumes jobs from a queue worker
Serverless Functions run on demand, billed per invocation, scale to zero serverless
Auth Service Authenticates users and issues tokens (OAuth 2.1 / OIDC) auth
Search Full-text search over an inverted index search
Scheduler Fires jobs at fixed times or intervals (cron) scheduler
Notifications Sends push, e-mail and SMS with preferences, templates and retries notifications
Analytics Collects events and turns them into metrics and reports analytics
flowchart LR
    GW[API Gateway] --> AUTH[Auth Service]
    GW --> APP[App Server<br/>catalog / order]
    GW --> SR[Search]
    APP --> Q[(Queue)]
    SCH[Scheduler] --> Q
    Q --> W[Worker]
    W --> N[Notifications]
    APP -. events .-> AN[Analytics]

App Server

What it is. The process that runs your service code β€” a Spring Boot catalog service, a FastAPI assistant β€” handling synchronous requests: parse, authorize, run business rules, call the database or other services, respond. The key design property is being stateless: no user session or data kept in local memory between requests, so any replica can serve any request and replicas can be added, removed or replaced at will.

When to use.

  • For every synchronous API that a user waits on: browsing events, holding seats, placing an order.
  • Start with one deployable (a modular monolith) and split into services only along clear boundaries (bounded contexts) or when teams and scaling needs diverge.
  • Scale horizontally behind a load balancer; autoscale on CPU, request rate or latency.

When not to (or watch out).

  • Do not do slow work inside the request (sending e-mails, generating PDFs, calling a slow provider without a timeout): move it to a worker.
  • Do not keep state in memory that must survive the replica (sessions, carts, rate-limit counters): use a cache or a database.
  • Every synchronous call to another service adds latency and a failure point; long chains of services multiply both.

Key numbers.

Metric Typical value Note
Throughput of one replica (simple CRUD over a DB) β‰ˆ hundreds to a few thousand req/s β‰ˆ illustrative; measure yours with k6 (Hands-on 2)
Concurrency limit (Little's Law) threads Γ· time per request 200 threads Γ· 0.1 s β‡’ ≀ 2,000 req/s per replica
Healthy CPU utilization target for autoscaling β‰ˆ 50–70% Headroom for spikes and the queueing "knee"
Start-up time container: seconds; JVM app: β‰ˆ 5–30 s GraalVM native images and CRaC shorten it
Garbage-collection pauses ms (modern collectors) to hundreds of ms Show up as tail-latency spikes

Failure modes.

  • Thread-pool exhaustion β€” a slow dependency holds every thread while CPU is idle; the service stops answering β†’ timeouts, circuit breakers, bulkheads (scenario cascading-failure).
  • Overload past the knee β€” at ρ β†’ 1 queueing delay explodes β†’ autoscaling with headroom, load shedding, rate limiting.
  • Memory leak β€” capacity slowly drops over hours β†’ soak tests, restarts, profiling.
  • Bad deploy β€” the error rate jumps β†’ canary releases, automatic rollback on SLO burn.
  • Stateful replica dies β€” users lose their session β†’ keep replicas stateless.

In the playground. app is a call node: each request calls every outgoing edge (sequentially by default, latencies add; parallelCalls makes them parallel, latency = max). Main parameters (defaults in parentheses): replicas (1), capacity per replica (500 req/s), latencyMs (median service time, 10 ms, lognormal), threads per replica (200, the Little's Law concurrency limit), queueLimit (200), autoscale with minReplicas, maxReplicas, targetUtil and warmupS (1, 20, 0.6, 60 s), and leakPerMin for soak tests. Edge parameters (timeoutMs, retries, backoff, circuitBreaker, fallback) protect its calls. Scenarios: monolith, scale-out, cascading-failure.

Real products.

  • Amazon EC2 β€” virtual machines.
  • Amazon ECS (with AWS Fargate) β€” managed containers without managing servers.
  • Amazon EKS β€” managed Kubernetes.
  • AWS Elastic Beanstalk β€” platform-as-a-service for web apps.
  • Compute Engine β€” virtual machines.
  • Cloud Run β€” serverless containers that scale with requests.
  • Google Kubernetes Engine (GKE) β€” managed Kubernetes.
  • Azure Virtual Machines.
  • Azure App Service β€” PaaS for web apps and APIs.
  • Azure Container Apps β€” serverless containers.
  • Azure Kubernetes Service (AKS) β€” managed Kubernetes.
  • Spring Boot (Java) and FastAPI (Python) β€” the frameworks used in the course.
  • Docker and Kubernetes β€” packaging and orchestration.
  • Resilience4j β€” timeouts, retries, circuit breakers and bulkheads for JVM services.

In the interview

"App servers are stateless, so I scale them horizontally behind the load balancer and autoscale at about 60% CPU. Each replica's real limit is its thread pool β€” threads divided by time per request β€” so every outbound call gets a timeout and a circuit breaker; otherwise one slow dependency takes the whole service down."

Learn more: Compute β€Ί Services Β· Compute β€Ί Serverless & autoscaling Β· Estimation β€Ί Queueing Β· Reliability β€Ί Patterns Β· Hands-on 1 Β· Hands-on 2


Worker

What it is. A background process that pulls jobs from a queue or stream and processes them outside the user's request: sending e-mails, rendering PDF tickets, transcoding video, calling a slow partner API, recomputing a feed. Workers are the consumers of the async world: the producer returns immediately ("your order was received") and the work happens a few seconds later, at the pace the workers can sustain.

When to use.

  • Work that is slow, heavy or unreliable and that the user does not need to wait for (BoxOffice: e-mail confirmation, PDF ticket, invoice).
  • To absorb spikes: the queue holds the backlog while workers drain it at a steady rate (scenario async-queue).
  • To retry failed work safely, with backoff and a dead-letter queue (DLQ) for the jobs that keep failing.
  • Batch jobs: nightly reconciliation of payments, re-indexing the search catalog.

When not to (or watch out).

  • When the user needs the result now (is my seat held?) β€” that is a synchronous call.
  • Delivery is usually at least once: the same job can run twice β†’ make the worker idempotent (dedupe by job/event id).
  • A queue hides overload: if producers outpace consumers for long, the backlog and the end-to-end delay grow without bound β†’ alert on consumer lag and autoscale workers on queue depth.
  • Ordering is not guaranteed by most queues; when order matters per key, use a partitioned log (Kafka) with one consumer per partition.

Key numbers.

Metric Typical value Note
Drain time of a backlog backlog Γ· (consumer rate βˆ’ producer rate) 600 k jobs Γ· (2,000 βˆ’ 1,000)/s = 10 min
Workers needed arrival rate Γ— time per job (Little's Law) 500 jobs/s Γ— 0.2 s β‡’ 100 concurrent workers
Visibility timeout / ack deadline seconds to minutes Must exceed the job's processing time
Max retries before DLQ β‰ˆ 3–10 β‰ˆ illustrative; with exponential backoff

Failure modes.

  • Poison message β€” one job always crashes the worker and is redelivered forever β†’ max receive count + DLQ.
  • Duplicate processing β€” the worker crashes after the effect but before the ack β†’ idempotent consumers, dedupe table.
  • Growing lag β€” consumers slower than producers β†’ autoscale on queue depth (KEDA), more partitions, faster code.
  • Downstream overload β€” 100 workers hammer a provider with a quota β†’ limit worker concurrency to the provider's rate limit.

In the playground. worker is a call node that sits behind a messaging node: the queue holds a backlog and the workers drain it at replicas Γ— capacity (defaults 2 Γ— 100 messages/s). Watch backlog, consumer lag and end-to-end (async) latency in the metrics panel; with Kafka/streams, parallelism is capped by min(partitions, worker replicas). Parameters: replicas, capacity, latencyMs (50 ms), autoscale. Scenarios: async-queue, video-streaming, notification-system.

Real products.

  • AWS Lambda with an Amazon SQS trigger β€” serverless workers.
  • Amazon ECS services / AWS Batch β€” containerized long-running or batch workers.
  • Cloud Run jobs and Cloud Run services fed by Pub/Sub push subscriptions.
  • Cloud Tasks β€” managed task queue that dispatches HTTP jobs to your workers with retries and rate limits.
  • Azure Functions with Service Bus or Storage Queue triggers.
  • Azure Container Apps jobs β€” event-driven containerized jobs.
  • Celery (Python), Sidekiq (Ruby), Spring Batch / Spring Kafka listeners (Java).
  • KEDA β€” Kubernetes autoscaler that scales workers on queue length or consumer lag.
  • Temporal β€” durable workflow engine for long, multi-step jobs.

In the interview

"Anything slow that the user does not wait for goes to a queue and a pool of idempotent workers: the order API answers in milliseconds, the e-mail and PDF follow seconds later. I size workers with Little's Law, autoscale them on queue depth, and send repeat failures to a DLQ."

Learn more: Compute β€Ί Async work Β· Messaging β€Ί Queues & pub/sub Β· Messaging β€Ί Semantics Β· Hands-on 7


Serverless

What it is. Functions as a Service (FaaS): you upload a function and the platform runs it per event (an HTTP request, a message, a file upload, a timer), scaling from zero to thousands of concurrent instances and billing per invocation and per millisecond of execution. You do not manage servers, but you accept the platform's limits: maximum duration, memory, concurrency quotas and cold starts (the delay when a new instance must be created).

When to use.

  • Spiky or unpredictable, short workloads: image thumbnails after upload, webhooks from the payment provider, a nightly report.
  • Glue code between managed services (a new object in storage β†’ process it β†’ write to a queue).
  • Low-traffic APIs where paying for idle servers would dominate the cost.

When not to (or watch out).

  • Latency-critical paths that cannot tolerate cold starts (hundreds of ms to seconds), unless you pay for provisioned/minimum instances.
  • Long-running or stateful work (Lambda's maximum duration is 15 minutes).
  • Constant high throughput: at steady high load, containers or VMs are usually cheaper per request.
  • Scaling fast can kill your database: 1,000 concurrent functions each opening a connection exhaust PostgreSQL β†’ connection pooler/proxy, concurrency limits.

Key numbers.

Metric Typical value Note
Cold start β‰ˆ 100 ms–1 s (Node/Python); can be seconds for JVM without snapshots Lambda SnapStart and provisioned concurrency reduce it
AWS Lambda maximum duration 15 min Published limit
AWS Lambda memory 128 MB – 10,240 MB CPU is allocated in proportion to memory
AWS Lambda default concurrency 1,000 concurrent executions per region Default quota, can be raised
Billing granularity per invocation + per ms of duration Γ— memory Free when idle (scale to zero)

Failure modes.

  • Throttling β€” the concurrency limit is reached and invocations fail (429) β†’ reserved concurrency, queue in front, raise quotas.
  • Cold-start tail latency β€” p99 dominated by new instances β†’ provisioned/minimum instances, lighter runtimes, snapshots.
  • Connection storms on the database β†’ RDS Proxy / PgBouncer, limit concurrency.
  • Retries of async invocations cause duplicates β†’ idempotent handlers.
  • Runaway cost β€” a loop (function writes to the bucket that triggers itself) β†’ guards, budgets and alerts.

In the playground. serverless is a call node with autoscaling built in: requests that need a new instance pay a cold start (coldStartMs, default 600 ms) unless provisioned instances are kept warm, and above concurrencyLimit (default 1,000) requests are throttled (429). Cost is per invocation plus GB-seconds (memGB). Compare it with an app node under the spike profile. Scenarios: serverless-burst, video-streaming.

Real products.

  • AWS Lambda β€” the reference FaaS; SnapStart and provisioned concurrency for cold starts.
  • AWS Step Functions β€” orchestrates multi-step serverless workflows.
  • Cloud Run functions (formerly Cloud Functions) β€” event-driven functions on Cloud Run.
  • Cloud Run β€” serverless containers, scale to zero.
  • Azure Functions β€” FaaS with consumption and premium plans.
  • Azure Container Apps β€” serverless containers with scale to zero.
  • Knative β€” serverless (scale to zero, event-driven) on Kubernetes.
  • OpenFaaS β€” functions on Kubernetes.
  • KEDA β€” event-driven autoscaling, including to zero.

In the interview

"Serverless is great for spiky, short, event-driven work β€” the payment webhook, thumbnails, nightly jobs β€” because it scales from zero and I pay per call. On the latency-critical purchase path I prefer warm containers: cold starts hurt the p99, and a burst of functions can exhaust the database's connections."

Learn more: Compute β€Ί Serverless & autoscaling Β· Cloud-native β€Ί FinOps Β· Case study: video streaming


Auth Service

What it is. The service that answers who are you? (authentication) and issues credentials the rest of the system can verify cheaply: usually OAuth 2.1 / OpenID Connect (OIDC) with short-lived access tokens (often JWTs, signed so any service can validate them locally) and longer-lived refresh tokens. It manages users, passwords (hashed with Argon2 or bcrypt), multi-factor authentication, social login and sessions. What may you do? (authorization) is then checked by the gateway and the services using the token's claims.

When to use.

  • Always, for any system with accounts. In BoxOffice, buying requires login; browsing does not.
  • As a separate service (or a managed identity provider) so that login spikes and security fixes do not touch the business services.
  • Centralize token validation at the API gateway; services still check fine-grained permissions (can this user cancel this order?).

When not to (or watch out).

  • Do not build your own crypto or password storage; use a proven identity provider or library.
  • Do not call the auth service on every request to validate a token β€” verify the JWT signature locally with the cached public keys (JWKS).
  • Long-lived JWTs cannot be revoked easily β†’ short expiry (minutes) + refresh tokens + a revocation list for emergencies.
  • Login is a favorite attack target β†’ rate limits, credential-stuffing protection, MFA.

Key numbers.

Metric Typical value Note
Local JWT signature check β‰ˆ microseconds to tens of Β΅s No network call
Password hash (Argon2/bcrypt) β‰ˆ 100 ms+ on purpose Slow by design to resist brute force; size login capacity for it
Access token lifetime β‰ˆ 5–15 min Refresh tokens: hours to days
Login peak (BoxOffice flash sale) many users log in minutes before 10:00 β‰ˆ illustrative; pre-login reminders spread the load

Failure modes.

  • Auth outage = total outage for logged-in features β†’ redundancy, local token validation keeps existing sessions working.
  • Login storm at a fixed time, amplified by slow password hashing β†’ autoscaling, encourage login before the sale opens.
  • Key rotation breaks validation β†’ publish new keys in the JWKS before signing with them, cache with refresh.
  • Token leakage β†’ short lifetimes, HTTPS only, secure cookie flags, PKCE for public clients.

In the playground. auth is a call node like app (parameters replicas, capacity (3,000 req/s), latencyMs (4 ms), threads, autoscale). Put it behind the gateway with an edge ratio < 1 to model that only some requests (logins, token refreshes) reach it, while the rest are validated locally. Build it into a blank design or extend flash-sale.

Real products.

  • Amazon Cognito β€” user pools (sign-up, sign-in, MFA, social login) issuing OIDC tokens.
  • AWS IAM Identity Center β€” workforce single sign-on.
  • Identity Platform β€” customer identity (OIDC, SAML, MFA).
  • Firebase Authentication β€” user auth for web and mobile apps.
  • Microsoft Entra ID β€” workforce identity.
  • Microsoft Entra External ID β€” customer identity for apps.
  • Keycloak β€” full identity and access management server (OIDC, SAML), used in Hands-on 4.
  • Ory (Kratos, Hydra), ZITADEL, Authentik β€” other open-source identity servers.
  • Spring Security β€” OAuth 2.0 resource server and client support for Java services.

In the interview

"A dedicated auth service (OIDC) issues short-lived signed JWTs; the gateway and services validate them locally with cached public keys, so auth is not on the hot path of every request. Login itself is rate-limited and protected against credential stuffing."

Learn more: Network & security β€Ί Identity Β· Network & security β€Ί Zero trust Β· Compute β€Ί Services Β· Hands-on 4


What it is. A search service answers text queries ("coldplay sΓ£o paulo", with typos) ranked by relevance, plus filters and facets (date, city, price). It is built on an inverted index: for every term, the list of documents that contain it. The index is usually a secondary copy of data whose source of truth is the database, kept up to date by events or change data capture (CDC); updates become visible after a short refresh (near-real-time).

When to use.

  • Full-text search, fuzzy matching, relevance ranking, autocomplete, faceted navigation β€” things a LIKE '%...%' in SQL does badly and slowly.
  • In BoxOffice: searching events by artist, venue, city and date.
  • Log search and analytics over semi-structured documents.
  • Hybrid search (keywords + vector similarity) for AI assistants.

When not to (or watch out).

  • Not a source of truth: no strong consistency, no multi-document transactions. Seat availability must come from inventory, not from the index.
  • Keeping the index in sync is a design task of its own (dual writes are unsafe β†’ outbox/CDC).
  • Exact lookups by id or simple filters are cheaper in the primary database.
  • Shards are fixed when an index is created in Elasticsearch/OpenSearch; resizing means reindexing.

Key numbers.

Metric Typical value Note
Query latency β‰ˆ 10–100 ms Depends on index size, query complexity and caching
Refresh interval (visibility of new docs) 1 s default in Elasticsearch/OpenSearch "Near real time"
Autocomplete budget β‰ˆ < 100 ms end to end per keystroke Usually served from a prefix index + cache
Index size β‰ˆ comparable to the raw text, varies widely β‰ˆ illustrative; depends on fields and analyzers

Failure modes.

  • Index out of sync β€” an event cancelled in the DB still appears β†’ CDC/outbox pipeline, periodic reconciliation, show availability from the source of truth.
  • Expensive queries (leading wildcards, huge aggregations) saturate the cluster β†’ query limits, timeouts, caching of popular queries.
  • Hot shards β†’ better routing/sharding, replicas for reads.
  • Reindexing under load β†’ build a new index in the background and switch an alias.

In the playground. search is a call node (parameters replicas, capacity (800 queries/s), latencyMs (25 ms), threads, autoscale). Put a cache in front of it for popular prefixes and watch the hit ratio cut its load. Scenario: search-autocomplete.

Real products.

  • Amazon OpenSearch Service β€” managed OpenSearch clusters, with a serverless option.
  • Vertex AI Search β€” managed search (keyword + semantic) over websites and data.
  • Elastic Cloud and self-managed Elasticsearch/OpenSearch on GKE are common choices.
  • Azure AI Search β€” managed full-text, vector and hybrid search.
  • OpenSearch and Elasticsearch β€” distributed search engines built on Apache Lucene.
  • Apache Solr β€” Lucene-based search platform.
  • Meilisearch, Typesense β€” lightweight engines with typo tolerance, good for instant search.
  • PostgreSQL full-text search β€” enough for small catalogs.

In the interview

"Search is a secondary index: the database stays the source of truth, changes flow to OpenSearch through CDC or an outbox, and results are near-real-time (about a second behind). Availability shown at checkout always comes from the inventory service, never from the search index."

Learn more: Databases β€Ί Specialized Β· Messaging β€Ί Patterns Β· Case study: search autocomplete


Scheduler

What it is. A component that triggers work by time rather than by a request: "every day at 03:00 reconcile payments", "every minute release expired seat holds", "send a reminder 24 h before each show". Simple schedulers run cron expressions; distributed ones make sure each job runs once even with several replicas (leader election or a lock), keep history, retry failures and handle many delayed jobs (one per order or per show).

When to use.

  • Periodic maintenance: releasing expired holds in inventory, cleaning data, rotating keys, refreshing materialized views.
  • Business timers: reminders before an event, abandoned-cart nudges, opening the sale at 10:00 sharp.
  • Batch pipelines: nightly exports to the data warehouse, reports.

When not to (or watch out).

  • Thundering herd at round times: thousands of jobs set for 00:00 fire together β†’ spread start times (jitter).
  • Running cron on every app replica executes the job N times β†’ one scheduler, a distributed lock, or leader election.
  • A job that runs longer than its interval overlaps itself β†’ forbid concurrent runs.
  • For "do X when Y happens", an event is better than polling on a timer.

Key numbers.

Metric Typical value Note
Cron granularity 1 minute Standard cron; Kubernetes CronJob too
Delayed jobs per day (BoxOffice reminders) one per order per show β‰ˆ illustrative: 60 k seats β‡’ 60 k reminders per sold-out show
Distributed lock lease a few Γ— the expected job duration Too short β‡’ two runners; too long β‡’ slow takeover
Missed-run policy skip or catch up Decide explicitly

Failure modes.

  • Double execution β€” two replicas both fire β†’ leader election, locks with fencing tokens, idempotent jobs.
  • Missed execution β€” the scheduler was down at 03:00 β†’ catch-up policy, monitoring "job did not run" (dead-man's switch alert).
  • Burst at the hour overloads queues and providers β†’ jitter, rate-limited dispatch through a queue.
  • Clock and time-zone bugs (daylight saving time, UTC vs local) β†’ schedule in UTC, test DST transitions.

In the playground. scheduler generates its own periodic load: jobs every everyS seconds (defaults 1,000 every 60 s, all at once unless spreadS spreads them) into its targets (usually a queue that feeds workers), independent of the client traffic. Increase N to see the burst at each tick and how a queue smooths it. Scenario: notification-system.

Real products.

  • Amazon EventBridge Scheduler β€” managed cron, rate and one-time schedules at large scale, targeting Lambda, SQS, Step Functions and more.
  • Cloud Scheduler β€” managed cron that calls HTTP endpoints or publishes to Pub/Sub.
  • Cloud Tasks β€” scheduled (delayed) individual tasks.
  • Azure Functions timer trigger β€” cron-based functions.
  • Azure Logic Apps β€” workflows with recurrence triggers.
  • Kubernetes CronJob β€” cron for containers.
  • Quartz (Java) and Spring's @Scheduled with ShedLock for single execution across replicas.
  • Apache Airflow β€” scheduler for data pipelines (DAGs).
  • Temporal β€” durable timers and schedules for workflows.

In the interview

"Time-based work goes through one scheduler that enqueues jobs, not cron on every replica: a lock or leader election guarantees one run, jobs are idempotent in case it runs twice, and start times get jitter so midnight is not a thundering herd."

Learn more: Compute β€Ί Async work Β· Distributed β€Ί Consensus Β· Case study: notification system


Notifications

What it is. A service that turns "tell this user X" into actual messages on the right channel β€” push (APNs, FCM), e-mail, SMS, in-app β€” respecting user preferences and opt-outs, rendering templates, deduplicating, rate-limiting per user and retrying when providers fail. It sits behind a queue: producers publish "order confirmed" events and the notification service fans them out to channels at a pace the external providers accept.

When to use.

  • Whenever several parts of the system need to reach users: order (confirmation), inventory (hold about to expire), scheduler (show reminders), marketing.
  • To isolate the business services from the quirks of providers (quotas, outages, different APIs).
  • To have one place for preferences, quiet hours, localization and auditing ("was this user notified?").

When not to (or watch out).

  • Never send notifications synchronously inside the purchase request; publish an event and return.
  • Push and SMS are best effort: important information must also be in the app or e-mail.
  • Do not notify twice: at-least-once delivery requires a dedupe key per (user, notification).
  • Respect laws and user consent (opt-in for marketing, unsubscribe links).

Key numbers.

Metric Typical value Note
Fan-out after a sold-out show 60 k confirmations in minutes β‰ˆ illustrative BoxOffice number
E-mail provider sending quota per-second and per-day limits e.g. Amazon SES accounts start in a sandbox with low limits
Delivery latency push: seconds; e-mail: seconds to minutes Not guaranteed
Retries exponential backoff, then DLQ Keep the user-visible delay bounded

Failure modes.

  • Provider outage or throttling (429) β†’ queue + retries with backoff, a second provider for critical channels.
  • Duplicate notifications β†’ idempotency key per message, dedupe store.
  • Notification storm β€” a bug or a big event sends millions at once β†’ per-user rate limits, global send rate, kill switch.
  • Bad template breaks every message β†’ template tests, staged rollout.

In the playground. notifications is a call node usually placed after a queue: it consumes the backlog and calls the external email provider, whose quota (default 100 sends/s) and random outages make retries and DLQs necessary. Parameters: replicas, capacity (1,000 req/s), latencyMs (15 ms), autoscale; on its edge to the provider, timeoutMs, retries, backoff. Scenarios: notification-system, flash-sale.

Real products.

  • Amazon SNS β€” pub/sub plus mobile push and SMS delivery.
  • Amazon SES β€” e-mail sending.
  • Firebase Cloud Messaging (FCM) β€” push to Android, iOS and web.
  • Pub/Sub + Cloud Run to build the notification pipeline.
  • Azure Notification Hubs β€” push at scale.
  • Azure Communication Services β€” e-mail, SMS and chat APIs.
  • Novu β€” open-source notification infrastructure (templates, preferences, multi-channel).
  • ntfy β€” simple self-hosted push.
  • Queues (RabbitMQ, Kafka) + workers to build your own pipeline.

In the interview

"Services publish events; a notification service consumes them, checks preferences, renders templates and sends through per-channel queues, so a slow e-mail provider never blocks a purchase. Every message has a dedupe key because delivery is at least once, and sends are rate-limited to the provider's quota."

Learn more: Compute β€Ί Integrations Β· Messaging β€Ί Queues & pub/sub Β· Case study: notification system Β· Hands-on 7


Analytics

What it is. The pipeline that turns raw events (page views, searches, holds, purchases, clicks) into numbers people can use: dashboards ("tickets sold per minute"), funnels (how many who held a seat actually paid?), fraud signals, recommendations. Events are collected asynchronously, usually through a stream, then processed in real time (stream processing) and/or in batch in a data warehouse. It is the read side of the business, kept away from the transactional databases.

When to use.

  • Product and business metrics, A/B tests, funnels, sales dashboards for event organizers.
  • Real-time counters during the flash sale (sold, held, waiting room size).
  • Click analytics of a URL shortener, view counts of a video platform.

When not to (or watch out).

  • Do not run analytical queries on the production OLTP database: a big GROUP BY can slow down purchases β†’ replicate to a warehouse (CDC/ELT).
  • Do not make the user request wait for the analytics write: fire-and-forget into a stream.
  • Analytics numbers are usually approximate and slightly delayed; do not use them to enforce invariants (seat counts).
  • Personal data: anonymize/aggregate and respect retention rules (LGPD/GDPR).

Key numbers.

Metric Typical value Note
Event volume several events per user action β‰ˆ illustrative: 2 M fans Γ— 20 events β‰ˆ 40 M events in the sale hour
Event size β‰ˆ 0.5–1 KB (JSON) β‰ˆ illustrative
Freshness streaming: seconds; batch: minutes to hours Choose per use case
Approximate counting HyperLogLog β‰ˆ 1–2% error with a few KB Unique visitors without storing every id

Failure modes.

  • Analytics backlog delays dashboards β†’ it is async; scale consumers, accept lag, never block the purchase path.
  • Double counting with at-least-once delivery β†’ event ids and dedupe, or tolerate small errors.
  • Schema drift β€” a producer changes the event shape and breaks pipelines β†’ schema registry, versioned events.
  • Hot partitions β€” one huge event floods one partition β†’ partition by a well-distributed key.

In the playground. analytics is a call node normally attached asynchronously (through a stream, kafka or pubsub node) so it is off the request path: watch its consumer lag grow during spikes without affecting user latency. Parameters: replicas, capacity (2,000 events/s), latencyMs (20 ms). Scenarios: event-fanout, url-shortener.

Real products.

  • Amazon Data Firehose β€” loads streaming events into S3, Redshift or OpenSearch.
  • Amazon Redshift and Amazon Athena β€” warehouse and SQL over files in S3.
  • Amazon Managed Service for Apache Flink β€” stream processing.
  • BigQuery β€” serverless data warehouse with streaming ingestion.
  • Dataflow β€” managed Apache Beam for stream and batch processing.
  • Azure Event Hubs + Azure Stream Analytics β€” ingestion and real-time processing.
  • Microsoft Fabric / Azure Data Explorer β€” analytics platform and fast log/telemetry analytics.
  • Apache Kafka + Apache Flink or Spark Structured Streaming β€” streaming pipelines.
  • ClickHouse, Apache Druid, Apache Pinot β€” real-time OLAP databases.
  • Apache Superset, Grafana β€” dashboards.

In the interview

"Analytics is off the critical path: services emit events to Kafka, a stream processor keeps real-time counters, and everything lands in a warehouse for reporting. Numbers may be a few seconds late and slightly approximate β€” and that is fine, because invariants like seat counts never come from analytics."

Learn more: Databases β€Ί Specialized Β· Messaging β€Ί Kafka Β· Case study: URL shortener Β· Case study: news feed