42
Decoupling Drupal

Decoupling Drupal - Drupal Camp Toronto 2014

Embed Size (px)

DESCRIPTION

What if you could say to a front-end developer: “Build it the best way you know how and with the best tools available. Don’t worry that we’re using Drupal” You can see the presentation video here https://www.youtube.com/watch?v=W1rc5CEro6U or go to the last slide.

Citation preview

Page 1: Decoupling Drupal - Drupal Camp Toronto 2014

Decoupling Drupal

Page 2: Decoupling Drupal - Drupal Camp Toronto 2014

Alex De Winne• 15 years in the industry

• Drupal since 4.7

• Founder of Therefore

• Hacker, visionary, tech enthusiast

& musician

Page 3: Decoupling Drupal - Drupal Camp Toronto 2014

“Build it the best way you

know how and with the best

tools available. Don’t worry

that we’re using Drupal”

What if you could say to a front-end developer:

Page 4: Decoupling Drupal - Drupal Camp Toronto 2014

Use Drupal more like it’s a Content

Management System and less like it’s a

Web Publishing Tool

Page 5: Decoupling Drupal - Drupal Camp Toronto 2014

WPT vs CMS

The goal of a Web Publishing Tool is to capture

content with the primary purpose of publishing web

pages.

The goal of any CMS should be to allow storage of

structured content and dissemination of content to any

platform, in any presentation, at any time.

Page 6: Decoupling Drupal - Drupal Camp Toronto 2014

Decoupling Drupal

It means making no assumptions as to where your

content will end up.

What’s required is complete separation between

the Backend Content Model and the Front-End.

It’s about seeing Drupal as a component of a

Distributed CMS rather than a Monolith Web

Publishing Tool.

Page 7: Decoupling Drupal - Drupal Camp Toronto 2014

Typical Drupal Architecture

Browser

Drupal

Browser

Page 8: Decoupling Drupal - Drupal Camp Toronto 2014

The Monolithic Stack

In the 90’s, virtually all

applications were written using

well defined stacks of services

and deployed on a single

monolithic, proprietary server.

1995

Thick, client-server app

on thick client

Well-defined stack:

• O/S

• Runtime

• Middleware

Monolithic

Physical

Infrastructure

Does this look familiar?

Page 9: Decoupling Drupal - Drupal Camp Toronto 2014

The Landscape

Page 10: Decoupling Drupal - Drupal Camp Toronto 2014

Karen says we need…

Reusable content

Structured content

Meaningful meta data

A presentation independent CMS

Page 11: Decoupling Drupal - Drupal Camp Toronto 2014

COPE

• NRP has been operating a decoupled CMS for over

10 years.

• NPR credits its API with increasing page views by

80%, largely because they’re able to get their

content onto a variety of mobile devices without

custom programming.

Create Once, Publish Everywhere

Page 12: Decoupling Drupal - Drupal Camp Toronto 2014

NPR’s COPE Architecture

CMSData

EntryStatic

DataAPI Cache Renders

Page 13: Decoupling Drupal - Drupal Camp Toronto 2014

Case Studywww.niagaracruises.com

Page 14: Decoupling Drupal - Drupal Camp Toronto 2014

Client

Host

Twitter

Sprints 1 - 2

Discovery

Static Design & Rebuild

AODA Single A

Launch

Page 15: Decoupling Drupal - Drupal Camp Toronto 2014

MySQL

Blog

Authoring

Client

Host

DocPad

Static

Site

Disqus

Twitter

Sprints 3 - 4

Drupal + Services

Node + Hapi Router

Blog CMS Coverage

Heroku

Page 16: Decoupling Drupal - Drupal Camp Toronto 2014

Heroku

MySQL

DocPad

Static

Site

Full

CMS

Authoring

Client

HostDisqus

Twitter

Sprint 5

80% CMS Coverage

Page 17: Decoupling Drupal - Drupal Camp Toronto 2014

Heroku

MySQL

DocPad

Static

Site

Client

HostDisqus

Twitter

Sprint 6 - 7

AODA AA

French & Spanish

Translate

Full

CMS

Authoring

Page 18: Decoupling Drupal - Drupal Camp Toronto 2014

Heroku

MySQL

DocPad

Static

Site

CMS

Authoring

Client

HostDisqus

Twitter

Translate

Page 19: Decoupling Drupal - Drupal Camp Toronto 2014
Page 20: Decoupling Drupal - Drupal Camp Toronto 2014

What We Learned

&

What You Can Expect to

Change When Working in a

Decoupled CMS Architecture

Page 21: Decoupling Drupal - Drupal Camp Toronto 2014

You’ll start to think differently

about your CMS

• You’ll start to see your CMS as a

tool content writers and content

architects like to hang out.

• Front-end developers will see it an

API to a content repository. No

longer a system that dictates which

technologies they can or can’t use.

Page 22: Decoupling Drupal - Drupal Camp Toronto 2014

Workflow Optimization

• Prototypes can turn into the real

thing with no extra work. Just add

API™

• Decreased dependancies allow

teams to operate more efficiently.

• Reduces the risk that a change

made within one element will

create unanticipated changes

within other elements.

Page 23: Decoupling Drupal - Drupal Camp Toronto 2014

Upgradeability / Interchangeability

• Swap out front-ends, keep the back-

