Skip to Content
Full Stack Serverless
book

Full Stack Serverless

by Nader Dabit
July 2020
Intermediate to advanced
181 pages
3h 53m
English
O'Reilly Media, Inc.
Content preview from Full Stack Serverless

Chapter 10. Working with Images and Storage

Many applications need to have a way to manage file, image, and video storage. While it’s possible to transform these objects into binary data and store them directly in your database, it’s usually better not to. Instead, using a managed file-hosting service like Amazon S3 is better because it’s less expensive, faster, and just as secure.

In this chapter, we’ll look at how to create a photo-sharing app that renders posts with photos in a stream in real time, allowing you to share an image along with a caption for the image.

Using Amazon S3

Amazon S3 allows you to have secure file hosting that scales as you need it. Amplify uses S3 as the Storage category for handling the storage of files like images, videos, PDFs, and more.

When working with S3, you typically will have three types of file access available:

Public

Items stored with public access will be accessible by all users of your app. These files are stored under the public/ path in your S3 bucket. Public does not mean that anyone with the URL of the resource can view it, though. In order to be viewed, you must use the Amplify SDK to retrieve a temporarily signed URL of the resource. This signed URL will be set to expire after a set period of time (15 minutes by default).

Private

Items are readable by all users, but writable only by the creating user. In S3, the files are stored under the path private/{user_identity_id}, where the user_identity_id corresponds to the unique Amazon ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Full Stack Testing

Full Stack Testing

Gayathri Mohan

Publisher Resources

ISBN: 9781492059882Errata Page