Yes, you can configure the replica this way.
If so, what are the pros and cons?
Here's a doc explaining the basic functions of replica sets. Let's take a look at them taking into account the differences in RAM.
Pros:
- More computers mean better data backup . Having a 2GB node at least means that you have another copy of the data.
- Having 3 complete nodes in a replica set simplifies one maintenance .
Minuses:
- The presence of servers of different sizes is not suitable for automatic failover . Let's say that your 5 GB server is the main one. What happens when it goes down and the 2 GB server wins the election? You still have an automatic crash, but your performance probably dropped sharply.
- Reading scaling may not work very well. Depending on your read patterns, sending reads to a 2 GB server can result in many additional disk accesses and lower performance.
So, the big problem here is indeed one of the characteristics. If you just do this to install dev, then this will basically work. But in production, you run the risk of fully charging your application. If your application is used to run on 4 GB + RAM, and then suddenly drops to 2 GB, it may become unusable.
Most production plants want to switch to another computer with the same power.
source share