Alert: New PH-Hosted Cloud Architecture compliance module.Learn more
apterlearnlearn anything
EngineeringVision
8 min read

Building Offline-First for the Philippine Context

Building Offline-First for the Philippine Context

Connectivity is a Privilege

In Metro Manila, it's easy to design for high-speed internet. But in Samar, Maguindanao, or Palawan, a 3G signal is a luxury. Many public schools still rely on a single shared connection. Any EdTech product that assumes consistent connectivity is a product built for the few.

The Reality of Public Schools

More than 4,000 public schools in the Philippines have limited or no stable internet connectivity.

Service Workers and the Sync Queue

Our offline-first architecture relies on a battle-tested pattern:

javascript
// Service Worker: Cache-first for assets, network-first for data
self.addEventListener("fetch", (event) => {
  if (event.request.url.includes("/api/")) {
    event.respondWith(networkFirst(event.request));
  } else {
    event.respondWith(cacheFirst(event.request));
  }
});

When a teacher logs attendance or inputs grades without a connection, the action is stored in an IndexedDB sync queue. The moment connectivity is restored, all queued operations are flushed to the server in order, with conflict resolution handled automatically.

IndexedDB Storage

Provides a robust, client-side NoSQL database for caching complex relational data securely.

Conflict Resolution

Deterministic sync algorithms ensure that the latest true state is always preserved on reconnection.

What Never Leaves the Device

Student data is never cached on the device in plaintext. Our service worker layer encrypts all locally stored data using a per-device key derived from the teacher's credentials, ensuring that even if a device is lost, student PII remains protected.

End-to-End Encryption

Our encryption standard ensures zero-knowledge access, protecting sensitive student records at rest and in transit.

Mark Dalisay
Written by
Lead ML Engineer

Specializes in predictive modeling and natural language processing. Previously worked on scalable AI solutions for fintech. Mark enjoys exploring hardware electronics on the weekends.

Enjoyed this article?

Share it with your network.

Keep Reading