Using S3 as storage

With an S3 service ready to use (either as a private Minio installation, or directly on AWS), it can now be used to store transcoded audio files instead of storing them directly on a filesystem. Amazon provides an SDK to use many AWS services from Python (S3, EC2, Elasticsearch, and so on). This SDK is open-source (https://github.com/boto/boto3), and available on PyPI in the boto3 package. This is the package that will be used to store the encoded files in the S3 database.

Several evolutions are needed to use S3 storage instead of the local filesystem:

  • Implementing an S3 driver
  • Returning FLAC data in the encode driver
  • Adding S3 information in the configuration file
  • Using the new driver in the application

These evolutions mainly consist of using a new driver in the application. So, the reactivity diagram of the application evolves to the following example:

Figure 7.5: The audio transcoding server with S3 storage

The main change is the addition of the S3 driver after the transcode driver. Also, the output of the transcode driver is now a buffer.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.84.169