Skip to content
Ahamed Rishthas Kunnummal

AITIME platform and its disaster recovery

A multi-tenant workforce management and payroll platform with 200+ clients and 500+ connected devices, with a pilot-light DR setup in a second AWS region that was tested by a real regional outage.

context
AIVIZ.me
outcome
All 42 affected clients restored, no permanent data loss

Context

AITIME is a multi-tenant workforce management and payroll platform. More than 200 clients run on it, with over 500 connected devices, across facilities management, hospitality, retail and property services. It is built on Django, Django REST Framework, React, Flutter, PostgreSQL, Redis and Celery.

I have been its architect since March 2023, as a freelance engagement with AIVIZ.me alongside my full-time role.

Problem

Attendance and payroll are things clients use every day. If the platform is down, people cannot clock in and payroll cannot run.

The platform ran in one AWS region, which made that region a single point of failure. Running a full second copy all the time would have cost too much for the risk it covered. The platform needed a recovery setup that was cheap to keep and quick to bring up.

What I did

I built a pilot-light disaster recovery setup in a second AWS region: the minimum is kept running there, and the rest is started when it is needed.

  • Database replicas in the second region.
  • Failover driven by Lambda functions.
  • Wildcard DNS and SSL, so every tenant's address moves with the failover.
  • Daily database dumps across all servers.
  • Cross-region backup to Wasabi, synced with rclone so that only changes are transferred.

Architecture

  1. Primary region

    The live platform: application servers, PostgreSQL and Redis serving all tenants.

  2. Database replicas

    Kept in a second AWS region, ready to be promoted.

  3. Lambda-driven failover

    Functions that bring up the standby region when failover is triggered.

  4. Wildcard DNS and SSL

    One change moves every tenant subdomain to the standby region with valid certificates.

  5. Daily database dumps

    Taken across all servers, independent of replication.

  6. Cross-region backup

    Dumps copied to Wasabi with rclone delta sync, outside the primary region.

Outcome

The setup was tested by a real event: an AWS Middle East regional outage that affected 42 clients.

I recovered the platform by attaching the volumes that survived, dumping the data out of them, and restoring from the cross-region storage. All 42 affected clients came back, with no permanent data loss.

Stack

  • AWS
  • Lambda
  • PostgreSQL
  • Django
  • React
  • Flutter
  • Redis