© 2019 Adobe. All Rights Reserved. Adobe Confidential.
Magento Remote Storage with AWS S3
© 2019 Adobe. All Rights Reserved. Adobe Confidential.
Oleh Posyniak
© 2019 Adobe. All Rights Reserved. Adobe Confidential.
Introduction
© 2019 Adobe. All Rights Reserved. Adobe Confidential.
Comparison of AWS storages
4
S3
• Cheaper
• Lifecycle control
• Easy to setup and use
• Application-side
• Pay per API calls only
(within same region)
EFS
• Faster
• More expensive
• Server-side
• Pay per storage
EBS
• Faster
• More expensive
• Server-side
• Pay per storage
• Single EC2 instance
per EBS volume
© 2019 Adobe. All Rights Reserved. Adobe Confidential.
Architecture
© 2019 Adobe. All Rights Reserved. Adobe Confidential.
Use cases
6
Node 1 Node 2 Node N
AWS S3 bucket
External ERP
AWS EC2 with
GlusterFS
(Magento
Cloud)
EFS/EBS
volume
© 2019 Adobe. All Rights Reserved. Adobe Confidential.
Adapters
Driver/FileInterface with
Flysystem adapter
Flysystem/Azure Flysystem/DigitalOcean Flysystem/…
Magento/AwsS3
7
© 2019 Adobe. All Rights Reserved. Adobe Confidential.
Configuration and authentication
© 2019 Adobe. All Rights Reserved. Adobe Confidential.
Bucket permissions
9
© 2019 Adobe. All Rights Reserved. Adobe Confidential.
Bucket authentication
Method Is supported on
prem
May be supported on
Cloud
Is recommended
Access key + Secret
key
Yes No No
IAM role Yes Yes Yes
10
© 2019 Adobe. All Rights Reserved. Adobe Confidential.
Stored folders
pub/media var/import,export
11
© 2019 Adobe. All Rights Reserved. Adobe Confidential.
Image resizing
© 2019 Adobe. All Rights Reserved. Adobe Confidential.
Configurations
Name get.php (default) Nginx proxy_pass Fastly
(fastly/magento2)
Web-server Apache/Nginx Nginx Apache/Nginx
Additional
configuration
None Nginx config Fastly module and vcl
Resizing backend backend/Nginx backend/Fastly
Recommended No Yes Yes
Performance Poor Good Good
Cost More Less Less
13
© 2019 Adobe. All Rights Reserved. Adobe Confidential.
Image resizing with Nginx
14
Request Nginx
Remote
storage
In
cache
?
Resizing
needed?
Store in
cache
Respons
e
Yes
No
Resize
Yes
No
© 2019 Adobe. All Rights Reserved. Adobe Confidential.
Caching
© 2019 Adobe. All Rights Reserved. Adobe Confidential.
Overview
16
Edge cache, CDN
Magento instance
Remote storage
Persistent cache
© 2019 Adobe. All Rights Reserved. Adobe Confidential.
Caching
Image (file, binary format)
• Local storage (TBA)
Metadata (size, width, height)
• Memory
• File
• Redis with predis/predis extension
17
© 2019 Adobe. All Rights Reserved. Adobe Confidential.
Cache adapters
• Enabled by default
• Per-request
Memory
• Requires Redis
• Additional configuration
• Persistent
predis/predis
• Not implemented
php-redis
• Not implemented
Stash
18
© 2019 Adobe. All Rights Reserved. Adobe Confidential.
Demo
19
© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Magento 2 with Remote Storage

  • 1.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential. Magento Remote Storage with AWS S3
  • 2.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential. Oleh Posyniak
  • 3.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential. Introduction
  • 4.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential. Comparison of AWS storages 4 S3 • Cheaper • Lifecycle control • Easy to setup and use • Application-side • Pay per API calls only (within same region) EFS • Faster • More expensive • Server-side • Pay per storage EBS • Faster • More expensive • Server-side • Pay per storage • Single EC2 instance per EBS volume
  • 5.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential. Architecture
  • 6.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential. Use cases 6 Node 1 Node 2 Node N AWS S3 bucket External ERP AWS EC2 with GlusterFS (Magento Cloud) EFS/EBS volume
  • 7.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential. Adapters Driver/FileInterface with Flysystem adapter Flysystem/Azure Flysystem/DigitalOcean Flysystem/… Magento/AwsS3 7
  • 8.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential. Configuration and authentication
  • 9.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential. Bucket permissions 9
  • 10.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential. Bucket authentication Method Is supported on prem May be supported on Cloud Is recommended Access key + Secret key Yes No No IAM role Yes Yes Yes 10
  • 11.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential. Stored folders pub/media var/import,export 11
  • 12.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential. Image resizing
  • 13.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential. Configurations Name get.php (default) Nginx proxy_pass Fastly (fastly/magento2) Web-server Apache/Nginx Nginx Apache/Nginx Additional configuration None Nginx config Fastly module and vcl Resizing backend backend/Nginx backend/Fastly Recommended No Yes Yes Performance Poor Good Good Cost More Less Less 13
  • 14.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential. Image resizing with Nginx 14 Request Nginx Remote storage In cache ? Resizing needed? Store in cache Respons e Yes No Resize Yes No
  • 15.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential. Caching
  • 16.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential. Overview 16 Edge cache, CDN Magento instance Remote storage Persistent cache
  • 17.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential. Caching Image (file, binary format) • Local storage (TBA) Metadata (size, width, height) • Memory • File • Redis with predis/predis extension 17
  • 18.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential. Cache adapters • Enabled by default • Per-request Memory • Requires Redis • Additional configuration • Persistent predis/predis • Not implemented php-redis • Not implemented Stash 18
  • 19.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential. Demo 19
  • 20.
    © 2019 Adobe.All Rights Reserved. Adobe Confidential.