I have a general question about when scale-out architecture is recommended vs a single-gateway. Specifically, I'm curious about why & when would separating a project into multiple gateways be recommended vs a single gateway. Our current project utilizes two back-end gateways for PLC connections and for tag providers / history and a front-end gateway for the Vision clients. I've seen it mentioned that scale-out architecture is recommended for scalability for larger projects but haven't seen much explanation as to why it is better for scalability. Couldn't a single large gateway performing all the tasks be used, or does this perform worse in practice?
It can perform worse in practice, because workload for things like:
a lot of Vision Clients
a lot of Perspective Sessions
large or many DB queries
large or many Alarm Status queries
large or many History queries
many devices
can vary quite a bit, and for things like devices especially, there is a benefit to having steady and predictable memory usage patterns, while all of the other things on the list tend to cause more "bursty" and unpredictable usage.
Also, at least in theory, you can scale a Perspective front end horizontally (like thousands of client sessions? across multiple front end gateways, anyway) if you decouple it from the back end. It may also work for Vision, not sure.
In my experience, it is not the backend that needs scaling, but the front end. A backend on decent hardware that just interfaces with devices, pushing history to a database and, if not edge, performing regular DB transactions with devices, doesn't bog down until you hit hundreds of thousands or millions of tags. Java is really good at such workloads.
User interfaces are the primary source of grief in big systems. Big history queries are the most common culprit, especially in Perspective (Vision hands off the raw data to the client). I've watched Perspective users bog down a gateway enough to disrupt history storage. In some cases, causing a gateway restart (with data loss) due to memory exhaustion.
For best results, make your user interfaces query history against database replicas, not the live backend's database.
I would say that it's good to scale out your visualization from your data gateway if you're running a large number of clients. What constitutes a large number of clients is variable depending on your infrastructure and screen designs so use the status page as your guide to how taxed your system is.