<@U04UQ68083H> is there a reason why for Ory Keto,...
# ory-copilot
d
@chilly-king-10285 is there a reason why for Ory Keto, we need two different addresses for reads and writes?
c
A message from kapa.ai
Yes, Ory Keto requires two different addresses for reads and writes. This is part of the system's design to separate the concerns of reading and writing data, which can be beneficial for performance, security, and scalability reasons. In the configuration file
keto.yml
, you can specify different hosts and ports for the read and write APIs. Here is an example from the extracts:
Copy code
yaml serve:    read:    host: 0.0.0.0    port: 4466    write:    host: 0.0.0.0    port: 4467
In this example, the read API is served on port 4466 and the write API on port 4467. This separation allows you to scale the read and write operations independently, which can be useful in scenarios where you have heavy read or write loads. For more information, you can refer to the [Ory Keto documentation](https://www.ory.sh/docs/keto/guides/migrating-legacy-policies).
d
How would I scale the reads and writes?
@chilly-king-10285 How would I scale the reads and writes?
c
A message from kapa.ai
Scaling Ory services, including Ory Keto, is straightforward and adheres to the 12-factor principles. To scale, you simply spin up another instance (VM, Docker container, or pod) with the same configuration. This applies to both read and write operations. There are no additional requirements for scaling when self-hosting Ory Keto. Here is an example of how you might scale Ory Keto using Docker:
Copy code
bash docker run -d --name keto1 -p 4466:4466 -p 4467:4467 oryd/keto:latest docker run -d --name keto2 -p 4468:4466 -p 4469:4467 oryd/keto:latest
In this example, two instances of Ory Keto are running, effectively doubling the capacity for handling read and write operations. The first instance is serving on ports 4466 and 4467, and the second instance is serving on ports 4468 and 4469. Remember to ensure that all instances are using the same configuration and are connected to the same database. For more information, refer to the [Ory Keto documentation](https://www.ory.sh/docs/keto/guides/production) and the [Ory Scalability documentation](https://www.ory.sh/docs/self-hosted/operations/scalability).