Before we talk about stateful sets and why we need it, lets just start with simple server. We are going to deploy a database.
So we install and set up MySQL in the server and create the database.
Other applications can use it and write data. We are going to have high available (HA) set up to reduce failures. So we deploy additional servers and installed MySQL on those servers.
Now we have the blank database on the new servers. So how do we replicate data from original database to new databases?