Skip to content
Notifications
Clear all

What identity platform actually works for multi-tenant SaaS?

2 Posts
2 Users
0 Reactions
2 Views
(@henryg78)
Trusted Member
Joined: 1 week ago
Posts: 41
Topic starter   [#10810]

Having evaluated Auth0, Cognito, and a custom-built solution for a multi-tenant SaaS (B2B, ~200 tenants), I found most reviews miss the critical data engineering perspective: how identity data integrates with your analytics and operational stores.

The core issue is tenant isolation in the JWT and user metadata. Auth0's `app_metadata` and `user_metadata` are flexible, but their pipeline to your warehouse is not. You end up with:

* Event logs (Auth0 to S3) that require complex parsing to re-associate users with tenants.
* `user_id` that is not your application's user UUID, complicating joins in Looker/dbt.
* Custom database actions for profile syncs become a cost/performance bottleneck.

A functional system requires the identity provider to emit clean, tenant-aware events and provide a direct, real-time user export API. Here is the schema we needed from the identity webhook:

```json
{
"event_type": "user_update",
"tenant_id": "org_abc123",
"user_id": "usr_app_uuid",
"email": "user@tenant.com",
"metadata": {
"plan_tier": "enterprise",
"account_status": "active"
},
"timestamp": "2023-10-26T20:44:12Z"
}
```

None of the managed platforms offered this natively without significant middleware (Airflow DAGs to transform logs). The cost of processing Auth0 logs in Snowflake (scanning JSON) exceeded the platform fee for our scale.

**Key comparison points for a data-driven decision:**

* **Cognito:** Cheaper, but user export and event streaming require Lambda triggers, pushing complexity to your stack. No built-in `app_metadata`.
* **Auth0:** Rich features, but the data egress is log-centric. Real-time feeds require Actions, which have execution limits and add latency.
* **Custom (Ory/OAuth0):** Higher initial cost, but you control the user table schema and can emit events directly to your event bus (Kafka/PubSub). Simplifies dbt models significantly.

For pure cost efficiency and clean data modeling, we moved to a hybrid approach: Ory for identity, with a Postgres user table replicated directly to Snowflake. Total cost dropped 40% from Auth0, and ELT complexity was reduced by ~70%.


EXPLAIN ANALYZE


   
Quote
(@jessica8)
Estimable Member
Joined: 1 week ago
Posts: 68
 

You've pinpointed the operational data debt that these platforms create. The downstream ETL complexity to reconcile identity events with your fact tables is a massive, often overlooked, line item.

I'd add that this becomes a contractual issue at scale. When you negotiate with Auth0 or Okta, you must explicitly require that tenant context is a first-class property in all log streams and APIs. If it's not in the SLA, you'll inherit the cost of building and maintaining those sync pipelines yourself, which can easily exceed the platform's subscription fee over three years.

The schema you posted is correct. The commercial alternative is to use a platform like FusionAuth or Keycloak where you own the data model and can emit those events directly. You trade managed service convenience for control over the identity data pipeline.


Trust but verify. Then renegotiate.


   
ReplyQuote