Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Storing User Files with Express, Stormpath, and Amazon S3

Storing User Files with Express, Stormpath, and Amazon S3

These are slides from a webinar talk I gave on October 6, 2016 in which I explain to developers:

- How to best store user files for web applications using Amazon S3.
- How to build a simple and secure Express website with express-stormpath.
- How to upload and manage user files using express-stormpath-s3.

Randall Degges

October 06, 2016
Tweet

More Decks by Randall Degges

Other Decks in Programming

Transcript

  1. Storing User
    Files with
    Express,
    Stormpath, and
    Amazon S3
    @rdegges

    View full-size slide

  2. I’m Randall Degges
    Developer Evangelist at
    Stormpath
    Python / Node / Go
    Hacker

    View full-size slide

  3. Agenda
    - Stormpath Intro (5 minutes)
    - Main Talk (30 minutes)
    - Q/A (15 minutes)

    View full-size slide

  4. Intro to Stormpath
    API Service Website Mobile App

    View full-size slide

  5. We Do a Lot
    - Libraries for many languages
    - AD / LDAP
    - Single Sign On (SAML)
    - OAuth2
    - Social Login
    - Multi-Tenancy
    - Groups and Roles
    - Email Workflows

    View full-size slide

  6. What’s the problem?

    View full-size slide

  7. www.awesome.io
    avatar.png
    receipt.pdf
    invoice.pdf
    Stormpath!
    ???

    View full-size slide

  8. How do people
    usually store user
    files?

    View full-size slide

  9. Database Columns

    View full-size slide

  10. No!!!
    - Makes DB queries for each image view.
    - Slows down DB.
    - DBs aren’t good at this sort of IO (heavy disk
    reading).
    - Slow performance for end users.

    View full-size slide

  11. Your Webserver(s)
    Webserver
    avatar.png
    avatar.png
    avatar.png avatar.png avatar.png
    avatar.png
    avatar.png
    avatar.png
    LOW
    DISK
    SPACE!!
    OMG!
    Backups?!

    View full-size slide

  12. Amazon S3
    - Reliability.
    - Durability.
    - Availability.
    - Cost.
    - Speed.
    - Security ACLs.

    View full-size slide

  13. How S3 Works
    webserver

    View full-size slide

  14. Cool, Right?

    View full-size slide

  15. So… Let’s Build Something!

    View full-size slide

  16. This sets up the S3 client and adds simple
    file methods onto . Required.

    View full-size slide

  17. Upload Files
    Path to local file you want to upload.

    View full-size slide

  18. Upload Files (cont)
    Desired ACL for file.

    View full-size slide

  19. Delete Files

    View full-size slide

  20. Resources
    - https://github.com/rdegges/express-stormp
    ath-s3
    - https://aws.amazon.com/s3/
    - https://stormpath.com/
    - https://github.com/rdegges/express-stormp
    ath-s3-webinar
    - https://docs.aws.amazon.com/AmazonS3/lat
    est/dev/acl-overview.html

    View full-size slide

  21. You’re
    awesome.
    @rdegges

    View full-size slide