I have build an API in .NET Core. It's pretty simple, using Entity Framework Core. I have the application load balanced to one database (in a cluster environment.) To give the complete picture; this is basically what I have (the problem is in the API):
It is operational inside an Kubernetes cluster, but I don't think the problem has anything to do with that.
The load balancing is round robin, so one request goes to pod 1 and the other to pod 2. When I change some entity, this change is only visible in that pod (but is written to the database.) The other pod doesn't do a new request to the database.
I think that the problem is that there is some sort of memory caching in the application or in the Entity Framework. But I can't find how to solve this problem.