SlideShare a Scribd company logo
CONTENT STAGING 
IN DRUPAL 8 
DICK OLSSON TWITTER: @dickolsson 
ADVANCED SITE BUILDING
AGENDA 
What is content staging? 
What we want from the solution 
How it's (being) built for Drupal 8 
Reusable protocols 
Headless Drupal
WHO AM I? 
Dick Olsson 
Digital Engineering Manager 
at Pfizer 
dixon_ on drupal.org 
@dickolsson on Twitter 
Web technologist 
Drupal contributor
WHAT IS 
CONTENT STAGING?
SIMPLE WORKFLOW 
Stage Prod
SECURE PUBLISHING 
Stage Prod 
Corporate firewall
MERGE WORKFLOW 
Stage 
Edit 1 
Edit 2 
Edit 3 
Prod
HUB/SPOKE WORKFLOW 
A 
D Editorial B 
C
RING MODEL 
A 
D B 
C
IT'S SORT OF... 
Content staging 
Content sharing 
Replication 
Syndication
WHAT WE WANT
WHAT WE WANT 
We don't want to build just a “content staging” 
system. 
We need a generic and loosely coupled 
“content replication” framework capable of 
arbitrarily moving content between system.
WHAT WE WANT 
Learning from the Drupal 7 implementations of 
UUID, Deploy and WF Tools modules.
WHAT WE WANT 
Revisions everywhere 
Conflict detection 
Easier dependency management 
Ad-hoc / Continuous replication 
Bi-directional replication 
REST API
HOW IT'S BUILT
HOW IT'S BUILT 
Contrib: 
Multiversion 
Relaxed Web Services 
Deploy 
Core: 
Serialization 
Restful Web Services 
Entity API
multiversion.module 
Tracks update sequences in order to make 
dependency management a lot easier. 
Provides revision support for all content 
entities. 
Tracks revision trees in a way similar to Git to 
support conflict detection.
multiversion.module 
Revisions are not tracked with a UUID. A hash 
calculated from the actual changes is better. 
This way it's easier for each server to detect 
conflicts without deep inspection or asking the 
network. 
<?php 
md5($this->serialize(array( 
$deleted, 
$sequence_id, 
$old_rev, 
$normalized_entity 
), 'json'));
{ 
id: [{value: 1}], 
uuid: [{value: aabbcc}] 
_revs_info: [ 
{rev: 2-gghhii}, 
{rev: 1-ddeeff} 
], 
_local_seq: 1, 
_deleted: 0, 
} 
multiversion.module
multiversion.module 
CRAP instead of CRUD. 
Entities are never deleted. This is needed in 
order to replicate deletions while also being 
able to handle conflicts. Much like Git. 
A “compaction” job can be run on cron to purge 
old revisions if needed.
<?php 
namespace DrupalmultiversionEntity; 
class SqlContentEntityStorage extends [...] { 
use SqlContentEntityTrait; 
//... 
} 
multiversion.module
<?php 
namespace DrupalmultiversionEntity; 
class SequenceIndex implements SequenceIndexInterface { 
function _construct(KeyValueFactoryInterface $kv) {} 
// ... 
} 
multiversion.module
<?php 
namespace DrupalmultiversionEntity; 
class ConflictManager implements ConflictManagerIf { 
// ... 
} 
class CompactionManager implements CompactionManagerIf { 
// ... 
} 
multiversion.module
relaxed.module 
Provides a Restful/Relaxed JSON API. 
Endpoints for all content entities and file 
attachments. 
Endpoints for comparing revisions, 
starting/stopping replications and other 
administrative tasks. 
Drush plugin for running replications.
<?php 
namespace DrupalrelaxedPluginrestresource; 
/** 
* @RestResource( 
* id = “relaxed:doc” 
* ) 
*/ 
class DocResource extends ResourceBase { 
//... 
} 
relaxed.module
<?php 
namespace DrupalrelaxedPluginrestresource; 
/** 
* @RestResource( 
* id = “relaxed:_bulk_docs” 
* ) 
*/ 
class BulkDocsResource extends ResourceBase { 
//... 
} 
relaxed.module
<?php 
namespace DrupalrelaxedPluginrestresource; 
/** 
* @RestResource( 
* id = “relaxed:_changes” 
* ) 
*/ 
class ChangesResource extends ResourceBase { 
//... 
} 
relaxed.module
<?php 
namespace DrupalrelaxedPluginrestresource; 
/** 
* @RestResource( 
* id = “relaxed:_revs_diff” 
* ) 
*/ 
class RevsDiffResource extends ResourceBase { 
//... 
} 
relaxed.module
deploy.module 
A simple UI to manage replications and 
conflicts
HOW REPLICATION WORKS 
1. Identify source and target by UUID 
2. Get the current checkpoint from target site 
3. GET /_changes?since=N from source site 
4. Pass result to /_revs_diff on target site 
5. Collect all missing revisions from source site 
6. POST /_bulk_docs on target 
7. Save new checkpoint on target site
DEMO
DEMO 
:-(
REUSABLE PROTOCOLS 
The revision and conflict detection model 
is taken from both Git and CouchDB. 
The replication protocol along with the API 
spec is taken from CouchDB.
REUSABLE PROTOCOLS 
Reusing API specifications lends the 
framework to unexpected use cases and 
that otherwise would not be possible 
(CouchDB, PouchDB, TouchDB etc).
HEADLESS DRUPAL 
AngularJS 
PouchDB Replication
CONCLUSIONS 
Not straight port of the Drupal 7 modules. 
Loosely coupled system will cover more 
use cases and lend itself to unexpected 
ones as well. 
Implementing battle tested protocols.
SPECIAL THANKS 
Andrei Jechiu (jeqq on drupal.org 
for working to these modules.
FRIDAY CODE SPRINT 
Follow @drupalmentoring 
https://amsterdam2014.drupal.org/sprints 
Help improve Drupal: Sprint with the community on Friday. 
- We have tasks for every skill set. 
- Mentors are available for new contributors. 
- An optional Friday morning workshop will help you set up 
community tools.
WHAT DID YOU THINK? 
EVAULATE THIS SESSION - AMSTERDAM2014.DRUPAL.ORG/SCHEDULE 
THANK YOU! 
DRUPAL: dixon_ TWITTER: @dickolsson

More Related Content

ODP
Planning for CRAP and entity revisions in Drupal core
Dick Olsson
 
ODP
Let's Take Drupal Offline!
Dick Olsson
 
PPTX
Take your drupal sites offline
Chris Ward
 
PDF
Tech Webinar: Offline First: Creare un'app Phonegap che funzioni offline e si...
Codemotion
 
PDF
[drupalday2017] - Drupal come frontend che consuma servizi: HTTP Client Manager
DrupalDay
 
PDF
Apache Sling as an OSGi-powered REST middleware
Robert Munteanu
 
PDF
Offline first, the painless way
Marcel Kalveram
 
PDF
DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalCampDN
 
Planning for CRAP and entity revisions in Drupal core
Dick Olsson
 
Let's Take Drupal Offline!
Dick Olsson
 
Take your drupal sites offline
Chris Ward
 
Tech Webinar: Offline First: Creare un'app Phonegap che funzioni offline e si...
Codemotion
 
[drupalday2017] - Drupal come frontend che consuma servizi: HTTP Client Manager
DrupalDay
 
Apache Sling as an OSGi-powered REST middleware
Robert Munteanu
 
Offline first, the painless way
Marcel Kalveram
 
DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalCampDN
 

What's hot (20)

PDF
Drupal and diversity of Single sign-on systems
Alex S
 
PPTX
Javascript Frameworks Comparison
Deepu S Nath
 
PPTX
Sfk13
Flamur Mavraj
 
PDF
WordPress 2017 with VueJS and GraphQL
houzman
 
PDF
Backbone & React Together Forever
Samuel Breed
 
PDF
Understanding Microservices
M A Hossain Tonu
 
PPTX
Developing advanced universal apps using html & js
Senthamil Selvan
 
PDF
Put a little Backbone in your WordPress vs. 3
adamsilverstein
 
PDF
Backbone.js with React Views - Server Rendering, Virtual DOM, and More!
Ryan Roemer
 
PDF
Introduction to Meteor - Worldwide Meteor Day
M A Hossain Tonu
 
PDF
Effective Web Application Development with Apache Sling
Robert Munteanu
 
PPTX
Introduction to JS frameworks
Deepu S Nath
 
KEY
New Perspectives on Performance
mennovanslooten
 
PPTX
Put a little Backbone in your WordPress
adamsilverstein
 
PPTX
Organized web app development using backbone.js
Shakti Shrestha
 
PDF
Static website generators
Merlin Rebrović
 
PDF
WordPress as the Backbone(.js)
Beau Lebens
 
PDF
The Javascript Toolkit 2.0
Marcos Vinícius
 
PPTX
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
Sencha
 
PDF
With Drupal Your Website is an API
Charlie Morris
 
Drupal and diversity of Single sign-on systems
Alex S
 
Javascript Frameworks Comparison
Deepu S Nath
 
WordPress 2017 with VueJS and GraphQL
houzman
 
Backbone & React Together Forever
Samuel Breed
 
Understanding Microservices
M A Hossain Tonu
 
Developing advanced universal apps using html & js
Senthamil Selvan
 
Put a little Backbone in your WordPress vs. 3
adamsilverstein
 
Backbone.js with React Views - Server Rendering, Virtual DOM, and More!
Ryan Roemer
 
Introduction to Meteor - Worldwide Meteor Day
M A Hossain Tonu
 
Effective Web Application Development with Apache Sling
Robert Munteanu
 
Introduction to JS frameworks
Deepu S Nath
 
New Perspectives on Performance
mennovanslooten
 
Put a little Backbone in your WordPress
adamsilverstein
 
Organized web app development using backbone.js
Shakti Shrestha
 
Static website generators
Merlin Rebrović
 
WordPress as the Backbone(.js)
Beau Lebens
 
The Javascript Toolkit 2.0
Marcos Vinícius
 
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
Sencha
 
With Drupal Your Website is an API
Charlie Morris
 
Ad

Viewers also liked (20)

PDF
[HKDUG] #20160626 - HKOSCon 2015 - Website DIY with Drupal 8
Wong Hoi Sing Edison
 
PDF
What is Drupal? And Why is it Useful? Webinar
Suzanne Dergacheva
 
PPT
CMS web publishing solution for a travel related website using Drupal
InfoBeans Technologies Ltd.
 
PDF
Developing a Communication & Knowledge management Strategy - my experience at...
Jacqueline Nyagahima
 
PPTX
Building Archivable Websites
nullhandle
 
PPTX
Drupal Migration
永对 陈
 
PDF
Migrate
Zivtech, LLC
 
PDF
Staging Drupal 8 31 09 1 3
Drupalcon Paris
 
PDF
Drush 5.0 (DrupalCamp LA 2012) - Chris Charlton
Chris Charlton
 
PDF
Moving In: how to port your content from * to Drupal
Emma Jane Hogbin Westby
 
PPT
Create Website In Indian Languages using drupal
drupalindia
 
PDF
Recipes for Drupal distributions
Lakshmi Narasimhan Parthasarathy
 
PPTX
8 Web Practices for Drupal
Wingston
 
PDF
GeorgiaGov's move to Drupal - presentation by Nikhil Deshpande @nikofthehill
Nikhil Deshpande
 
PDF
Using Drupal Features in B-Translator
Dashamir Hoxha
 
PDF
Moving Drupal to the Cloud
Ari Davidow
 
PDF
Drupal in the Cloud with Windows Azure
Ford AntiTrust
 
PDF
The Wonderful World of Drupal 8 Multilingual
Suzanne Dergacheva
 
ODP
Drupal: My Search for a CMS
Jim Heil
 
PPTX
Data migration to Drupal using the migrate module
Luc Bézier
 
[HKDUG] #20160626 - HKOSCon 2015 - Website DIY with Drupal 8
Wong Hoi Sing Edison
 
What is Drupal? And Why is it Useful? Webinar
Suzanne Dergacheva
 
CMS web publishing solution for a travel related website using Drupal
InfoBeans Technologies Ltd.
 
Developing a Communication & Knowledge management Strategy - my experience at...
Jacqueline Nyagahima
 
Building Archivable Websites
nullhandle
 
Drupal Migration
永对 陈
 
Migrate
Zivtech, LLC
 
Staging Drupal 8 31 09 1 3
Drupalcon Paris
 
Drush 5.0 (DrupalCamp LA 2012) - Chris Charlton
Chris Charlton
 
Moving In: how to port your content from * to Drupal
Emma Jane Hogbin Westby
 
Create Website In Indian Languages using drupal
drupalindia
 
Recipes for Drupal distributions
Lakshmi Narasimhan Parthasarathy
 
8 Web Practices for Drupal
Wingston
 
GeorgiaGov's move to Drupal - presentation by Nikhil Deshpande @nikofthehill
Nikhil Deshpande
 
Using Drupal Features in B-Translator
Dashamir Hoxha
 
Moving Drupal to the Cloud
Ari Davidow
 
Drupal in the Cloud with Windows Azure
Ford AntiTrust
 
The Wonderful World of Drupal 8 Multilingual
Suzanne Dergacheva
 
Drupal: My Search for a CMS
Jim Heil
 
Data migration to Drupal using the migrate module
Luc Bézier
 
Ad

Similar to Content Staging in Drupal 8 (20)

PPTX
We need revisions and CRAP everywhere in Drupal core
Dick Olsson
 
PPTX
Workflow Initiative
timmillwood
 
KEY
Drupal Meetup Lisbon
Paulo Gomes
 
PPTX
Using deploy in drupal 8
timmillwood
 
ZIP
Staging and Deployment
heyrocker
 
PDF
What in store in drupal 8
Shyamala Rajaram
 
ODP
Drupal in 5mins + Previewing Drupal 8.x
Wong Hoi Sing Edison
 
PDF
High Available Drupal
Bram Vogelaar
 
PDF
Meetup - retour sur la DrupalCon Dublin 2016
Yann Jajkiewicz
 
PPTX
Decoupling Drupal 8.x: Drupal’s Web Services Today and Tomorrow
Acquia
 
PDF
DeCoupling Drupal
Aimee Maree
 
PDF
Modernize Your Drupal Development
Chris Tankersley
 
PDF
Drupal - Changing the Web by Connecting Open Minds - Josef Dabernig
DrupalCampDN
 
PDF
Decoupling Content Management
Henri Bergius
 
PDF
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
camp_drupal_ua
 
ODP
Hong Kong Drupal User Group - 2014 March 8th
Wong Hoi Sing Edison
 
PDF
Drupal, git and sanity
Charlie Morris
 
ODP
Drupal Architecture and functionality
Ann Lam
 
PDF
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Erich Beyrent
 
PDF
Drupal 8.3.0: the features are ready, are you?
Gábor Hojtsy
 
We need revisions and CRAP everywhere in Drupal core
Dick Olsson
 
Workflow Initiative
timmillwood
 
Drupal Meetup Lisbon
Paulo Gomes
 
Using deploy in drupal 8
timmillwood
 
Staging and Deployment
heyrocker
 
What in store in drupal 8
Shyamala Rajaram
 
Drupal in 5mins + Previewing Drupal 8.x
Wong Hoi Sing Edison
 
High Available Drupal
Bram Vogelaar
 
Meetup - retour sur la DrupalCon Dublin 2016
Yann Jajkiewicz
 
Decoupling Drupal 8.x: Drupal’s Web Services Today and Tomorrow
Acquia
 
DeCoupling Drupal
Aimee Maree
 
Modernize Your Drupal Development
Chris Tankersley
 
Drupal - Changing the Web by Connecting Open Minds - Josef Dabernig
DrupalCampDN
 
Decoupling Content Management
Henri Bergius
 
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Hong Kong Drupal User Group - 2014 March 8th
Wong Hoi Sing Edison
 
Drupal, git and sanity
Charlie Morris
 
Drupal Architecture and functionality
Ann Lam
 
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Erich Beyrent
 
Drupal 8.3.0: the features are ready, are you?
Gábor Hojtsy
 

More from Dick Olsson (6)

PDF
Workflow Initiative Update
Dick Olsson
 
PDF
What Really Changed with Drupal 8
Dick Olsson
 
PDF
Multisite Content Deployments for Media Organizations
Dick Olsson
 
ODP
Content Staging in Drupal Core
Dick Olsson
 
PPT
How to Build a Scalable Platform for Today's Publishers
Dick Olsson
 
ODP
Drupal distributions - how to build them
Dick Olsson
 
Workflow Initiative Update
Dick Olsson
 
What Really Changed with Drupal 8
Dick Olsson
 
Multisite Content Deployments for Media Organizations
Dick Olsson
 
Content Staging in Drupal Core
Dick Olsson
 
How to Build a Scalable Platform for Today's Publishers
Dick Olsson
 
Drupal distributions - how to build them
Dick Olsson
 

Recently uploaded (20)

PDF
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
PDF
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
PDF
Immersive experiences: what Pharo users do!
ESUG
 
PPTX
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
PPTX
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
PDF
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PPTX
Odoo Integration Services by Candidroot Solutions
CandidRoot Solutions Private Limited
 
PDF
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
PDF
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
PPT
Activate_Methodology_Summary presentatio
annapureddyn
 
PDF
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
ESUG
 
PDF
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
PDF
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
PDF
WatchTraderHub - Watch Dealer software with inventory management and multi-ch...
WatchDealer Pavel
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PDF
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
PDF
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
PPTX
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
Immersive experiences: what Pharo users do!
ESUG
 
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
Odoo Integration Services by Candidroot Solutions
CandidRoot Solutions Private Limited
 
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
Activate_Methodology_Summary presentatio
annapureddyn
 
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
ESUG
 
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
WatchTraderHub - Watch Dealer software with inventory management and multi-ch...
WatchDealer Pavel
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 

Content Staging in Drupal 8

  • 1. CONTENT STAGING IN DRUPAL 8 DICK OLSSON TWITTER: @dickolsson ADVANCED SITE BUILDING
  • 2. AGENDA What is content staging? What we want from the solution How it's (being) built for Drupal 8 Reusable protocols Headless Drupal
  • 3. WHO AM I? Dick Olsson Digital Engineering Manager at Pfizer dixon_ on drupal.org @dickolsson on Twitter Web technologist Drupal contributor
  • 4. WHAT IS CONTENT STAGING?
  • 6. SECURE PUBLISHING Stage Prod Corporate firewall
  • 7. MERGE WORKFLOW Stage Edit 1 Edit 2 Edit 3 Prod
  • 8. HUB/SPOKE WORKFLOW A D Editorial B C
  • 9. RING MODEL A D B C
  • 10. IT'S SORT OF... Content staging Content sharing Replication Syndication
  • 12. WHAT WE WANT We don't want to build just a “content staging” system. We need a generic and loosely coupled “content replication” framework capable of arbitrarily moving content between system.
  • 13. WHAT WE WANT Learning from the Drupal 7 implementations of UUID, Deploy and WF Tools modules.
  • 14. WHAT WE WANT Revisions everywhere Conflict detection Easier dependency management Ad-hoc / Continuous replication Bi-directional replication REST API
  • 16. HOW IT'S BUILT Contrib: Multiversion Relaxed Web Services Deploy Core: Serialization Restful Web Services Entity API
  • 17. multiversion.module Tracks update sequences in order to make dependency management a lot easier. Provides revision support for all content entities. Tracks revision trees in a way similar to Git to support conflict detection.
  • 18. multiversion.module Revisions are not tracked with a UUID. A hash calculated from the actual changes is better. This way it's easier for each server to detect conflicts without deep inspection or asking the network. <?php md5($this->serialize(array( $deleted, $sequence_id, $old_rev, $normalized_entity ), 'json'));
  • 19. { id: [{value: 1}], uuid: [{value: aabbcc}] _revs_info: [ {rev: 2-gghhii}, {rev: 1-ddeeff} ], _local_seq: 1, _deleted: 0, } multiversion.module
  • 20. multiversion.module CRAP instead of CRUD. Entities are never deleted. This is needed in order to replicate deletions while also being able to handle conflicts. Much like Git. A “compaction” job can be run on cron to purge old revisions if needed.
  • 21. <?php namespace DrupalmultiversionEntity; class SqlContentEntityStorage extends [...] { use SqlContentEntityTrait; //... } multiversion.module
  • 22. <?php namespace DrupalmultiversionEntity; class SequenceIndex implements SequenceIndexInterface { function _construct(KeyValueFactoryInterface $kv) {} // ... } multiversion.module
  • 23. <?php namespace DrupalmultiversionEntity; class ConflictManager implements ConflictManagerIf { // ... } class CompactionManager implements CompactionManagerIf { // ... } multiversion.module
  • 24. relaxed.module Provides a Restful/Relaxed JSON API. Endpoints for all content entities and file attachments. Endpoints for comparing revisions, starting/stopping replications and other administrative tasks. Drush plugin for running replications.
  • 25. <?php namespace DrupalrelaxedPluginrestresource; /** * @RestResource( * id = “relaxed:doc” * ) */ class DocResource extends ResourceBase { //... } relaxed.module
  • 26. <?php namespace DrupalrelaxedPluginrestresource; /** * @RestResource( * id = “relaxed:_bulk_docs” * ) */ class BulkDocsResource extends ResourceBase { //... } relaxed.module
  • 27. <?php namespace DrupalrelaxedPluginrestresource; /** * @RestResource( * id = “relaxed:_changes” * ) */ class ChangesResource extends ResourceBase { //... } relaxed.module
  • 28. <?php namespace DrupalrelaxedPluginrestresource; /** * @RestResource( * id = “relaxed:_revs_diff” * ) */ class RevsDiffResource extends ResourceBase { //... } relaxed.module
  • 29. deploy.module A simple UI to manage replications and conflicts
  • 30. HOW REPLICATION WORKS 1. Identify source and target by UUID 2. Get the current checkpoint from target site 3. GET /_changes?since=N from source site 4. Pass result to /_revs_diff on target site 5. Collect all missing revisions from source site 6. POST /_bulk_docs on target 7. Save new checkpoint on target site
  • 31. DEMO
  • 33. REUSABLE PROTOCOLS The revision and conflict detection model is taken from both Git and CouchDB. The replication protocol along with the API spec is taken from CouchDB.
  • 34. REUSABLE PROTOCOLS Reusing API specifications lends the framework to unexpected use cases and that otherwise would not be possible (CouchDB, PouchDB, TouchDB etc).
  • 35. HEADLESS DRUPAL AngularJS PouchDB Replication
  • 36. CONCLUSIONS Not straight port of the Drupal 7 modules. Loosely coupled system will cover more use cases and lend itself to unexpected ones as well. Implementing battle tested protocols.
  • 37. SPECIAL THANKS Andrei Jechiu (jeqq on drupal.org for working to these modules.
  • 38. FRIDAY CODE SPRINT Follow @drupalmentoring https://amsterdam2014.drupal.org/sprints Help improve Drupal: Sprint with the community on Friday. - We have tasks for every skill set. - Mentors are available for new contributors. - An optional Friday morning workshop will help you set up community tools.
  • 39. WHAT DID YOU THINK? EVAULATE THIS SESSION - AMSTERDAM2014.DRUPAL.ORG/SCHEDULE THANK YOU! DRUPAL: dixon_ TWITTER: @dickolsson