Skip to content

Instantly share code, notes, and snippets.

@pnispel
Last active August 8, 2018 01:32
Show Gist options
  • Save pnispel/bd4663340baf0710c8eb3e69de40d5e8 to your computer and use it in GitHub Desktop.
Save pnispel/bd4663340baf0710c8eb3e69de40d5e8 to your computer and use it in GitHub Desktop.

File Storage

File storage encompasses all the services that interact with AWS S3.

Concepts

Storage Profiles

Storage profiles are a way for us to determine where to read and store files. For now, the profiles are:

  • default which has purposes that point to buckets in us-east and us-west
  • govcloud which has buckets in us-gov-west
  • apse2 which has buckets in ap-southeast-2

Storage Purposes

As of now, the only place storage purposes are used are in the main Procore app. These are strings that along with a storage profile represent a bucket in a region.

Services

Binder is an elixir/pheonix app that takes a bucket, region, and key and returns a presigned url. Binder URLs are served in production through the domain storage.procore.com. Binder is able to return a url to any object in any bucket that the credentials allow.

Image processing is perhaps the largest service utilizing our AWS buckets. The services include creating thumbnails, merging PDFs, creating specifications, comparing images, and others. Image processing mainly uses our general buckets and thumbnail buckets.

Ecrion handles creating PDFs. Ecrion uses the buckets specified by the ecrion purpose.

Our zip lambda takes drawing tiles and creats a zip of those tiles. It mainly uses buckets specified by the general purpose.

Our Nginx zip service works by taking multiple shortened s3 urls and returning a zip of those files.

Procore Sync is a desktop client that syncs desktop files to our web services. It uses the buckets specified by the general purpose.

Architecture

The architecture is largely a hub and spoke model, where the procore/procore backend will act as a liason between apps (mobile, web, windows) and the services.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment