question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support better multi-tenancy with @tenant transformer

See original GitHub issue

Is your feature request related to a problem? Please describe. Multi-tenancy (MT) implementation support using Amplify is very limited. The only MT strategy that is possible is to have a tenantId column in tables. With 100+ tenants, table sizes might explode. Making lookups slow and deleting a tenant data complicated.

A better alternative is to have tenant specific tables using prefixing: tenantid1_posts, tenantid_2_posts … . This can possibly be achieved with a @tenant transformer with something like:

type Blog @model {
  id: ID!
  name: String!
  posts: [Post] @connection(name: "BlogPosts")
}
type Post @model @tenant {
  id: ID!
  title: String!
  blog: Blog @connection(name: "BlogPosts")
  tenantid: String
}

such as when a tenantid is provided, the entry will be created in a separate tenantid prefixed table/collection.

About MT strategies https://d0.awsstatic.com/whitepapers/Multi_Tenant_SaaS_Storage_Strategies.pdf

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
undefobjcommented, Mar 13, 2020

@mdegrees We are looking at more multi-tenancy support this year, however rather than look at a specific implementation could you uplevel a bit and go into detail around your use cases and scenarios? This would allow us to look at if there is a point feature causing problems here or a larger design that is cross cutting categories which needs implementation. Thanks.

1reaction
undefobjcommented, May 19, 2020

No I don’t have an example of updating records handy, but you should be able to do this using Lambda and the DynamoDB document client.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding Multitenancy and Concurrent Development
This paper explores some of the technical challenges around implementing AEM in a multi-tenant environment, but many of these recommendations ...
Read more >
Multi-Tenant Commercial Electrical Systems - Property ...
Once power is on the property via CenterPoint transformer, it is distributed to the various tenant spaces and common areas via service wireway...
Read more >
VELTAIR: towards high-performance multi-tenant deep ...
In this work, we systematically analyze the opportunities and challenges of providing multi-tenant deep learning services on the general-purpose ...
Read more >
Tenancy models to consider for a multitenant solution
This article describes the considerations you need to give to different models of multitenancy.
Read more >
Introduction | laravel-multitenancy - Spatie
The package can determine which tenant should be the current tenant for the request. It also allows you to define what should happen...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found