Moving to a service oriented architecture from tightly coupled applicationsi xavier briand

31
Xavier Briand Senior Web Application Developer ExperiencePoint Inc (please excuse my accent)

description

Lessons from a year of rearchitecting tightly coupled 4-year-old applications to a SOA while keeping developers happy (for the most part). For a year, ExperiencePoint's development team has been rebuilding its aging applications to a modern and highly available architecture. We have been able to spend more time on developing our new products while reducing our technological debt by building on top of standard technologies, separating concerns and automating our working environment. This talk will show the benefits of splitting omniscient applications to smaller independent modules and explain why your web applications should use HTTP RESTful API to communicate with each other. We'll also explore a few strategies to deal with aging PHP applications or deprecated technologies.

Transcript of Moving to a service oriented architecture from tightly coupled applicationsi xavier briand

Page 1: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Xavier BriandSenior Web Application Developer

ExperiencePoint Inc

(please excuse my accent)

Page 2: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand
Page 3: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

mobro.co/xavierbriand

Page 4: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Moving to aService Oriented Architecture

from tightly coupledapplications

Page 5: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

ExperiencePoint"The best way to learn is to experience."

Page 6: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Business

(1+½)+(4+3) simulations

Page 7: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand
Page 8: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand
Page 9: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Previous Architecture

Page 10: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Problemstightly coupled applications

no dependency management

no tests

deprecated technologies

1 dev symptoms

2 environments

SVN

Page 11: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

ExperienceChange Model

Page 12: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Meet the dev team

Page 13: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Step 1

Reset ðGoal: efficient dev environment

VM

Modern SCM

Modern Frameworks

Tasks automation

Page 14: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Problem

Dependency management

logo: WizardCat

$ make build

Page 15: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

{ "name" : "ep/ec", "license" : "proprietary", "autoload" : { "psr-0": { "": "src/" } }, "require": { "php" : ">=5.3.3", "symfony/symfony" : "~2.4", "doctrine/orm" : "~2.2,>=2.2.3", "ep/backend-sdk-bundle" : "dev-master", "ep/old-stuff" : "dev-trunk" }, "require-dev": { "phpunit/phpunit": "3.7.*" }}

Page 16: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

$ php composer.phar ______ / ____/___ ____ ___ ____ ____ ________ _____ / / / __ \/ __ ̀__ \/ __ \/ __ \/ ___/ _ \/ ___// /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/ /_/

Available commands: install Installs the project dependencies from the composer.lock file if present, require Adds required packages to your composer.json and installs them search Search for packages self-update Updates composer.phar to the latest version. status Show a list of locally modified packages update Updates your dependencies to the latest version according to composer.json, validate Validates a composer.json

Page 17: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Problem

App config managementcomposer (Platform packages)

incenteev/composer-parameter-handler$ make build

Page 18: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Problem

QA

+jenkins-php.org

$ make prepare analysis

Page 19: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Step 2

“Defeat in detail”Divide and gather (DRY)

Keep things small + KISS

Design by contract

Leverage your architecture

Page 20: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Opportunity: GlobalTech

Page 21: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

InsideRemove Flash... No! Ok but:

Let’s use the best technologyto do the job

AMF => plain HTTP via browser

Business Logic => Backend

Frontend UI => Flash

Page 22: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Hypermedia API> POST /games/ + content

< 201 Created < Location /games/1

> GET /games/1

< 200 Ok < < <game> < <!-- ... --> < <links rel=”actionX” src=”...”></links> < <links rel=”actionY” src=”...”></links> < </game>

David Zuelke "Designing HTTP Interfaces and RESTful Web Services"

Page 23: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Globally

Page 24: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Implementation

Strategy Pattern

Page 25: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Solutions

OAuth2

Page 26: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Solutions

Backend App API

Page 27: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Solutions

Product API

Page 28: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

The other way around

Page 29: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Step 3

ConsolidateBackendAppSdkBundle

OAuth2ClientBundle

ApiBundle

AssetsBundle

Rinse and repeat...

Page 30: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Step 4

Plan for the futur

Page 31: Moving to a service oriented architecture from tightly coupled applicationsi   xavier briand

Question? (four 9)joind.in/9999

Symfony

We are hiring!experiencepoint.com/careers