Cohort Architecture

Built for High-Trust Campus Governance

Cohort is not just software. It is an infrastructure blueprint engineered to isolate, secure, and streamline multi-campus operations across Indian academic institutions.

Engineered Foundations

Security01

Postgres Row Level Security (RLS)

Logical database-level isolation. Every API request and SQL query is scoped using transaction context variables, preventing cross-tenant data leakage.

Compliance02

India Data Residency

100% hosted within AWS ap-south-1 (Mumbai). Complies with national data residency policies prohibiting cross-border storage of children's personal information.

Finance03

Paise Ledger Invoicing

All financial data is recorded as integer-based minimal currency units (paise). This eliminates float decimal rounding errors in tax calculations.

Legal04

Immutable Auditing (Sec 65B)

Shadow log triggers capture all database writes. Generates court-admissible audit logs compliant with Section 65B of the Indian Evidence Act.

Database Topology & RLS Isolation

In traditional SaaS setups, tenant separation is handled at the application layer. Cohort pushes isolation down to the database engine. Using PostgreSQL Row Level Security (RLS), we ensure that a staff member or student authenticated at Campus A can never access or accidentally modify data belonging to Campus B.

Below is a simplified blueprint representation of the RLS isolation policy executed on our core `students` registry:

supabase/migrations/0001_rls_policy.sql
-- Enable Row Level Security on the Student Registry
ALTER TABLE students ENABLE ROW LEVEL SECURITY;

-- Select Policy: Authenticated users can only read students within their tenant/campus scope
CREATE POLICY select_student_policy ON students
  FOR SELECT
  USING (
    tenant_id = (SELECT current_setting('request.jwt.claim.tenant_id', true)::uuid)
    AND 
    (
      is_tenant_super_admin() 
      OR 
      campus_id = (SELECT current_setting('request.jwt.claim.campus_id', true)::uuid)
    )
  );

-- Mutation Policy: Immutable historical logs scoped strictly to the current academic year
CREATE POLICY insert_student_policy ON students
  FOR INSERT
  WITH CHECK (
    tenant_id = (SELECT current_setting('request.jwt.claim.tenant_id', true)::uuid)
    AND
    academic_year_id = get_active_academic_year(tenant_id)
  );

Paise Ledger Precision

Float values are notoriously imprecise. When executing lakhs of fee payment cycles containing fractional taxes or partial payouts, rounding errors compile into real losses. Cohort ledgers operate strictly in integer paise units. ₹150.00 is stored as 15000. All operations are overflow-guarded.

Indian Standard Time (IST) Execution

Cron-triggered rollovers, database backups, and daily attendance closures are anchored to Asia/Kolkata (IST). This ensures compliance logs and audit registries align perfectly with standard operating schedules of local regulatory authorities.

Experience the Architecture Firsthand

Deploy a dedicated database instance and explore our structural schemas in a custom sandbox configuration.

Request Infrastructure Sandbox →