31
Application Design for the Cloud/AWS Jonathan Holloway (@jph98) Application Architect @ Brightpearl

Application design for the cloud using AWS

Embed Size (px)

Citation preview

Page 1: Application design for the cloud using AWS

Application Design for the Cloud/AWS

Jonathan Holloway (@jph98)Application Architect @ Brightpearl

Unknown
Could drop this slide... to save some time in the overall presentation
Unknown
Sentence doesn't make any sense :)
Page 2: Application design for the cloud using AWS

A little bit of background

Brightpearl grew out of a company called Lush Longboards in Bristol

Chris Tanner and Andrew Mulvenna identified a need for a single online business management app

First customer on Brightpearl in 2007

Over 1300 customers currently on Brightpearl and growing

The numbers:

Founded 2007Today, we have:

1,300+ customers53 countries

87 employees(in San Francisco and Bristol)

$1.3 billiongmv processed

Page 3: Application design for the cloud using AWS

What Does Brightpearl Do?

- Multi-channel integration (Amazon, Ebay) - Storefront integration - Inventory, orders, and customers - Logistics and shipping - Web and POS interface - App store for third party integrations

Page 4: Application design for the cloud using AWS

Business @ Scale on the Amazon Platform

Over 1,300 customers run on our cloud based platform

Page 5: Application design for the cloud using AWS

Company Culture

Rapidly growingTeam, Product, Technology, Career

Team and PeoplePassionate, Diverse, Agile

The way we workOpen Plan, Open Minded, Autonomous

Great social lifeWe call our colleagues friends and do fun stuff together outside the office.

Career developmentWe invest in our people and support their career aspirations.

Open atmosphereOur managers don’t have offices and openly tell us about the business’ progress.

Multi-cultural workforceWe have employees who come from over 20 different countries.

Page 6: Application design for the cloud using AWS

Tech Culture

General tech lunch and learns (TLAL) for various technology talks (Java, PHP, Javascript)

Ruby project workshop for building apps once every two weeks, encourage use outside development

Friday - half day for personal tech projects, e.g. dashboards, product improvements

Java Meetup Group for external talks with developers from other companies in the Bristol and Bath area. We host PHPSW along with Basekit in Bristol

Page 7: Application design for the cloud using AWS

My Background

Application Architect - Solutions/Technical, Developer

Started with SaaS back in 2010 with email archiving and large scale storage/search solution

- Cassandra, Hadoop, Pig, Lucene and Jersey

Worked in statistical computing with distributed grids (Oracle Grid Engine, LSF). Deployed on large compute clusters internally in pharma, looked at cloud based solution using Starcluster, Python

Java background, Ruby, Python and Javascript

Page 8: Application design for the cloud using AWS

Cloud, Tech Overview

Page 9: Application design for the cloud using AWS

SaaS - Big Product Examples

Lots of big SaaS based products on the web today including:

On-demand movie rental

Customer Relationship Management

Microsoft Office Toolsuite Online

Conference and collaboration

Page 10: Application design for the cloud using AWS

SaaS and PaaS and IaaS

It’s all very confusing… think of it as a pyramid

IaaS - Infrastructure as a service (Tools/services for devops)- Amazon EC2, Windows Azure, Heroku

PaaS - Platform as a service (Tools/services for app devs)- AWS Beanstalk, Heroku, Google App Engine, Redhat

Openshift

SaaS - Software as a service (Apps for end users - yay)- e.g. Netflix, Brightpearl, Salesforce, Office365

Page 11: Application design for the cloud using AWS

How do I know when a product should be SaaS based?

- Have to be careful with data requirements, data at rest, transfer because of the public cloud. VPC and VPN can help.

- I/O and throughput might prohibit movement of files

- Have to be careful don’t just move your application into the cloud… break it down… re-assemble with cloud based application services

- Factor in availability, performance, failover, reliability. Don’t underestimate reliability

Page 12: Application design for the cloud using AWS

SaaS - Archiving Solution

Customer Account Metadata

Postgres/Slony

Search Services

SOLR

SOLR

SOLR

Content Extraction

Tika Tika

Content Storage

Solaris/ZFS

Search Interface

Django

Tika

Mail Archive

Mail Archive

Mail Archive

- Worked on this for a private cloud solution- Why doesn’t it fit the public cloud - Amazon/Rackspace?- Couldn’t move it “as is”

Page 13: Application design for the cloud using AWS

SaaS Distributed Grid - Cloud Bursting Scenario

Oracle Grid Engine

Grid Master

Slave

Slave

Slave

Stats Desktop

SAS

Matlab

Amazon Cloud

Slave(m3 large)

Slave(m3 large)

Slave(m3 large)

Slave(g2 GPU)

Slave(g2 GPU)

Slave(g2 GPU)

1. Provision new instances

2. Extend Capacity Internally

3. Transfer Files

4. Execute Files

5. Shutdown when done

R

Page 14: Application design for the cloud using AWS

