Every request processed within Appirator is assigned a file system. This is done automatically and developers do not need to configure or code anything in order to acquire the file system.
The file systems have two reserved directories:
/perm - this is a reference to permanent storage for the currently running
application. Because it’s permanent it is shared across processes and is consequently
subject to the risk concurrency issues. As a result, developers should take
care not to write to the same files across different threads or processes./scripts - this is a read only directory that contains all the files
that are present in the /scripts directory in all of the modules that are
included in the running application. It is important to note that this directory
cannot be walked or listed. Files can only be read from this directory if
the exact file path is known.All other areas of the request file system, including the root, are ephemeral. In other words, they survive only for the duration of the request. Any files written to the ephemeral areas are automatically deleted at the end of the request.
Attaching the file system to the request and detaching it at the end of the request is free in terms of processing time. The exception to this is where local storage on the node on which the request is being prcessed has been exhausted. In this case, a request is made to the global storage pool in the environment for more local storage and mounting this new storage can take tens of milliseconds. This is quite rare though because the reserves of local storage are designed to be adequate for all requests currently being processed.
The files under /perm/ are physically located in the permanent storage associated
with the cloud provider, i.e. S3 in AWS, Google Cloud Storage or Blob Storage
in Azure. As a result, the speed of reading and writing to this directory
is limited by the associated cloud storage.
Because the remaining ephemeral storage is local SSD, the read and write speed is essentially the speed of reading and writing to any local storage, i.e. very fast.