<@U04UQ68083H> How is ory identites id generated? ...
# ory-copilot
r
@chilly-king-10285 How is ory identites id generated? if i host two ory kratos instance is that possible to have same id between this two instance?
b
A message from kapa.ai
Based on the knowledge sources provided, I can answer your question about Ory Identities ID generation and the possibility of having the same ID across two Ory Kratos instances. Ory Identities (Kratos) generates a unique UUID for each identity when it's created. This is evident from the [Identity model documentation](https://www.ory.sh/docs/kratos/manage-identities/overview), which states: "This is a UUID generated when the identity is created. Can't be changed or updated." Regarding your question about hosting two Ory Kratos instances and the possibility of having the same ID between them, it's important to note that Ory Kratos is not designed to be self-hosted as a multi-tenant service. According to the [Multitenancy documentation](https://www.ory.sh/docs/kratos/guides/multi-tenancy-multitenant): "It is not possible to self-host Ory Kratos as a multi-tenant service as its data model does not support this due to data, scalability, and operational complexity." Given this information, if you were to host two separate Ory Kratos instances, each instance would generate its own UUIDs for identities independently. While it's theoretically possible for two separate instances to generate the same UUID (as UUIDs are designed to be unique but not guaranteed to be), the probability of this happening is extremely low. To ensure complete separation and avoid any potential conflicts, it's recommended to use Ory Network for multi-tenant setups, as stated in the documentation: "[Ory Network](https://console.ory.sh) is the only available option to have a multi-tenant Ory Kratos set up." If you absolutely need to run multiple Kratos instances separately, you should be aware that they will operate independently, and you'll need to manage data synchronization and potential conflicts yourself.
r
@chilly-king-10285 i don't think i need to sync it since on my case for every ory kratos instance will serve different webstore
b
A message from kapa.ai
Based on your statement, it seems you're planning to use separate Ory Kratos instances for different webstores without the need for synchronization. This approach aligns with the information provided in the knowledge sources. You're correct that if each Ory Kratos instance is serving a different webstore independently, you don't need to synchronize the data between them. This setup is similar to the example provided in the [Multiple custom domains documentation](https://www.ory.sh/docs/kratos/bring-your-own-ui/configure-ory-to-use-your-ui#multiple-custom-domains): "ACME Car Parts company has three online storefronts for three different types of automotive products: - mufflers.com - carseats.com - wipers.com" In this example, each store has its own domain and custom UI, but they're all managed within a single Ory Network project. However, your case is slightly different as you're planning to use separate Ory Kratos instances. It's important to note that while this approach can work, there are some considerations: 1. Each Kratos instance will have its own separate user base. Users will need to create accounts for each webstore independently. 2. As mentioned in the documentation: "Since these stores are hosted on different domains, the users must sign in and get an Ory Session issued for the store's domain when they switch between the storefronts." 3. Remember that self-hosting multiple Kratos instances doesn't provide the benefits of a true multi-tenant setup. As stated in the [Multitenancy documentation](https://www.ory.sh/docs/kratos/guides/multi-tenancy-multitenant), Ory Network is the recommended solution for multi-tenant setups. If you're comfortable with these limitations and your use case doesn't require shared user accounts across webstores, then your approach of using separate, non-synchronized Ory Kratos instances for different webstores can be a viable solution.