Comments (4)
I hear you. All the ingredients for this are coming together, if you care to combine & bake:
- register a custom locator for your app: #7
- implement in terms of a GlobalID::URI: #6
- support your GlobalID params using GlobalID::URI query params: needs work! 😁
from globalid.
❤️
On Wednesday, October 8, 2014, Kasper Timm Hansen [email protected]
wrote:
—
Reply to this email directly or view it on GitHub
#39 (comment).
from globalid.
@jeremy I'm curious about your opinion on "app" when it comes to the concept of a GlobalID and multi-database tenancy setups.
If the GID is a hierarchy, it seems like it's descending in specificity from App, to Model, to ID, to params.
If you're in a multi-tenant setup that uses different databases (or, like in our case, different schemas) then ids for objects can increment independently as though there in entirely different apps.
Thus, User.find(1)
would return different records based on the current customer.
Using params support for tenants, the gids would look like this:
gid://MyApp/User/1?tenant=customer1
gid://MyApp/User/1?tenant=customer2
But, I've been playing with that for a little while and it feels out of place in the specificity. The tenant param feels to me like metadata, when it's actually core to the context of the object. You couldn't switch over to a different customer and find the object with the other customer's gid. In the hierarchy, it might better be placed between App and Model, like App -> Tenant -> Model -> ID.
Given the current structure of GlobalID, would it make sense to have one app per tenant, like this:
gid://MyApp-customer1/User/1
gid://MyApp-customer2/User/1
Do you see any issues with that? Am I thinking about GlobalIDs wrong?
from globalid.
@jhubert, recommend you check out custom locator support
- Use compound IDs that combine the tenant and model ID
- Register a locator for your app that splits the compound ID and looks up the tenant and model separately
from globalid.
Related Issues (20)
- Test failed with rails 5.2 HOT 1
- New release please? HOT 2
- Test failures HOT 1
- expires_in does not work HOT 1
- Cannot globally default to non-expiring ids by setting config.global_id.expires_in to nil
- What are some potential ways to misuse signed Global IDs? HOT 1
- [Suggestion] Allow different primary_ids such as UUID HOT 5
- [Suggestion] Add support for eager loading optionally HOT 4
- Preferred way to check if a Signed GlobalID is expired? HOT 4
- Raise error on unknown options HOT 7
- Is there a way to limit how many times a sgid can be used? HOT 1
- Bug or breaking change? Model class must now implement `.primary_key` HOT 9
- SignedGlobalID: Consider re-adding the ability to use the old serialization format HOT 1
- Consider adding a request-specific expires_at HOT 1
- Idea: Locating embedded resources
- Efficient Object Parsing: Redis-Based Global Object Management for Model ID-Independent Operations
- ActionText::Richtext attachments are broken after upgrading to 1.2.0 HOT 1
- Custom locator raises NameError when class name not defined HOT 2
- Ability to make global id without loading the object
- Support for using GlobalID with configurable columns
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from globalid.