What if we told you that the political campaign of José Antonio Kast ran on a cloud-native architecture that would make most startups envious?

In the 2021 Chilean presidential election, Kast's campaign employed advanced software engineering practices-from real-time data pipelines to programmable communications-to reach millions of voters. While most analyses focus on his far‑right rhetoric, the technical backbone that powered his digital outreach reveals a sophisticated stack of cloud services, open‑source tooling, and platform policy evasions. This article dissects that infrastructure, offering senior engineers a behind‑the‑scenes look at how a modern political campaign operationalizes software at scale.

We'll examine how Kast's team integrated AWS Lambda functions for voter segmentation, used Twilio APIs for mass WhatsApp messaging and exploited Facebook's ad platform to deliver micro‑targeted content-all while navigating Chile's strict electioneering laws. By the end, you'll have actionable insights for building high‑throughput, policy‑aware applications.

The Cloud‑Native Architecture Powering a Presidential Campaign

Kast's digital operation was never a simple website and a Facebook page. During the final weeks of the 2021 runoff against Gabriel Boric, his team deployed a microservices‑oriented architecture on Amazon Web Services, leveraging ECS Fargate for containerized worker nodes. These services handled voter registration verification - donation processing, and recommendation engine calculations for door‑to‑door canvassing routes.

Logs from the campaign's public API endpoints (accessible via the Chilean Electoral Service's transparency board) showed a steadily growing throughput of 500 requests per second during the last 48 hours of the campaign. This required auto‑scaling rules based on CloudWatch metrics, with Spot Instances to cut costs. "We spent more on Twilio than on compute," a former campaign tech lead remarked in a private Slack archive later leaked to local media.

The architecture also relied on synchronous WebSocket connections (RFC 6455) for live rally streaming. Kast's team used Amazon CloudFront with Lambda@Edge to authenticate viewers via a custom OAuth 2. 0 flow-users had to provide a Chilean RUT number to access the stream, a requirement that later sparked privacy concerns.

Cloud infrastructure diagram for a large‑scale political campaign using AWS services including EC2, Lambda, CloudFront. And DynamoDB

Data Pipeline and Voter Analytics: From SQL to Real‑Time Dashboards

Kast's data team ingested polling data from OCR'd paper forms (using Tesseract and custom Python scripts) and combined it with scraped social media engagement metrics. The pipeline-orchestrated with Apache Airflow-loaded data into Amazon Redshift clusters. Consumption occurred via Metabase dashboards, which campaign field managers accessed from mobile devices.

One notable pattern: the campaign used probabilistic identity resolution via the Kast‑Boric Voter File, a label‑swapped dataset trained on historical voter rolls. This allowed them to infer voting propensity for undecided voters without contacting them directly. While legal under Chilean law, the methodology resembles techniques used in fraud detection systems (e g., building a gradient‑boosted decision tree with XGBoost on a 30‑feature vector).

Real‑time alerts were triggered when a known supporter's probability of voting dropped below a threshold. The team used AWS SNS to push notifications to volunteer organizers, who then made phone calls via Amazon Connect. This feedback loop reduced the mean time to re‑engagement from 48 hours to just 90 minutes.

Communication Platforms: WhatsApp, Telegram. And Twilio Integration

WhatsApp was Kast's primary broadcast channel. The campaign employed the WhatsApp Business API through a Twilio connector, sending templated messages to opt‑in users. Twilio's documentation (available at Twilio WhatsApp API docs) describes the exact endpoint used: /v1/Services/{service_sid}/Messages. Kast's team configured a custom webhook to automatically unsubscribe users who replied with "STOP," leveraging Twilio's built‑in compliance features.

Telegram served as the coordination tool for 10,000+ volunteers. Groups were organized by commune (Santiago, Valparaíso, etc. ) using bots that deployed AWS Lambda functions to auto‑assign permissions. One bot, named ElLiderBot, allowed dynamic polling of the membership-each poll was a DynamoDB transaction that updated a strongly consistent table.

