Use buffered writes for RDB.
Use io.ReadFull instead of homegrown implementation.
Use io.ReadFull instead of homegrown implementation.