Hello, i try to setup a microservice architecture ...
# talk-kratos
a
Hello, i try to setup a microservice architecture with kratos. Ive sketched up the infrastructe, but im not sure kratos works within this scenario. Can someone review my drawing and tell me if this would be possible. https://imgur.com/a/4LlpODg Let me explain the drawing: • DB1 & DB2 are postgres database instances which replicate • Kratos1-4 are Kratos instances that have DB1 or DB2 configured • Loadblancer - distribute requests (round robin) • Frontend - Sends requests to microservices or to loadbalancer for ( login, registration ) • mircoApp1-5 will respond to API-Requests from the frontend an check on each request if a valid session exists against one of the kratos instances Question: Can microApp1-5 check the kratos session (for api-requests) on Kratos2-4 even if the session was created by Kratos1? Thanks in advance for feedback
l
Right. I’m not an expert on PostgreSQL replication but this could create an issue if the replication lag is large enough so the next request which should be authenticated hits instance in a different pool. We use MySQL with row-based replication and we did ran into such issues. What is worth considering is load balancing on DB side which will probably improve resiliency. When one DB will go offline you would still have one instance to work with and all of your Kratos instance will still work.