The campaign's SMS gateway sent over 2 million messages during the final week. Costs were kept low by using Amazon Pinpoint with opt‑out lists maintained in a PostgreSQL database. A bug in the opt‑out logic (race condition in the upsert statement) led to a minor scandal when 1,200 unsubscribed users received a reminder to vote. This incident highlights the importance of transactional consistency in high‑throughput communication systems.

Targeted Advertising and Programmatic Media Buying on Social Networks

Kast's digital ads relied heavily on Facebook's Political Ad API. The campaign used custom audiences built from email lists obtained during primaries. And they implemented lookalike modeling to reach 500,000 new potential voters. Facebook's Ad Library reports show that Kast's page spent approximately $1. 2 million during the runoff-a 400% increase from the first round.

Key targeting parameters included:

  • Geographic: Regions with high abstention rates (e g, and, Biobío)
  • Behavioral: Users who engaged with pages about public safety.
  • Retargeting: Visited the official Kast website but did not register.

The tech stack behind ad serving included custom React modules for A/B testing creative variants, using a hierarchical Bayesian model to evaluate click‑through rates. The campaign's Facebook campaign manager, an engineer formerly at a product analytics firm, admitted in a podcast that they "used the same approach as a consumer app growth team. "

Platform policy played a critical role. Facebook's transparency requirements forced the Campaign to submit identity verification documents-a process that delayed ads by 6-12 hours. Kast's team built a queuing system that pre‑loaded creatives and scheduled them for approval at low‑traffic times (midnight local time), using a custom cron job on an EC2 instance.

Facebook ads manager dashboard showing political ad targeting parameters for a Latin American election campaign

Content Delivery and Live Streaming: Edge Networks for Mass Audiences

Kast's rallies were streamed simultaneously on YouTube Live, Facebook Live. And a custom website. The site used HLS (HTTP Live Streaming) with a latency of under 6 seconds via an origin server running Nginx and the nginx-rtmp-module. For the final debate, viewership peaked at 780 concurrent connections, served by CloudFront with origin-keepalive-timeout tuned for 60 seconds to reduce reconnection spikes.

Edge caching proved essential when the campaign experienced a DDoS‑like surge from supporters manually refreshing after a controversial statement. The team later implemented a rate‑limiting layer using AWS WAF with custom rules that blocked clients sending more than 10 requests per minute (based on a counting set in ElastiCache).

One notable engineering decision: they opted for server‑side ad insertion during breaks. A Python script parsed the SCTE‑35 markers in the RTMP stream, spliced in a pre‑recorded fundraising call. And resumed the feed. This approach, typical in OTT platforms, was novel for a political campaign in Latin America.

Cybersecurity and Information Integrity Challenges

Kast's campaign faced two major security incidents. The first: a phishing attack targeting volunteer coordinators via fake Twilio SMS messages. The attackers used a spoofed sender ID to request "verification" of admin credentials. Because the campaign relied on a shared Google Workspace account for team communications, eight coordinators were compromised. After the incident, the team enforced MFA via TOTP (RFC 6238) and switched to a Slack‑based identity management system.

The second incident involved the leak of internal polling data. A misconfigured AWS S3 bucket (unauthenticated read access) exposed 3,000 rows of voter‑propensity scores. The bucket was discovered by security researchers at Cybernews who reported it under responsible disclosure. Kast's tech team remediated within 4 hours by enabling ACL‑enforced private access and applying bucket policies with Deny statements for non‑VPC traffic.

Information integrity was further strained by the widespread use of WhatsApp forwarding. The campaign attempted to curb disinformation by running a fact‑checking bot (built with Rasa) that replied to common false narratives. However, due to WhatsApp's end‑to‑end encryption, the bot could only respond to messages users explicitly sent to it. This limitation is inherent to any encrypted platform-a challenge for crisis communications engineering.

Open Source vs Proprietary Tools: The Tech Stack Breakdown

Kast's campaign predominantly used open‑source software. The web frontend was built with Next js (React) and deployed via Vercel. The backend API used FastAPI (Python) with PostgreSQL and Redis for session stores. The team ran many microservices in Docker containers on an on‑premises Kubernetes cluster donated by a supporter, with Prometheus and Grafana for observability.

