drupal as a data purveyor, part ii

39
ASTONISH DESIGN CHANGE GAME astonishdesign.com @astonishdesign #ddtx13 Drupal as a Data Purveyor Layering Drupal with emerging technologies to create a performant, scalable data purveyor.

Upload: tim-hamilton

Post on 09-Feb-2017

78 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Drupal as a Data Purveyor

Layering Drupal with emerging technologies to create a performant, scalable data purveyor.

Page 2: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

ASTONISH DESIGNC H A N G E G A M E

Diana Montalion Dupuis@dianadupuis

Sam Heuck@samheuck

Andrew Elster@filmknurd

Page 3: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

ASTONISH DESIGNC H A N G E G A M E

We have a new website: astonishdesign.com

@Astonish_Design

Page 4: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

An open-source content management PHP/MySQL framework designed for rapid development of content-rich web applications.

Page 5: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Reasons (among many)

• Growth: evolving tool

• Foundation skill set

• User features

Page 6: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

http://jdhancock.com/ • JD Hancock• http://farm9.staticflickr.com/8322/8031897271_9c63e48a29_b.jpg

Page 7: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

“Big” Data

"Big" in relation to the amount of content Drupal is designed

to manage

Page 8: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Volume

Page 9: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Velocity

BIKE WALLS• http://www.bikewalls.com

Page 10: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Variety

Page 11: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Content

•Every kind of data•Coming from everywhere

Page 12: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Current Issues

•Bootstrapping•Bottlenecks - Normalized - Join Happy•Lack of solution architecture

Page 13: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

ViewsRapid

DevelopmentPlatform

Visitors& ContentAuthors

Miners

Who is the user?

Page 14: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Welcome to the future

When modularizing the architecture creates performant applications for all content and all users.

Page 15: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Traditional Optimizations

Page 16: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

DuplicateData

RapidDevelopment

Platform

API

DenormalizedDocument Storage for READS

NormalizedRelational for WRITES

Data Mining

Content & DataCreation

Page 17: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Cost of Bootstrap• Hooks allow modules to

customize behavior

• Drupal calls hooks during each stage of bootstrap

• More modules, more hooks called, slower bootstrap

Page 18: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Massive Callstacks

Page 19: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Bootstrap on Every Request

Page 20: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

ViewsRapid

DevelopmentPlatform

Visitors& ContentAuthors

Miners

Backbone.js

Twisted

JS

PhotonVert.xCelluloid::IO

PYTHON

PHP

JAVA

RUBY

Page 21: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

ViewsRapid

DevelopmentPlatform

Visitors& ContentAuthors

Miners

Backbone.js

Twisted

JS

PhotonVert.xCelluloid::IO

PYTHON

PHP

JAVA

RUBYSources

Page 22: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

API and Node.JS

Page 23: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Why Proxy External Sources?

OK

your.domai

GET

OK

other.domain

OPTION

Yes

GET

Page 24: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

RESTful

Robert Tadlock • http://www.flickr.com/photos/rtadlock/2716877199/

http://apigee.com/about/api-best-practices Since you are building the API, you can make it any way you want, but following some good basic REST conventions is a good idea.

It will make it easier to integrate with front end frameworks.

Page 25: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Pick a FrameworkExpress or Restify

•http://expressjs.com•http://mcavage.github.com/node-restify

Page 26: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Pick a Connector

Tony Hisgett • http://www.flickr.com/photos/hisgett/

http://mongoosejs.com/Mongoose

Alternatives•Mongolia•Mongo Skin•Native MongoDB Driver

Page 27: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

ExampleExpress & Mongoose

Page 28: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Create a Resource

Page 29: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Create an Endpointhttp://domain/resources

{ [ { “someField”: “blah blah blah” “anotherField”: 2 }

...

] }

Page 30: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

On the Front-end

Page 31: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

ViewsRapid

DevelopmentPlatform

Visitors& ContentAuthors

Miners

Backbone.js

Twisted

JS

PhotonVert.xCelluloid::IO

PYTHON

PHP

JAVA

RUBYSources

Page 32: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Isn’t JS Slow?Yes but....

1. JS and devices continue to improve

2. We've improved the overall round trip: faster data, smaller payload, no bootstrap. It's still faster overall.

Page 33: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Organize Your CodeOn the front-end, you could write everything as AJAX calls and jQuery DOM manipulation, but that will get messy very quickly as your application grows in sophistication.

In the interests of maintainability and sanity, use a framework that organizes your code and abstracts away the DOM. There are many to choose from. A new one probably came out this morning.

Page 34: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

We use Ember because it is straightforward to use, powerful, flexible, and still fairly light weight. Backbone has been around for a while and is quite nice, but we like how Ember handles garbage collection and the other goodies it ships with.

What Why Howhttp://www.emberjs.com Why Discourse Uses Ember •Official Guides

•Resources•Fire Up Ember•Ember Camp•Darthdeus V. Ember•

Page 35: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Results fromRich Snippets

For Algebraix, all the data comes from an external source, so it makes sense to run the application on the client side, as opposed to importing the data into Drupal first.

It also makes the control panel feel more responsive. No more click and hope while waiting for the interface to receive data. Now we've created a conversation with the user.

Page 36: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Page 37: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Essential question ...

Why use Drupal?

Don’t use Drupal if you don’t need it.

Page 38: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

The role of the themer

Front engineer

Page 39: Drupal as a Data Purveyor, Part II

ASTONISH DESIGNC H A N G E G A M E astonishdesign.com@astonishdesign #ddtx13

Questions?