A non-transitory, computer-readable medium coupled to one or more processors and having instructions stored thereon which, when executed by the one or more processors, cause the one or more processors to perform operations, the operations comprising:
- receiving a request associated with storing content of a file at a storage service provided by a multiple availability zone cloud platform;
- in response to receiving the request, sending a lock request through a persistence interface to an in-memory data grid at a first instance of the storage service to lock the file for accessing;
- receiving, at the persistence interface, an input stream including the content of the file based on the request, wherein receiving the input stream includes:
- iteratively reading the input stream in portions;
- and
- iteratively storing, by the persistence interface, a read portion for the file in a first file system storage associated with instances of the storage service at a first availability zone, wherein during storing the read potion, the file is locked for accessing;
- in response to storing a portion of the file, providing, through the persistence interface, the stored portion of the file to a replication executor at the first instance of the storage service, wherein each portion is provided to the replication executor to request replication of read and stored portions of the content of the file from the input stream into a second file storage of a second availability zone of the multiple availability zone cloud platform;
- determining a mode of replication for executing transfer of portions of the input stream from the replication executor at the first instance of the storage service running at the first availability zone to a replication interface at a second instance of the storage service running at the second availability zone;
- and
- in response to determining that the mode of replication is synchronous, providing, by the replication executor, a request to store a stored portion of the input stream by the persistence interface of the first instance of the storage service at the first availability zone to the replication interface of the second instance of the storage service, wherein the request is to store the read and stored portion at the second file storage of the second availability zone.