Systems Engineering · Network Resilience
Engineering Resilient AI Systems for Intermittent Connectivity and Emerging Markets
Principle 04 at TICNES AI: A system that only works on a gigabit fibre connection in a metropolitan office is not finished. When building software for university students, field researchers, and enterprises across Angola and Lusophone Africa, intermittent 3G/4G links, mid-stream TCP resets, and metered mobile data plans are primary architectural inputs.
Contents
1. The failure of Silicon Valley defaults on regional mobile links
Many modern AI web applications are built under the implicit assumption that the client enjoys a continuous `15ms` round-trip latency to a nearby data centre and unlimited data throughput. They ship `4 MB` of unminified JavaScript bundles, open fragile long-lived WebSockets without reconnection state, and lose the user’s entire form submission or AI response if a mobile cell handoff drops the connection for three seconds.
In real-world operational environments across Angola and neighbouring markets, engineers must design for a very different telemetry profile:
- Round-trip times (RTT) of `180ms to 450ms` when routing to European or South African cloud regions.
- Transient packet bursts and NAT session timeouts on congested cellular towers during peak business hours.
- Prepaid mobile data bundles where downloading a bloated `15 MB` landing page costs a student or survey respondent tangible money.
2. Server-sent events (SSE) with cursor-based stream resumption
When a student uses the TICNES Student AI Tutor to work through a multi-step calculus or algorithms problem, the explanation may stream over `8 to 15 seconds`. With a naive HTTP streaming implementation, if the user’s mobile connection drops at second `9`, the stream aborts, the partial response disappears, and retrying re-bills the full token generation from scratch.
To prevent wasted tokens and broken user sessions, our streaming gateway buffers generated tokens in an edge ring-buffer keyed by `generation_id` for `15 minutes`. Every emitted Server-Sent Event carries a monotonically increasing `id: <token_offset>` header:
id: 142
event: token
data: {"delta": " Consequentemente, nos termos do n.ΒΊ 2 do artigo", "offset": 142}
// If the connection drops, the browser's EventSource (or custom fetch client)
// automatically reconnects with:
// Last-Event-ID: 142
// The edge worker replays tokens 143..N from the edge buffer without re-running the LLM.
Even if the user’s phone loses signal completely for thirty seconds inside a building, reconnecting with `Last-Event-ID` immediately flushes the remaining completed answer from the edge cache.
3. IndexedDB mutation queues and idempotent submission tokens
In platforms like Q-Mvutu (social research surveys) and our Scholarship Hackathon submission portal, losing a user’s multi-page entry because of a network timeout is unacceptable. We enforce two client-server guarantees:
- Local-first draft persistence: Every keystroke or survey answer is committed synchronously to `IndexedDB` (with `localStorage` fallback) before any network call is attempted. If the browser tab closes or the device battery dies, the user returns to the exact question they were answering.
- Idempotency keys on all `POST` mutations: Every submission payload includes a client-generated UUIDv4 `Idempotency-Key` header. If the client sends a submission, the server processes it, but the HTTP `200 OK` response is lost on a flaky cellular link, the client’s automatic retry with the same `Idempotency-Key` returns the cached receipt rather than creating a duplicate record.
4. Strict JavaScript, font and media payload budgets
Performance on constrained networks starts with shipping fewer bytes. Across our public web properties and production applications, we enforce strict asset budgets:
| Asset Category | Standard Unoptimized Web App | TICNES AI Production Budget |
|---|---|---|
| Initial HTML + Critical CSS | Empty `<div id="root">` requiring 2MB JS | `< 25 KB` gzipped with complete readable document markup |
| Raster Images | Uncompressed PNG / JPEG (`1.5 MB+` each) | WebP / AVIF with inline SVG geometric fallbacks (`< 120 KB`) |
| Third-Party Trackers | 8β15 analytics, heatmap and chat scripts | Zero bloatware; consent-gated essential scripts only |
| Time to First Meaningful Read | `6.5s β 14s` on 3G mobile | `< 1.2s` on 3G mobile (static HTML renders immediately) |
5. Edge caching and semantic response memoization
Finally, we minimise origin round-trips by deploying application workers at the CDN edge (Cloudflare Workers) and memoizing canonical reference queries. In educational and legal-reference applications, a significant fraction of queries ask about the same foundational articles or syllabus definitions. By normalising and hashing canonical reference lookups at the edge, recurring statutory and textbook lookups return in under `35ms` without touching the upstream inference cluster.