My knowledge about AG is very limited and I'm not a DBA.
We have 4 machines - each of them is hosting two databases, say DB1 and DB2. DB1 is has its own AG (say AG1) which is replicated to other 3 machines, and DB2 also has its own AG (say AG2) which is also replicated to same 3 machines. DB1 and DB2 are write replicas. Other 3 machines have read-replicas.
Now if machine 1 fails, what usually happens is that DB1 from machine 1 can fail over to DB1 on machine 3 (and becomes a WRITE replica), and DB2 from machine 1 can fail over to DB2 on machine 4 (and become a WRITE replica).
Question -
In case of machine 1 goes down, is it possible to enforce sql server to fail over both databases (DB1 and DB2) from machine 1 to the same machine? Meaning, I want WRITE replicas of both databases to be always on one machine. Thank you!
Yes. Put both databases in the same Availability Group.