Proprietary tools were limited to:

  • Twilio for SMS/WhatsApp API-chosen for compliance templates,
  • Facebook Business SDK for ad management
  • Snowflake for cross‑system data warehousing (later replaced by Redshift due to cost).

This hybrid stack allowed rapid iteration while maintaining low expenditure. The total software budget was reported at $250,000-a fraction of what US campaigns spend. Yet the technical sophistication was comparable to a mid‑stage startup.

Lessons for Mobile App Developers and Engineers

What can we extract from Kast's technical playbook? First, the value of event‑driven architectures for voter engagement mirrors patterns used in modern mobile apps. Whether you're building a delivery app or a healthcare portal, the same AWS services (Lambda, SQS, SNS) apply. Second, the reliance on Twilio for two‑way communication is directly transferable to any app that needs SMS, voice. Or WhatsApp chat-Twilio's documentation is a must‑read for developers working on customer support products.

Third, the campaign's approach to A/B testing (Bayesian models) is more robust than frequentist methods for small sample sizes. If you're running experiments on a mobile app with limited DAU, consider using the Pyro library for probabilistic programming. Fourth, the importance of identity and access management can't be overstated-the S3 misconfiguration was entirely preventable with proper IAM roles and AWS Config rules. Use tools like tfsec or checkov in your CI/CD pipeline to enforce policies.

Finally, Kast's campaign demonstrated that political systems can be modeled as distributed systems. The same principles-eventual consistency, circuit breakers, backpressure-apply when you're trying to coordinate thousands of volunteers or millions of voters.

Engineer reviewing monitoring dashboard with Kubernetes and Prometheus metrics for a cloud native application

Frequently Asked Questions

1. What cloud provider did José Antonio Kast's campaign use?
The campaign primarily used Amazon Web Services (AWS), including EC2, Lambda, CloudFront, DynamoDB. And Redshift. They also used Vercel for frontend hosting and on‑premises Kubernetes for some microservices,

2Did Kast's campaign use AI or machine learning?
Yes. They employed gradient‑boosted decision trees (XGBoost) for voter propensity scoring, a probabilistic model for lookalike audiences on Facebook, and a rule‑based natural language bot (Rasa) for fact‑checking on WhatsApp.

3. How did they manage WhatsApp communications at scale?
They used the WhatsApp Business API via Twilio. The system was built on a pub‑sub architecture: messages were enqueued in SQS, processed by Lambda workers. And delivered with a 1‑second retry backoff. Opt‑out handling was managed with a PostgreSQL table and atomic updates,

4What security measures were in place to protect voter data?
After the initial breaches, they enforced MFA with TOTP, locked down S3 buckets with explicit IAM policies. And used WAF with rate limiting. However, the encryption of data at rest was limited to AWS standard KMS keys-they did not implement client‑side encryption.

5. Can the same tech stack be used for a non‑political mobile app?
Absolutely. The architecture is identical to what we build for clients at Denver Mobile App Developer. Substituting "voter" for "user" and "rally" for "product launch," the same patterns-event‑driven communications, real‑time analytics, edge media delivery-are directly applicable to any consumer or enterprise app.

Conclusion: Build Your Next Campaign‑Grade App with Us

José Antonio Kast's digital infrastructure was a masterclass in combining commodity cloud services with custom engineering to achieve state‑level scalability on a startup budget. Whether you're preparing for a product launch, handling crisis communications, or building a political platform, the same technical foundations apply. At Denver Mobile App Developer, we specialize in architecting high‑throughput, secure. And observable applications that can handle millions of interactions.

If you want to turn your next project into a campaign‑grade system-with A/B testing, real‑time dashboards, and multi‑channel engagement-reach out to our team. We'll help you design a cloud‑native stack that outperforms your competition. Contact us today for a free technical consultation.

What do you think?

What alternative technologies would you have chosen

.

Need a Custom App Built?

Let's discuss your project and bring your ideas to life.

Contact Me Today →

Back to Online Trends