SaaS eCommerce Business Management Scenario

Page 15: Application design for the cloud using AWS

Amazon Web Services - Cloud Computing Services

Using AWS for ~ 4 years as a IaaS platform

Brightpearl is designed for use on AWS

Make use of both US and European datacentres, multi-availability zones - approx 90 EC2 instances

All Amazon Linux based images, use Centos 5.x in dev/test

We approximate an environment for development and test

Page 16: Application design for the cloud using AWS

Architectural Overview

Will break it down into the following views:

- Infrastructure and Operating System

- Application Services (Queuing, Data Storage, Load Balancing)

- Software Stack (Brightpearl Application - JS, PHP and Java)

Page 17: Application design for the cloud using AWS

Infrastructure

We build on various Amazon base Images (based on Amazon Linux) with different specifications...

- m1 medium (webserver) - t1 micro (mail relay)- m1 small (messaging)

EC2Instances is useful - http://www.ec2instances.info/

Software is provisioned on top of the base O/S with Chef (we maintain this configuration and keeping it up to date).

Page 18: Application design for the cloud using AWS

Application Services

Elastic Compute Cloud (based off Xen)- Various instance sizes (small, medium large, xlarge)- Basis is an AMI - Centos, RHEL, Windows

Amazon RDS (Relational Database Service) - aka MySQL - Data Storage

Content delivery network, think Akamai- Global delivery of static resources (images, content)

Unknown
Could we merge these AWS adverts :) .... ?Ok - the list of the App Services onto one slide...
Page 19: Application design for the cloud using AWS

Application Services

Key/value store - useful for storing large data that won’t fit in a relational database

Amazon S3 - storage service for files

ELB (Elastic Load Balancer) - instance load balancing

Page 20: Application design for the cloud using AWS

Languages - Javascript

Javascript for DOM manipulation, data binding, validation

- Functional, oh so functional- JQuery for DOM manipulation and UI elements- Backbone for structure (+ CommonJS)- Mocha for testing- JS on the serverside - Node- Dependency Management (Bower, NPM)

Page 21: Application design for the cloud using AWS

Languages - PHP

PHP for web development in the presentation tier

- Dynamically typed, interpreted

- Single threaded

- Well supported, lots of third party software

- Lightweight, fast and proven

Page 22: Application design for the cloud using AWS

Languages - Java

Java for scaling services out

- Statically and strongly typed

- Good for concurrency and parallelisation

- Good library, framework & IDE support (Intellij)

- Build RESTful API’s for PHP to communicate with

Page 23: Application design for the cloud using AWS

Languages - Ruby

Ruby - for provisioning infrastructure, configuration and test

- Our “devops” and “test engineer” language- Dynamically typed, multi paradigm- Readable, testable, way cool- Great third party library support- Chef by Opscode used for configuring EC2 instances- Cucumber and Webdriver for application testing

Page 24: Application design for the cloud using AWS

Design Problems

Page 25: Application design for the cloud using AWS

AWS Design Considerations

Sometimes we need to be agnostic for performance, cost reasons and also for vendor (Amazon) lockin

Have to build in failover to each individual service

Don’t use SQS (Simple Queueing Service) - instead we roll our own

Roll our own datagrid for cross EC-2 instance data - an in-memory datagrid. Think distributed Java collections.

Make use of a distributed file system for transient file storage

Page 26: Application design for the cloud using AWS

Problems at Scale

Design for redundancy:

- Ephemeral storage by default. Use EBS (Elastic Block Storage)- Multiple copies of services deployed on instances- Multiple instances for failover

Design for scale:

- Partitioning of accounts using separate RDS instances

Page 27: Application design for the cloud using AWS

Problems at Scale

Design for concurrency:

- Immutability is key, Actor Model, STM are useful

Design for performance:

- Profile everything (Yourkit is great for this)- Java is very memory hungry… tune the JVM and GC strategy

Page 28: Application design for the cloud using AWS

Problems at Scale

Design for cost:

- Reserved instances (up-front cost) can save a fair bit

Design for content delivery:

- Server side caching (Varnish, mod_cache)

- Client side caching (expires headers, etags)

- Content Delivery Network - (Cloudfront, Akamai)

Page 29: Application design for the cloud using AWS

Design for failure:

- Internal Services (Redundant Copies)

- External Services

- Protect against them overloading your internal services

- Don’t flood them with your traffic

Problems at Scale

Page 30: Application design for the cloud using AWS

Future Tech

Some future technology we’re interested in...

- Web Components (Polymer)

- Functional JVM languages (JDK 8 Streams, Clojure)

- Docker (LXC containers) for virtualisation

- Interested in Quasar for lightweight threading

Page 31: Application design for the cloud using AWS

Oh by the way… we’re expanding...

Current Open PositionsSenior DevelopersGraduate Developers Test Engineers

Key Events @ Brightpearl5th August - Java Meetup Group20th August - PHPSW Meetup

Questions?