What's the conceptual difference between tenant and namespace

I came across the term tenant a while ago in the context of Stormpath and in the context of Google Cloud Datastore. And what made me crazy about it, why should we introduce a new term to define a namespace? Or maybe I'm missing something that describes tenant-specific properties that aren't in the namespace?

And although, in this whole concept, I still cannot understand the concept of multicanism here? What is the meaning of all-around? It just looks like a multiplayer space, but with the same structure.

So what is the difference between the two terms?

+3


source to share


1 answer


In Datastore, you can use a namespace to create a structure with many.

Example:

Let's say you want to create a social network like Facebook, but keep it simple. You will have users, posts and comments.

Objects

  • users
  • messages
  • comments

Namespace



Instead of declaring the "post" object as a child of the "user" element, you can assign a namespace (user id) to the "post".

As far as the data structure is concerned, it might seem like there is no difference, but in terms of performance, it does. When you declare an entity as a child of a parent, the Datastore will need to keep all the children together and ensure data consistency within that parent. When you assign a namespace to an entity, it can propagate data and does not guarantee absolute consistency.

This is why Datastore is limited to 1 record per second (on average) inside each parent, but does not impose namespace record limits.

What does "Consistency" mean?

In this example, which means consistency: let him say that Jack posted the message correctly. Mary and John are his friends. If Mary and John make it into Jack's story after being 100% guaranteed that both will see this new message?

  • If the message is a child of the user (Jack), they will.
  • If the message is in the usernamespace (Jack), it might not be correct at the moment; eventually both will see the message, but it may take a while for it to propagate.
+3


source







All Articles