I/O expander alternative
Look into something called a &quot;Shift Register&quot;. One shift register (not suitable for driving most relay coils) is the 74HC595. There are others.
If you drive solid state relays, if the per pin current is enough and that there are no inductance that would work.