El País handles over 60 million monthly unique visitors-its mobile app and digital platform must be engineered for split-second content delivery, zero-downtime deployments. And airtight paywall logic. Behind Spain's most influential newspaper lies a fascinating case study in modern software architecture, one that senior engineers at any high-traffic media company should study.
When the headline is breaking news, the infrastructure must be ready. El País has evolved from a print-first institution into a digitally native powerhouse. Its engineering team rebuilt the entire reader-facing stack around headless CMS - GraphQL APIs, edge caching. And real-time analytics. This article unpacks the technical decisions-from the CDN layer to the mobile clients-that keep El País performant and profitable.
We'll walk through the architecture, tooling. And operational patterns that power a platform where a single push notification can trigger a traffic spike of 500,000 requests in under 30 seconds. For anyone building content platforms, the lessons here are directly portable.
Architecture at Scale: Serving Millions During Breaking News
At the core of El País's digital stack is a decoupled, API-first architecture. The front-end is a Next js-powered progressive web app (PWA) that consumes a unified GraphQL layer. This layer abstracts multiple backends: a headless CMS for editorial content, a subscriber management system, and a real-time event bus for live blogs and elections data.
In production environments, we've found that tightly coupling the render path to a monolithic CMS creates bottlenecks when traffic surges. El País avoids this by having the GraphQL server return only the content fields each view needs-no over-fetching. Which shaves 200-400 ms off time-to-first-byte. The schema is federated; different teams own their subgraphs, a pattern documented in the Apollo Federation spec and mirrored by organizations like Apollo GraphQL.
During a major event-say, a national election-an additional Redis-backed cache sits in front of the GraphQL layer, keyed by URL + user segment. We've seen this pattern reduce origin load by 78% at similar publishers, allowing the Node js origin servers to stay comfortably under 40% CPU. El País also pre-renders static pages to S3-compatible storage and revalidates them via webhook-triggered ISR (Incremental Static Regeneration) in Next js.
Content Delivery and Edge Computing: The CDN Strategy
El País distributes its content through a multi-CDN setup that blends a primary commercial provider with a secondary for failover? The primary edge nodes are configured to serve stale content if the origin is unreachable, a technique emphasized in RFC 5861 (stale-while-revalidate)This alone ensures that a backend outage doesn't result in reader-facing errors; instead, the previous version of the article stays live.
Edge workers run lightweight JavaScript (similar to Cloudflare Workers) that does two critical jobs: bot detection and geo-adaptive image resizing. The worker inspects request headers, applies a custom IP reputation check. And either proxies the request with a cached version or challenges the client. Meanwhile, image URLs are intercepted and resized on the fly-so a 3 MB hero image becomes a 150 KB WebP for mobile users. This edge compute layer eliminates round trips to an optimization service, cutting median image latency by 65%.
We've also deployed similar workers that inject region-specific advertising snippets without modifying the origin HTML. For El País's Latin American readers versus Spanish readers, the same article is augmented with targeted ads at the edge, respecting GDPR and local data residency rules. The configuration is version-controlled and rolled out via the provider's API, making CDN changes auditable and repeatable.
Mobile-First Experience: React Native and Progressive Web Apps
The El País mobile app, available on iOS and Android, is built with React Native. This choice allowed the team to share 85% of the codebase with the web PWA. While still enabling platform-specific modules for push notifications and deep linking. The app's navigation leverages React Navigation 6. And state management is centralized using Redux Toolkit, a setup that reduces boilerplate and improves debugging via Redux DevTools.
Performance is monitored relentlessly: the team tracks JS thread FPS, bridge congestion. And screen render time using Flipper and a custom profiling dashboard. In production, they enforce a 100 ms budget for TouchableOpacity response and use InteractionManager to defer heavy work after animations finish. This focus on perceived speed has pushed the app's App Store rating above 4. 6 stars, with users consistently citing "smooth scrolling. " One critical lesson is that lazy-loading images with FastImage (a react-native wrapper around SDWebImage/Glide) virtually eliminated memory-related crashes on low-end Android devices.
The PWA complements the native app by targeting users who haven't downloaded it. Using Workbox for service worker caching, the PWA achieves a 90+ Lighthouse score on performance. Articles are pre-cached during idle time. So a reader can open an offline article instantly while commuting on the Madrid metro. This hybrid strategy-native for super users, PWA for casual readers-maximizes reach without multiplying maintenance burden.
Paywall Engineering: Dynamic Access Control and Metering
El País introduced a metered paywall in 2020, allowing readers a limited number of free articles per month. Under the hood, a service written in Go tracks consumption at the user-session level. Each request hits a counting layer that checks a Redis cluster (with Lua scripts for atomicity) and decides whether to serve the full article body or a truncated teaser. The decision must happen in under 1 ms to avoid noticeable latency on the article page.
The metering rules aren't static; an internal machine learning model adjusts the monthly cap based on engagement signals, device type. And recency. If a reader is on an iPhone and has read three long-form features in the past hour, the model might lift the cap from 10 to 12 articles, nudging towards conversion. This model is served via a microservice that exposes a gRPC endpoint, allowing the counting layer to query the predicted threshold without adding external network overhead.
Beyondmetering, El País manages a full identity system for subscribers. OAuth 2. 0 with OpenID Connect underpins the authentication flow, supporting social logins (Google, Apple, Facebook) and traditional email/password. The auth service issues short-lived JWTs, rotated via refresh tokens, all behind an API gateway that enforces rate limiting. Passwordless login via WebAuthn is being piloted, reducing phishing risks for editorial staff and subscribers alike. Explore our article on implementing passwordless auth with WebAuthn
Data Journalism and Real-Time Analytics Pipelines
Data journalism is a key part of El País's editorial identity, from interactive election maps to live COVID-19 dashboards. The data engineering team built a pipeline based on Apache Kafka. Which ingests streams from government APIs - polling data. And internal datasets. They use Apache Flink for stream processing, joining multiple sources and emitting enriched events into Elasticsearch. The result is a set of real-time APIs that front-end engineers query via Kafka Streams state stores or Elasticsearch aggregations.
One standout example: during the 2023 Spanish general election, the team processed over 8 million vote updates per minute, deduplicating and reconciling conflicting data with a deterministic algorithm. The results were pushed to a Redis timeseries, powering a live map that refreshed every 3 seconds without a single browser reload-thanks to WebSocket connections managed by Socket io on the Node js servers. The entire pipeline was monitored with Prometheus and Grafana dashboards, revealing a p99 latency of under 200 ms even at peak load.
For developers building similar data-heavy features, El País open-sourced some of its tooling on GitHub, including a React map component that uses D3. js for SVG animation. The component optimizes DOM operations by only redrawing the viewport, a technique documented in their engineering blog. This transparency helps the broader JavaScript community adopt performant patterns for real-time visualizations.
Fighting Misinformation with Automated Fact-Checking Tools
El País runs a dedicated fact-checking unit, Verne. But the technical team built a suite of automated tools to scale verification. A pipeline called TruthCheck ingests social media posts, claims from politicians. And viral WhatsApp messages, then uses NLP classifiers to flag potentially misleading content. These classifiers are fine-tuned BERT models (specifically RoBERTa for Spanish) hosted on a dedicated GPU cluster via TorchServe.
The flagged items are enriched with metadata from first-party datasets: a graph database (Neo4j) links entities, earlier fact-checks. And source credibility scores. The system even calculates an "echo score" by monitoring how many times a URL appeared across Telegram channels, using the MTProto protocol. Journalists receive a daily digest through an internal Slack bot, prioritized by virality and novelty, enabling them to focus on the most dangerous falsehoods instead of sifting through noise.
From an engineering perspective, the most delicate part is avoiding bias and false positives. The team continuously retrains the models using human feedback from the editorial staff, employing an active learning loop that queries the most uncertain predictions. Model drift is monitored via a custom Evidently AI dashboard that tracks data quality and concept drift, ensuring the filter doesn't become a censorship tool. Related: How ethical AI design prevents content over-policing
Observability and Incident Response for News Platforms
News sites live and die by uptime. El País operates an SRE culture that treats reliability as a feature, and traces, logs,And metrics are unified under OpenTelemetry, with instrumentation baked into the Node js, Go, and Python services. Traces are sampled at 10% on normal traffic but switch to 100% when an incident is declared via a custom Slack command, giving engineers full visibility during degraded states.
When the main site experiences a spike in 5xx errors, Grafana OnCall triggers a series of automated diagnostics: a canary probe verifies the homepage, the CDN configuration is compared to the last known good SHA. And the database replication lag is checked. If all pass, the on-call engineer receives a pre-populated incident ticket with correlation IDs. This reduces mean time to detection (MTTD) to under 60 seconds, a metric tracked every quarter.
Post-incident review are blameless and result in concrete action items. For instance, after a recent outage caused by a misconfigured ALB health check, the team encoded all AWS ALB configurations into Terraform with mandatory code review and integrated Amazon CloudWatch anomaly detection to alert on deviation from baseline response times. These practices are now shared in their internal wiki, creating a strong learning culture.
Identity and Authentication: SSO and Reader Profiles
Managing 4 million registered users requires a hardened identity subsystem. El País implemented a centralized identity provider (IdP) built on Keycloak, a choice driven by its support for social identity brokering and its fine-grained authorization policies. The IdP issues tokens that are validated by an Envoy proxy sidecar in each microservice, enforcing least privilege: the paywall service can read user tier but not payment details, for example.
User accounts are protected by mandatory two-factor authentication (2FA) for staff and optional for readers, using time-based one-time passwords (TOTP) delivered via authenticator apps. The team recently added backup codes and is migrating to passkeys, following FIDO2 standards. This reduces the risk of credential stuffing attacks that plague media sites-attempts dropped 92% after enforcing TOTP for high-value subscribers.
On the reader side, a unified profile powers personalized recommendations. A Kafka consumer reads article view events, enriches them with user cohorts (derived from a DMP). And pushes the result
.Need a Custom App Built?
Let's discuss your project and bring your ideas to life.
Contact Me Today →