If we want to persist state that will survive even server failures, we have two options we can choose.
Local Storage
We could, for example, store data locally and replicate it to multiple servers. That way, a container could use local storage knowing that the files are available on all the servers. Such a setup would be too complicated if we’d like to implement the process ourselves. Truth be told, we could use one of the volume drivers for that. However, we’ll opt for a more commonly used method to persist the state across failures. We’ll use external storage.
External Storage
Since we are running our cluster in AWS, we can choose between S3, Elastic File System (EFS), and Elastic Block Store.
S3 is meant to be accessed through its API and is not suitable as a local disk replacement. That leaves us with EFS and EBS.