You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -19,59 +19,71 @@ But as your product matures, new requirements appear that go beyond what Supabas
19
19
-**Enterprise-grade compliance and security** – meeting SOC, ISO, HIPAA, or FedRAMP standards.
20
20
-**Granular IAM and networking** – unifying database access, APIs, and infrastructure under a single identity and policy system.
21
21
22
-
That’s where [AWS](https://aws.amazon.com/) comes in. It offers a **best-of-breed ecosystem** — each component is purpose-built, scales independently, and integrates deeply with the rest of your stack.
23
-
This guide walks you through how to migrate each Supabase component to its AWS counterpart — practically and step by step.
22
+
That's where hyperscalers like [AWS](https://aws.amazon.com/), [GCP](https://cloud.google.com/), and [Azure](https://azure.microsoft.com/) come in. They offer a **best-of-breed ecosystem** — each component is purpose-built, scales independently.
24
23
25
-
---
24
+
**This guide focuses on AWS**, but the migration principles and architecture patterns apply equally to other cloud providers.
25
+
26
+
We'll walk you through how to migrate each Supabase component to its AWS counterpart.
26
27
27
-
## The Migration Process
28
+
---
28
29
29
-
Supabase’s integrated platform maps cleanly to AWS’s modular architecture:
1.**Auth** – migrate user identities and sessions.
44
-
1.**Storage** – move file assets and update access logic.
45
-
1.**Functions** – redeploy backend logic.
46
-
1.**Realtime and Networking** – finalize integration and optimize architecture.
43
+
This guide uses a **Services-First** approach — decouple Supabase-specific services first, then migrate the database last as a simple PostgreSQL migration.
44
+
45
+
1.**Networking & IAM** – set up AWS infrastructure (VPC, subnets, IAM roles).
46
+
1.**Auth** – migrate to Cognito (decouples from Supabase `auth` schema).
47
+
1.**Storage** – migrate to S3 (decouples from Supabase `storage` schema).
48
+
1.**Functions** – redeploy to Lambda (update to use Cognito + S3).
49
+
1.**Realtime** – replace with AppSync/EventBridge (removes logical replication dependency).
50
+
1.**Database** – simple PostgreSQL migration of application data only (`public` schema).
51
+
52
+
**Why this order?** By migrating services first, the Supabase `auth` and `storage` schemas become dormant. The final database migration is just your application data — lower risk, simpler cutover, and easier to validate.
47
53
48
54
Always start in **staging**, validate each part, then proceed to production.
49
55
50
-
### 1. Database → Amazon RDS / Aurora
56
+
### 1. Networking and IAM
57
+
58
+
> **Note:** The networking and identity concepts in this section apply to all major cloud providers (AWS, GCP, Azure). This guide focuses on AWS implementations, but the architecture patterns translate directly to VPC/IAM (GCP) or VNet/RBAC (Azure).
51
59
52
60
**Supabase:**
53
-
Managed PostgreSQL with limited scaling and shared tenancy.
61
+
Abstracted networking and simple project-level access roles.
54
62
55
-
**AWS replacement:**
63
+
**AWS approach:**
64
+
Full-control networking and IAM system for isolation and compliance.
1. Update frontend SDKs and backend JWT verification.
104
+
1. Update application authorization logic (see RLS section below).
92
105
1. Require one-time user re-authentication after migration.
93
106
107
+
> **Important:** If you're using Supabase Row-Level Security (RLS) policies, they reference `auth.uid()` and won't work after migrating to Cognito. See the **Handling RLS Policies** section in the Database migration step for strategies to address this.
108
+
94
109
**Key advantages:**
95
110
96
111
- Deep IAM integration with AWS services.
@@ -153,7 +168,7 @@ Realtime engine based on Postgres logical replication and WebSockets.
153
168
154
169
-[AppSync](https://aws.amazon.com/appsync/) – GraphQL subscriptions for live updates.
155
170
-[EventBridge](https://aws.amazon.com/eventbridge/), [SNS](https://aws.amazon.com/sns/), or [SQS](https://aws.amazon.com/sqs/) – event-driven messaging.
156
-
-[API Gateway WebSockets](https://aws.amazon.com/api-gateway/features/websocket/) – persistent connections for custom protocols.
171
+
-[API Gateway WebSockets](https://aws.amazon.com/api-gateway/) – persistent connections for custom protocols.
157
172
158
173
**Migration focus:**
159
174
@@ -167,63 +182,91 @@ Realtime engine based on Postgres logical replication and WebSockets.
167
182
- Scalable pub/sub and async event flows.
168
183
- Integrates natively with Lambda and analytics pipelines.
169
184
170
-
### 6. Networking and IAM
185
+
### 6. Database → Amazon RDS / Aurora
171
186
172
187
**Supabase:**
173
-
Abstracted networking and simple project-level access roles.
188
+
Managed PostgreSQL with `auth`, `storage`, and `public` schemas.
174
189
175
190
**AWS replacement:**
176
-
Full-control networking and IAM system for isolation and compliance.
-**DynamoDB** – optional for NoSQL or key-value workloads.
184
195
185
-
**Migration focus:**
196
+
**Why migrate last:**
186
197
187
-
1. Deploy RDS/Aurora in private subnets (VPC).
188
-
1. Connect Lambda and EC2 via **VPC endpoints**.
189
-
1. Secure traffic with **Security Groups** and **Route Tables**.
190
-
1. Manage access using **IAM policies** and least-privilege principles.
191
-
1. Use **AWS Organizations** for environment isolation.
198
+
By this point, Auth is on Cognito, Storage is on S3, and Realtime has been replaced with AppSync/EventBridge. The Supabase `auth` and `storage` schemas are now dormant — your application no longer uses them.
192
199
193
-
**Key advantages:**
200
+
This makes the database migration simple — just a vanilla PostgreSQL migration of your application data (the `public` schema).
194
201
195
-
- Granular control over infrastructure and networking.
196
-
- Centralized access and audit through IAM.
197
-
- Broad compliance coverage — [AWS Compliance](https://aws.amazon.com/compliance) vs [Supabase Security](https://supabase.com/security).
202
+
#### Handling Row-Level Security (RLS) Policies
198
203
199
-
### Validate, Cut Over, and Optimize
204
+
Supabase uses PostgreSQL [Row-Level Security (RLS)](https://supabase.com/docs/guides/auth/row-level-security) policies heavily. These policies reference Supabase-specific functions and the `auth.users` table:
By migrating services first, the final database migration becomes a simple PostgreSQL-to-PostgreSQL operation with just your application data — lower risk, simpler cutover, and easier to validate.
225
268
226
269
Supabase helps you **build fast**.
227
-
AWS helps you **scale safely** — with advanced database management, analytics, IAM, and compliance.
270
+
AWS helps you **scale next** — with advanced database management, analytics, IAM, and compliance.
228
271
229
-
When done right, the migration lays a foundation your product can grow on for years to come.
272
+
When done right, the migration lays a foundation your product can grow on for years to come.
0 commit comments