Angular JS and Magento

12
JSON Angular Magento Vinci Rufus www.neevtech.com @areai51

description

From my talk at Imagine 2013 Barcamp about builing a lightning fast ap with JSON, AngularJS and Magento

Transcript of Angular JS and Magento

Page 1: Angular JS and Magento

JSON Angular Magento

Vinci Rufuswww.neevtech.com

@areai51

Page 2: Angular JS and Magento
Page 3: Angular JS and Magento

Web Server’s Workload

Web server

&Database

Pull up the Page

Read the XML

Query the

Database

Build the page on the fly

Render the page

Serve Assets & Media

Page 4: Angular JS and Magento

Performance & Scaling Mantra

• Reduce stress on the Web server & DB

– Clones [Multiple App Servers & DB Master Slaves]

– Caching [Fullpage Caching / Memcache]

– Varnish

– Move the workload to the Client Side

Page 5: Angular JS and Magento

Empower the Browser

• Browsers are Powerful but under utilized.

• Offload mundane tasks to the Client Side.

• Go Back to the Server only when needed.

Page 6: Angular JS and Magento

De-Couple your App

• Server spits out JSON

• Presentation Layer Sits on the Client Side.

• JavaScript parses the JSON data and populates the dynamic content blocks, images are pulled from S3 / Cloudfront.

Page 7: Angular JS and Magento

In Magento’s Context

• JSON output contains Product Catalog along with necessary attributes.

• Layered Navigation, Filters, Sorting, keyword Search done 100% Client side on JSON data.

• Product Inventory check is an AJAX request to the server.

• Add to Cart, Checkout are direct requests to the server.

• For Recently Viewed Products, use Local Storage or IndexedDB.

Page 8: Angular JS and Magento

Web App

Browser

Scalable Architecture

Magento

RESTWeb services

RDSS3

EC2

Web App

Page 9: Angular JS and Magento

Web App

Browser

Insanely Scalable Architecture

Server

RDSS3

EC2

JSONJSON

Media / Images Folder

Web App

Page 10: Angular JS and Magento

Performance Metrics

Webpagetest.org

Pingdom.com

YSlow

Page 11: Angular JS and Magento

New Possibilities

• Windows 8 and Mac OS

• Native Tablet Apps

• Touch Screen Kiosks

Page 12: Angular JS and Magento

Thank You

http://jam.neevtech.com

-Vinci [email protected]

@areai51

Just Another Magento