Skip to content

Latest commit

 

History

History
99 lines (67 loc) · 6.31 KB

saas-multi-tenancy.md

File metadata and controls

99 lines (67 loc) · 6.31 KB

Multi-tenancy

How to detect & propagate with Tenant ID in REST API?

  • URL path based tenant identification. example: https://.com//
  • Domain-based tenant identification. example: https://..com/
  • Custom Http header-based tenant identification. In this method, we can pass the tenant-id as part of your own custom Http headers like X-TENANT-ID
  • As part of the custom attribute in JWT token - JSON Web Token is an open industry standard for representing claims securely between two parties. Click here to know more about JWT. { “sub”: “1234567890”, “name”: “”, “iat”: 1516239022, “userid”: “”, “tenantid”: “” }

https://medium.com/@vivekmadurai/multi-tenancy-in-rest-api-a570d728620c

How to Pass Tenant ID To New Thread In Java?

In a Java based multi-tenant database application, we resolve tenant ID for every web transaction. After resolving tenant ID, we set it to tenant context and retrieve it later from anywhere in application to access database within the scope of current thread ...

Read more here, https://arifng.medium.com/best-way-to-pass-tenant-id-to-new-thread-in-java-9e658032387f

Isolating tenant data is a fundamental responsibility for Software as a Service (SaaS) providers.

https://aws.amazon.com/blogs/database/multi-tenant-data-isolation-with-postgresql-row-level-security/

Implement multi-tenant data isolation using PostgreSQL row level security policies. https://github.com/aws-samples/aws-saas-factory-postgresql-rls/blob/main/app/src/main/java/com/amazon/aws/partners/saasfactory/pgrls/repository/TenantAwareDataSource.java https://github.com/aws-samples/aws-saas-factory-postgresql-rls/blob/main/app/src/main/java/com/amazon/aws/partners/saasfactory/pgrls/repository/DataSourceRepository.java

For the pool model, where there are two queues for scalability, the message is published to the queue with th fewest messages in it. This is to show how you can reduce a noisy neighbor problem. The messages have a TenantID attribute to pass the context downstream to the consumer services.

Factors such as noisy neighbor and data isolation influence strategy to store tenant data, either a “silo” model, or a “pool” model.

A silo model an option for compliance or other isolation needs and want to avoid noisy neighbor conditions. Usually separate tables per tenant.

In a pool model, data resides in a single table, segregated by tenant identifiers. Eeffectively distribute tenant data within a single table Prevent cross tenant data access

Obvious way to achieve this would be to add TenantID as the partition key. tenant identifier as a partition key could concentrate data in a given partition. partition key scheme in a way that will better distribute tenant data across multiple partitions, and limit your chances of hitting the hot partition problem.

augment your partition key, by adding a suffix to the original tenant identifier.

Building a Multi-Tenant App With NodeJS + MongoDB

Architecture & Design

Rating Type Topic
📺 Architecting Multi-Tenancy
📰 L33T M10y
📰 The Force.com Multitenant Architecture
📰 The Force.com Multitenant Architecture - PDF
📰 The Internal Design of Force.com’s Multi-Tenant Architecture

Engineering Blogs

Rating Type Topic
📰 Azure Architecture Walkthrough: Building a multi-tenant Azure Architecture for a B2C scenario
📰 Moving to Multitenancy
📰 Pinterest - Secret management in multi-tenant environments
📰 How Freshworks handled its growing database
📰 Laravel multi-tenancy, avoiding over engineering
📰 Multitenancy with Laravel
📰 Discovering the Need for an Indexing Strategy in Multi-Tenant Applications
📰 Discovering the Need for an Indexing Strategy in Multi-Tenant Applications
📺 Scaling Shopify's Multi-Tenant Architecture across Multiple Datacenters

Implementation Choices

Type Topic
📰 Multi-Tenancy Implementation using Spring Boot + Hibernate
📰 How to handle multi-tenancy in Cumul.io
📰 Providing Multitenancy with Spring Boot
Rating Type Topic
📰 How Stack Overflow Caches Apps for a Multi-Tenant Architecture

Tenant Metrics & Analytics https://github.com/aws-samples/aws-saas-factory-ref-solution-metrics-analytics

https://github.com/aws-samples/aws-saas-factory-ref-solution-metrics-analytics

Engineering Blogs

Rating Type Topic
📺 Shopify's Architecture by Simon Eskildsen