Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building Serverless Web Applications

You're reading from  Building Serverless Web Applications

Product type Book
Published in Jul 2017
Publisher Packt
ISBN-13 9781787126473
Pages 354 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Diego Zanon Diego Zanon
Profile icon Diego Zanon
Toc

Amazon S3 (for media files)


S3 is not a database, it is only a storage system. It lacks a database engine and many storage features, but it can be pretty useful for saving media files such as photos, videos, and music.

This approach is already very popular. For example, if you develop an application that uses a MongoDB database, you could use MongoDB GridFS to store large binary data. However, the most efficient solution is to offload this kind of data to cloud services because the machines responsible for your database are usually the most expensive ones. It means that the cost per gigabyte in a database is usually higher than a cloud storage service, such as S3.

In our serverless store, we are storing the product images in SimpleDB/DynamoDB as string fields. Instead of saving the full binary data, we save just the URL of the image file. Example:

https://s3.amazonaws.com/serverless-store-media/product-images/lonely-bird.jpg

When we receive this information in the frontend, the <img> element...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}