end as is

• Add front-end publishing end points,

keep the back-end as is

• Back-end upgrades, keep the front-

end as is.

Page 24: Decoupling Drupal - Drupal Camp Toronto 2014

Increased Reliability and

Security

• A full stack CMS falls apart if any

component stops working properly. It’s

pretty hard to break a static website.

• Drupal can be safely hidden behind a

corporate firewall. Only the API is

required to be exposed, and optionally

restricted to only interfacing with the

static server.

Page 25: Decoupling Drupal - Drupal Camp Toronto 2014

Increased Scope Flexibility

In many cases it’s not a requirement to

have 100% CMS coverage.

If we’re working towards a fixed cost

project with a flexible scope, one of the

elements that could get de-prioritized is

CMS coverage.

It can always be added later.

Page 26: Decoupling Drupal - Drupal Camp Toronto 2014

Speed and Scalability

• Caching of the static files in memory

• Serving files from a CDN or a load

balanced configuration

• Utilizing a distributed file system to

avoid slow disk performance

bottlenecks

It doesn’t get much faster than a static site. But, when you

need even more speed here are some options:

Page 27: Decoupling Drupal - Drupal Camp Toronto 2014

Multi-Channel Publishing

Multi-Channel publishing becomes a

reality.

Additional projects can be seen as

extensions to the existing

infrastructure rather than a static

implementation.

Page 28: Decoupling Drupal - Drupal Camp Toronto 2014

Human Resources

Doors are opened to a greater

talent pool.

Front-end designers and developers

don’t need to be Drupal developers.

Page 29: Decoupling Drupal - Drupal Camp Toronto 2014

Can’t All Be Rainbows

and Unicorns

Page 30: Decoupling Drupal - Drupal Camp Toronto 2014

Challenges

Authentication and roles are

potentially more complicated to

setup.

Reusable logic patterns become

non-reusable when moved to the

front-end.

Challenges arise with X-domain

requests.

Page 31: Decoupling Drupal - Drupal Camp Toronto 2014

Where Can It Go From

Here?

Page 32: Decoupling Drupal - Drupal Camp Toronto 2014

DevOps Service Components

Redis

PaaS

S3CDN

Content Delivery

Network module

Pantheon, Aberdeen, Acquia

Amazon Cloud

File System

Caching DB

Server

Page 33: Decoupling Drupal - Drupal Camp Toronto 2014

External Cloud Services

Redis

Disqus

Prediction

Twilio

Hapi

RouterPaaS

S3CDN

Translate Google

Voice API

Comments

Page 34: Decoupling Drupal - Drupal Camp Toronto 2014

API Based Front-End Publishing

Redis

Disqus

Prediction

Twillio

Hapi

Router

DocPad

Static

Site

iPhone AppPrint

Workflow

PaaS

S3CDN

Translate

HTTP Router

HTML Site

Native AppPDF Document

Page 35: Decoupling Drupal - Drupal Camp Toronto 2014

Standardized Content Model

Redis

PHPCR

Storage

API

Mongo

DB

Midgard2

Hapi

Router

DocPad

Static

Site

iPhone AppPrint

WorkflowMedium

PaaS

S3CDN

Disqus

Prediction

Twillio

Translate

Standardized

Storage API

JCR

Compatible

Data Store

CouchDB

Page 36: Decoupling Drupal - Drupal Camp Toronto 2014

Decoupled Authoring Tools

Redis

PHPCR

Storage

API

Mongo

DB

Midgard2

Hapi

Router

DocPad

Static

Site

iPhone AppPrint

Workflow

Authoring

Tools

Gather

Content

Medium

PaaS

S3CDN

Custom

iPad App

Disqus

Prediction

Twillio

Translate

Page 37: Decoupling Drupal - Drupal Camp Toronto 2014

Redis

PHPCR

Storage

API

Mongo

DB

Midgard2

Hapi

Router

DocPad

Static

Site

iPhone AppPrint

Workflow

Authoring

Tools

Gather

Content

Medium

PaaS

S3CDN

Distributed CMS based on

Best-of-Breed Components

Custom

iPad App

Disqus

Prediction

Twillio

Translate

Page 38: Decoupling Drupal - Drupal Camp Toronto 2014

Is this all a bunch of blue sky

dreaming?

Maybe, but check out what prismic is up to…

Page 39: Decoupling Drupal - Drupal Camp Toronto 2014

It features a Writing Room for content writers to author,

manage and store content, and a Content Query API for

developers to integrate managed content into any website or

app.

REST, JSON or HTML,

effective API browser,

easy to use

Comfortable content creation

experience. Addressing

content writers’ real-life

problems.

Content is API-based.

Inject it easily into new

platforms and sites.

Page 40: Decoupling Drupal - Drupal Camp Toronto 2014

Questions

Page 41: Decoupling Drupal - Drupal Camp Toronto 2014

Thank you

Page 42: Decoupling Drupal - Drupal Camp Toronto 2014

Links• http://docpad.org/

• spumko.github.io/

• http://phpcr.github.io/

• http://prismic.io

• http://www.exoplatform.com/ (CMS that uses JCR)

• http://nedonosko.blogspot.ca/2009/09/jcr-based-content-

management.html

• http://www.html5rocks.com/en/tutorials/cors/