NestJSMongoDBMongoDB CDCGoogle Pub/SubBigQueryGoogle DataflowMulti-tenant IAM

Aladia: Scalable E-Learning Platform

Designed and built the backend and data infrastructure for a cloud-based ed-tech platform serving thousands of learners, with multi-tenant access control, real-time analytics pipelines, and AI-powered learning features.

Client

Aladia

Timeline

10 months

My Role

Full Stack Engineer

Aladia: Scalable E-Learning Platform
01 — Problem

Building an Ed-Tech Platform That Scales to Enterprise

Aladia had a clear vision: an education platform that enterprises could white-label and deploy for their teams, with rich learning analytics that gave administrators real insight into engagement and progress. The challenge was that the data requirements for analytics were fundamentally at odds with the data requirements for the transactional application.

The platform needed to serve multiple tenants (companies) from a single deployment, each with their own users, courses, permissions, and analytics, without any data leakage between tenants. And each interaction (lesson completion, quiz answer, content view) needed to flow into a reporting layer that could answer complex analytical queries without impacting the main application database.

  • Multi-tenant architecture with strict data isolation between enterprise clients
  • Real-time learning analytics, lesson progress, completion rates, quiz performance, for admin dashboards
  • High write volume from thousands of concurrent learners generating events
  • Application database (MongoDB) not suitable for heavy analytical queries
  • AI-powered learning features requiring clean event data as training and inference input
02 — Architecture

Architecture: Event-Driven Analytics Separation

The core architectural decision was to fully separate the transactional data path from the analytical data path. MongoDB handled the application state (users, courses, enrollments, progress). Every meaningful user event was captured via MongoDB Change Data Capture (CDC) and published to Google Pub/Sub.

From Pub/Sub, a Dataflow pipeline transformed and enriched events before loading them into BigQuery. This gave the analytics layer a queryable, cost-effective store for everything from individual quiz attempts to platform-wide engagement trends, without touching the application database.

The multi-tenant IAM was built as a NestJS module with role-based access control (RBAC) at the tenant, organization, and user levels. Every API request went through a tenant resolution middleware that scoped all database operations to the correct tenant context, preventing cross-tenant data access at the framework level.

Key technical decisions

MongoDB CDC → Pub/Sub

Change streams gave us a reliable event source without adding write overhead to the application. Events were published to Pub/Sub which gave us durable, at-least-once delivery to downstream consumers.

BigQuery for analytics

Running analytical queries (aggregations, cohort analysis, time-windowed metrics) on MongoDB would have degraded application performance. BigQuery provided a fully managed, scalable analytics layer with no operational overhead.

NestJS microservices

Service separation allowed the analytics pipeline, IAM service, and content delivery service to scale independently. NestJS's module system made it straightforward to enforce tenant scoping as a cross-cutting concern.

Multi-tenant RBAC middleware

Tenant resolution was handled at the framework level (not the application level), every request was scoped before it reached any business logic. This made it impossible to accidentally query cross-tenant data.

03 — Outcome

Outcome

Delivered a production-ready, enterprise-grade ed-tech platform with robust multi-tenant isolation, real-time analytics, and a clean event architecture ready for AI feature extension.

Multi-tenant
Enterprise IAM
zero cross-tenant data exposure
Real-time
Learning analytics pipeline
CDC → Pub/Sub → BigQuery
Microservices
Independent service scaling
content, auth, analytics
10 months
Full platform delivery
from schema to production

Need something similar?

I take on complex full stack projects, AI integration work, and data platform development.