State that outlives one processintermediate
Anything a later request needs — encryption keys, a session, a one-time code, a live connection — has to live where every replica can reach it, because the next request may land on any of them.
Order receipts arrive about half the time. The customer is connected to one pod, the order finishes on the other, and that pod has nobody to send to. Connect the pods to each other.
AssumesThe receipt sent to the wrong phoneThis is the notifier built there, now on two pods. Sending through IHubContext to the right user comes first; reaching the pod that user is on comes second.
SignalR has a Redis backplane with an app prefix, and the client connects with WebSockets directly.
Published in full, before you start — every point is one of these and there is nothing else.
Anything a later request needs — encryption keys, a session, a one-time code, a live connection — has to live where every replica can reach it, because the next request may land on any of them.
A hardcoded API secret is a secret in your git history; IOptions<T> binds configuration into a typed object your code asks for like anything else.
A SignalR hub object lives for one call and then is thrown away, so sending from anywhere else goes through IHubContext and has to name the user it is for.