Skip to main content
All projects
Infrastructure & DevOps
/projects/merchant-platform

Multi-Tenant Merchant Platform

  • 99.99% platform availability
  • 500+ merchants served
  • Zero unplanned downtime target
project.merchant-platform.local
Multi-Tenant Merchant Platform project screenshot

Problem: FTP ingress was a bottleneck with frequent downtime, costing clients money.

Solution: Built a 99.99% available multi-tenant SFTP gateway with automated AWS provisioning.

Impact: Zero unplanned downtime; supports 500+ merchants simultaneously.

Overview

Multi-tenant SFTP ingress with automated provisioning and strong isolation so merchant onboarding doesn't compromise reliability.

Results

99.99% platform availability

$40k/year AWS cost reduction

500+ merchants with zero unplanned downtime

Automated tenant provisioning in <5 minutes

Before / after

Ingress reliability

Before: Fragile FTP paths, painful incidents

After: Standardized SFTP gateway with automated fleet patterns

Scale

Before: Onboarding friction for new tenants

After: 500+ concurrent merchants supported

Stack

AWS
Terraform
SFTP gateway
HA design

Decisions

Key trade-offs and design calls that shaped the final delivery.

EC2 over managed SFTP

Context: AWS Transfer Family was expensive for multi-tenant use case with many users

Decision: Self-managed SFTP on EC2 with custom user isolation logic using chroot—significantly lower cost for high user count

chroot over containerization

Context: Needed lightweight isolation without Docker overhead on a single EC2 instance

Decision: Linux-level chroot jails with chmod for directory restrictions—simpler, lower resource footprint than containers

Architecture

The primary system boundaries, runtime pieces, and how the project was structured in production.

AWS EC2 SFTP Server

FTP Gateway

Self-managed SFTP on EC2 with chroot jail isolation—merchants and suppliers connect to shared infrastructure with strict boundaries.

chroot + chmod

Tenant Isolation

Linux-level chroot jails enforce directory boundaries—merchants cannot escape their dedicated folders, access controlled at OS level.

Auto-generated credentials

Credential Management

1 supplier can have multiple merchants. Only suppliers can create passwords and users. Custom feed creation generates user/password pairs auto-assigned to respective tenant directories, shareable with specific suppliers.

Mermaid source. Paste into mermaid.live to visualize the diagram.

flowchart TB
  M[Merchants] --> SFTP[SFTP gateway tier]
  SFTP --> S3[(Object storage)]
  SFTP --> MET[Metadata & routing]
  MET --> AUTO[Terraform-managed infra]

Pipeline

How changes moved from development through validation and deployment.

1

Provision

Custom script

Auto-create user, password, and chroot environment per tenant with proper permissions

2

Deploy

AWS EC2

Single instance serving all tenants with resource monitoring and SSH access for management

3

Access Control

Linux ACLs

chmod/chroot enforce boundaries at OS level—merchants cannot access other directories

Incidents

Operational failures, rehearsals, or recovery moments that changed how the system was run.

API endpoints exposed without authentication

P1

Resolution: Implemented private API authentication and integrated with backend for proper access control

Lesson: All APIs must be authenticated by default—never assume internal-only access is safe

Backend integration breaking on user creation

P2

Resolution: Standardized API contracts and added validation for supplier-merchant relationship creation

Lesson: Multi-tenant systems need strict relationship validation between entities