is that reporting yesterday
okay all right okay hi everybody welcome
this is decoupled Drupal across the
stack if you're looking for RFPs or
something else here not in the right
room I'm just going to ask because I
think there will be some stragglers
coming into the room if you have an
empty seat if you're on this side of the
room and we have an empty seat to your
left please scoot over one just so that
we can leave these aisle seats open for
people who are coming in late thank you
very much and this is a great
opportunity to meet your neighbors and
say hi all right so first of all just to
set the stage here I just want to get a
sense of the room and figure out who we
all are I know it's after lunch so we're
not going to be very sleepy but how many
people here are new to Drupal great okay
a couple of us how many people have
never heard the term decoupled Drupal
before in this room Wow
okay all right how many people have
already built a decoupled Drupal build
okay all right I see a few familiar
faces in here so that's good and how
many people are not Drupal developers
site builders evaluators content editors
okay good so my hope is that this
session will have something for
everybody this is the aqueous session of
MIT camp and I'm going to talk a little
bit about what decoupled Drupal is why
it's so important to us what you should
know about it and finally most
importantly how aqueon Able's you to
succeed with decoupled Rubel so how many
people by the way we're at my top two
years ago here at MIT camp where I
discussed decoupled ruling okay few of
you okay
some of that content will be repeated
here but it's actually been updated
quite a bit so you'll see a lot of
changes from that content well welcome
to all of you who am I like here Who am
I
my name is Preston I am the director of
research and innovation at Acquia I work
on the office of CTO which is a team of
people that is
tasked with working on Drupal itself and
also mapping out sort of future roadmap
stuff for Acquia as well so I run our
app via lab steam which is our
innovation department at Acquia and I'm
also the lead subject matter expert and
kind of evangelist for decouple Drupal
at Acquia I've also been a contributor
to Drupal for many years now I built my
first triple site in oh seven went to my
first Drupal camp in Oh 8 and I've been
involved in spark since that point and
also spoken a lot about these kinds of
topics so there's a hashtag here if you
want to use it there's my email there's
my Twitter and we'll go ahead and get
started but first just to give you a
little bit of an idea of what it is that
I do and my other half of my job I also
manage our FBI labs team which is our
elite team of engineers that works on
innovative projects that push the
envelope so if you're looking at
futuristic ideas and you're looking for
that expertise that's deep expertise in
Drupal and emerging technologies and you
don't have that it's that sort of
expertise in-house please come and talk
to me labs would love to talk and see if
we can figure out a way to help here's
were going to cover today unfortunately
I am going to be very forthright and say
that I work to my local this morning so
I do not have demos of Ember and react
to show you today I was hoping to do
that but during lunch I wasn't able to
actually get that to work so I will be
showing you however some videos as well
as one or two small demos so I do
apologize that a lifetime the will not
happen in the way that I was hoping to
we're going to start off with what
decoupled Drupal is for those of you who
know what the couple Drupal is this is
probably going to be old hat for you I
want to talk very quickly though after
that point about the decoupled Drupal
ecosystem what it is in the Drupal
community that we've built what it is
that's really powerful in Drupal in
terms of our tools and all the things
that we've done in terms of API firsts
and in terms of all of the projects that
many people have contributed to in the
community how do those help out with our
decoupled Drupal build so I'm going to
talk briefly about our ecosystem in
athmeeya known as water
which is our sort of SDK ecosystem for
Drupal and then I'm going to jump right
into topics that are a little bit more
advanced which relate more to what you
actually want to be using when you
decide to start building a decoupled
tuple project namely web services
distributions otherwise known as API
first distributions if you don't know
what a Drupal distribution is I'll talk
about that and then I also want to talk
about how if you're building in nodejs
stack and you have your JavaScript
application that's using universal
JavaScript you know angular ember react
how might you bring that on to an
infrastructure that works for you namely
aqua cloud and I'll just illustrate some
of those things using our a cloud
platform finally I want to delve into
just a couple of really interesting case
studies that you may or may not have
heard of which are very compelling
examples of the couple Drupal that we've
built in akka yet and then finally I'll
just kind of talk briefly about the
future of the decoupled Drupal stack and
what that looks like there's a couple of
seats here please feel free you know one
of the things I hate the most when I
give a talk is seeing people standing or
sitting on the ground because oh man
it's just because I've been that
position before too so please don't be
shy if you want to yell out anything or
ask me a question at any point just stop
me and raise your hand this is meant to
be a little bit more free and I don't
want this to be just you know a sort of
one way thing so let's go ahead and dive
right back into decoupled rupal and I
want to just kind of give a really kind
of basic conceptual introduction again a
lot of these topics you've probably
already seen before but simply put this
is the way that the couple Drupal works
right
generally speaking you have what's
called a consumer application some kind
of other clients or some kind of an
other architecture that is consuming
excuse me that is consuming content from
your Drupal site now generally speaking
there's two kinds of flavors of Drupal
that can be used in a decoupled setting
like this and I'll talk about both but
first is a traditional website chances
are that you've got an existing Drupal
website you're very happy with it you've
built stuff on PHP template or on twig
if you're on da and you've got a site
already ready but you want to take that
to the next level you want
that site so that it sends content out
to other applications and act
simultaneously as a website and as a
repository that's one use case for using
Drupal as a decoupled back-end but the
other one is you might just want to use
it as a repository you might just want
to use it as a very slim content
management solution for your users for
your customers that you're building web
sites for and if you're building a web
application for example or a mobile app
that's going to consume your content
from Drupal you want to be able to give
them the opportunity to do that with a
CMS that they can control the content in
so this probably is a lot of stuff on
here that you already know about but the
most fundamental pieces on this are that
there's a REST API otherwise known as a
web service and that basically serves as
that exposure of content that allows for
other applications to retrieve that
content and also manipulate it you can
also think of it as kind of an interface
right which allows for anyone to
communicate with Drupal regardless of
what language it's written in or what
technology it's built in on the other
side on the consumer side you have an
HTTP client which basically accepts
those responses from the server so if
you think about it one way to think
about this is that you have a server
client divided right here on this side
you have a server on this side you have
the client and of course you have HTTP
requests and responses going back and
forth for those of you who've seen my
other talks I've used a metaphor from
the Martian to describe this and if
you're interested in looking at that
metaphor it's a talk that I've given
called introduction to decouple true
block but simply put decouple Drupal is
the use of Drupal as a content service
for consumption and manipulation by
other applications simply put we're
trying to expose Drupal content so that
it can be used and changed by other
systems that's really the kind of
simplest definition of decouples rupal
and it can be used to back things that
you know run the gamut from your mobile
application your Android app to your
angular application and JavaScript to
even things like a VR interface or even
things
Digital Signage or you can even serve it
to a Raspberry Pi and those things do
happen quite a bit but the thing that
really allows for Drupal to expose that
content and to provide the means for
other people to consume that content our
web services you can use the core REST
API you can use JSON API which is
another REST API that's available as
part of the Drupal contribute ecosystem
where you can use graph QL which is not
a traditional REST API what is a web
service that allows for Drupal consumers
to consume content if you're a little
overwhelmed by these terms here I'm
gonna explain them very shortly everyone
with me so far
good to go okay so we all know what
monolithic Drupal here looks like it's
just you know Drupal as an intent system
it's not decoupled because you have your
Drupal front-end that's part and parcel
of your Drupal architecture which means
that when you're building your Twigg
templates and you're building your
Drupal front-end that is something that
you can't actually separate easily let's
say from the rest of the Drupal
architecture itself the Drupal monolith
that exists so what is the difference
between monolithic and decoupled wroclaw
from an architectural standpoint well as
you can see here in a decoupled setting
you have a decoupled application or a
consumer application that is being
written in a different language or a
different technology potentially that
has to accept this content using a REST
API that mediates the relationship
between Drupal and the consumer
application so me as a consumer
application I'm going to ingest this
data put it into templates and render it
in my own way rather than having Drupal
go through the entire rendering process
on its own and doing that by itself
so just to illustrate this very quickly
there's a lot of different things that
you can build with the couple drupal is
the backend you can build a single page
application in Universal JavaScript
meaning you have shared rendering code
between client and server you can also
build a native Android application if
you want to which allows you to write a
native mobile app but the quintessential
reason why people like to use the couple
Drupal as a unified back-end is because
you can use one single Drupal instance
to serve content to all of your
applications so if you have an
application ecosystem that has three
JavaScript applications and two mobile
apps and you've got a roku application
thrown in there as well you've also got
a Samsung TV application in there that
also has to consume that content
you only need one single Drupal back-end
and that single REST API that lies on
top of your Drupal back-end can serve
content to all those consumers a quick
aside here now a lot of you have
probably encountered all three of these
terms before decoupled headless API
first and there's a lot of different
names that come into the mix here when
you think about the couple Drupal so why
is it that people refer to this as
headless Drupal or decoupled Drupal or
API first rupal there's a whole lot of
churn right now happening in terms of
terminology the reason I prefer the term
decoupled and why I know that
Driss prefers the terms and coupled is
because headless has a very different
definition in a very different
connotation from decouple simply put if
you look at the definition of headless
software it's basically software that
does not have a graphical user interface
or traditional visual means of
interacting with that software as a user
that can mean many different things one
example actually of a headless Drupal
interface is thrush or Drupal console
which are command line interfaces that
don't have visual elements that you can
use a mouse to click on but do provide
headless functionality that allows you
to manipulate Drupal using a non visual
interface so this is the reason why we
prefer the term Z couple because
headless is a very loaded term it has a
lot of different connotations and it's a
little negative as well actually as a
quick note one of the most interesting
stories I've heard
we about somebody who was pitching
decoupled rupal bill to a client was a
client that had recently also worked
with a family that was had suffered a
kidnapping in the Middle East and so
this is the reason why we want to avoid
any connotations that might relate to
the term headless however a lot of
people do use headless as a term and
that is a very common thing yes I would
think in many cases I mean it's also
because you're actually maintaining
panic the administrator interface
browser I mean exactly yeah had this
would mean that you know it's kind of
like I had this browser right I mean you
know there's no way to interact with
Heather's Chrome for example whereas
which have this drupal you do have a way
to interact with the you know
administrator front-end it's just not
it's just not married to that front yes
even talking about group while basically
living the data or content repository or
some other fun then but first ripple
also can consume external services and
effectively act as a front-end for
exactly for other things you know
let's testing that today well it's a
very good point and I do actually you
know what I'll talk about that briefly
so Drupal
yes decouple Drupal can also mean the
drupal acting as the front end and not
the back end right so for example let's
say that you have a commerce system
you're building something in Hybris or
in Magento and you're doing it or
Salesforce even right Salesforce has an
API right and you want to expose that
data to Drupal so that Drupal can then
ingest that Salesforce data ingest that
Hybris data and you know basically
forward that on to consumers and this is
a very common use case for large
e-commerce shops that really want to be
able to get content from a central
commerce system but marry that with a
very good content system as well that
allows for both of those things to be
harnessed with equal power if someone
had a question over here yes it's not
really in here
a couple loophole that it doesn't have
any front end he's just the way it's
used not repeat the question for the
recording so there were so the question
was it's not inherent or intrinsic to
the definition of the couple Drupal that
it serves as the front end I would say
that 95 percent or maybe eighty percent
of cases that do use the term decouple
Drupal are going to be decoupled front
end with a Drupal back-end however there
are cases where people have referred to
decouple Drupal in the sense of Drupal
as the front-end commerce back-end as
the backend or some other data back end
being used yes absolutely you can have a
back-end further back and also a front
end in front of rupal as well that's
something we see a lot of distribution
because the module composition might be
different but it's the same of course
the same yes it can be yes if you want
to build it that way yes again we wanted
this thing to say okay so I'm really
interested in this because if you set
the back end with an e-commerce site if
Drupal is that then fine between the
back end of an ERP and then maybe a
front end piece and elsewhere like
Google version changes so just because
it's the couple doesn't mean is consumed
by a JavaScript application it is
consumed by Amazon Walmart comm
marketplace guru merchant services that
Drupal that consume speed from your SAP
interface and then maybe here pay Mike
McKenney oh so that's you know Drupal is
the middleman
I mean turrets reduce it to like the
very you know what sort of pure
definition of what you know like yeah
you keep you could for example argue
that an RSS feed is you know IG couple
funding for Drupal right if you were
rendering an RSS feed into some kind of
parses feed you or you know there's a
lot of flexibility here and these terms
are still being formalized and kind of
solidified so in the interest of time
I'm gonna skip ahead here to just talk a
little bit about why it is that people
are so interested in this from the web
development standpoint we've talked
about why people aren't arresting this
from the commerce standpoint from the
mobile application standpoint from
set-top box applications but what about
JavaScript right because that's really
why a lot of
people are looking at decoupled rupal
oftentimes developers who are really
well-versed in JavaScript have a little
bit of a hard time understanding why
twig has so many Drupal isms in Drupal
because you know we are you know we have
built a unique implementation of twig
that is that is a little bit distant
from Symphony's twig and as a result you
know the Drupal front of developer
experience can be very challenging and
for a lot of development shops where you
have a large population of JavaScript
developers or people who are j/s experts
it can make a lot more sense to decouple
Drupal because you have that fund
expertise on this side
that's knowledgeable about react or
ember or angular for view for example so
the JavaScript Renaissance was something
that began with really I would say the
sort of instantly a sort of inaugural
date of the Renaissance of JavaScript
really begins with the release of
node.js which unleashed this era of
innovation in JavaScript which allow for
JavaScript to be executed server-side
now remember that JavaScript back in the
day used to be kind of poo-pooed as this
you know play language that nobody
really nobody no serious developer
really actually wrote in so like PHP
exactly HP exactly or Ruby talk about
that but as a result you know a lot of
these best practices and JavaScript have
really changed and for those of you who
are more in the PHP around these days or
writing other technologies and who are
looking at where to expand next you
might want to consider looking at
JavaScript today because there is a very
robust set of best practices robust
standards very robust documentation
actually as well around es6 which is the
modern version of javascript available
today widely supported by many browsers
and also is the underpinning are the
underpinnings is informs the
underpinnings of this kind of phenomenon
so as a result of this new you know this
new paradigm of using javascript on the
server side we are now able to write
servers entirely in JavaScript now your
under yourself what does that have to do
with PHP and Drupal right well there's a
key thing here which is that you take a
look starting in 2011 when angular was
released 2012 when ember really came
into the fore 2013 when react really
first became very popular and you start
to notice that a lot of these
client-side frameworks that were
originally only on the client-side are
able to share their rendering code
across the client server boundary such
that they can also be rendered on the
server side now I'm going to restate
that because it's a very formative and
very important sort of statement if I
have a react application on a client
side which gives me all of this
interactivity and all this flexibility
and all of these nice user experience
features and the problem is that I have
to wait five seconds on my browser for
all of the code to initialize for the
job should parser to go through and you
know that takes a long time but if I can
transfer a little bit of that rendering
or all of that rendering over to the
server side and flush to the browser an
initial state of that application that
already gives me markup and all I have
to do is perform bindings against that
markup and rejuvenate that markup
rehydrate as it were that markup that's
a really compelling idea because there's
a seat over here by the way if you want
to okay that's a really compelling idea
because that gets rid of all of the
performance drawbacks of using
JavaScript on the client side so
Universal JavaScript which is this idea
it's also called isomorphic JavaScript
which is this idea of having the ability
to repeat code or share code across
client-server was a very important
phenomenon that occurred and
unfortunately the very same phenomenon
has not yet happened with PHP there is
no client-side PHP there is no browser
PHP that's in common use I know that
there are some prototype implementations
out there
so what does this look like from the
architectural standpoint well the
fundamental thing is that rather than
having the JavaScript framework rendered
into the Drupal page right and having
Drupal serve out that initial state and
then having Java should take that over
instead we're actually executing in this
case a JavaScript framework on the
server side through nodejs and Drupal
will serve data to this nodejs
server and then that is what flushes out
to the browser is that fully rendered
initial state of that JavaScript
application so as a result of that we
get really rich user interactions really
rich interactivity on a page we get
dynamic rendering that occurs within a
second and it's not just those
small-scale Ajax interactions those
small-scale asynchronous updates on the
page like a spinner or like a small
message that peers if we're talking
about entire sections of the page or the
entirety of the page itself that is re
render on the fly dynamically in
JavaScript it's a really huge shift in
our mentality this is how it looks from
a very bird's-eye view nodejs
is going to execute a JavaScript
framework and in this case no js' houses
the data as well right this is just
illustrating the pure version of this
but framework on the server side is
going to render that HTML that's then
flushed out to the browser and now in
chrome I have my chrome my site in
chrome now the HTML is loaded the script
tags are loaded and all of the
JavaScript framework is initialized
again and all of the bindings are
performed and now I have a fully fledged
application in my client-side in my
browser whenever it needs a new data
update whenever something goes out of
date and it needs to fetch that new data
the framework will call back all the way
to no js' for that new information
now how does Drupal fit into this
picture well it's very simple
rather than having no js' and say
MongoDB inside there's no GS serve out
that data instead I'm gonna have the
JavaScript framework perform requests
out to Drupal and Drupal will respond
with that data give it back to the
framework and I still have my
server-side favor of execution that
renders out the HTML once again flushes
out to HTML but the thing is that would
actually reacts acute my jobs for framer
here and I have some asynchronous
requests that have to go back up to the
server for updated data that's gonna go
to Drupal instead right that's typically
how a lot of these Drupal Plus nodejs
builds work okay so this is an example
of fully decoupled rupal this is an
example of Drupal not having any
interaction or sorry not having any
involvement in the front-end whatsoever
Drupal is completely out of the picture
when it comes to the front instead
nodejs
is going to be fronting Drupal and then
JavaScript will be on the front in the
client side there is by the way I should
mention another paradigm as well known
as progressive decoupling which is
something that Driss brought about three
years ago which involves basically the
interpolation of a framework into the
Drupal front-end so let's say that
you're not ready to buy into this whole
paradigm yet no js' is something that's
still completely crazy you can still
have access to some of these interactive
features as long as you are able to
place that framework inside the Drupal
front-end inside the native triple front
in itself and for some people that is
sufficient to enrich those user
interactions or give that feel of the
application enough there's a lot of
speaking I've done about progressive
decoupling if you'd like I can send you
some resources on that
so Greece recently had a blog post about
three months ago that is about how you
should look at decoupling Drupal in 2018
I know this is very small but there's a
couple of things that you really have to
ask yourself when it comes to deciding
whether or not it's a good idea to go
this route and to take Drupal way down
this path which is what do you intend to
build with Drupal are you building just
one experience or are you building
multiple are you building just a website
or are you building a website plus a
mobile app plus an IOT app plus a
Raspberry Pi plus an Apple TV app right
if the answer to that is gonna be
multiple you have to ask yourself first
of all as one of them a website because
if it is then you might want to use
Drupal as that sort of simultaneous
usage as I mentioned before both as the
site and also as that exposure of data
to other consumers if not and it's not
going to be a website you're only
serving content to a bunch of
applications that don't really need the
Drupal fun at all then you might want to
use Drupal just as a repository only so
same thing on this side as well if you
know that that one experience that you
want to build is a web application or a
website then you want to make sure that
you are using Drupal for that so the
next thing that you want to ask yourself
is what are the things you can't live
without and this really ties into some
of the risks and rewards and some of the
pros and cons of decoupling Drupal
there's both sides of this are worth
considering not only the site builder
and content editor experience but also
the developer experience because
oftentimes a lot of people I talked to
who are exploring or building the couple
Drupal implementations are saying our
developers really outweigh the editors
needs and so you have to really balance
and force that kind of equilibrium
between the two okay finally um you know
this right here gives you an idea of
well I know that most of my needs are
developers right my J s team really
needs this or I've got a lot of
developers but I don't really have much
use for content editing features like
layout builders or in-place editing
or those kinds of things in that case
you can go ahead and fully be couple
that makes perfect sense
but if you do have those needs you might
want to consider whether it's a good
idea to be couple of Drupal Driss has a
very good blog post on this by the way
if you look for how to the couple Drupal
in 2018 it's a really kind of
comprehensive decision-making flow for
you already
so the decouple Drupal ecosystem what is
it that's available to you now that
you've decided that you want to go this
path and you want to build a couple
Drupal architectures what is available
to you as developer well there's both
core web services as I mentioned that
provide a REST API and there's also web
services modules in general and can trim
that give you some of those features as
well and I'm gonna just show this
diagram just to give you an idea of the
fact that there's a big difference
between what's called a REST API that
follows what are known as the fielding
constraints which really rely on this
idea of rest serving as this application
state machine yada yada yada it's a lot
of academic stuff graph QL doesn't fit
in that paradigm right graph QL is non
restful does not follow those
constraints graph QL is a web service
because it does yield data and it does
provide that sort of intermediation
between the consumer and the server but
it is not a REST API itself
the core rest modules are really great
because they allow you to basically
expose any content editor that's in
Drupal and content entities in Drupal
include things like notes users taxonomy
terms and comments and they allow for
Low's continuities to be exposed as
jason and you can either choose sort of
the you know raw data structure jason
that's available or you can choose
what's known as how jason which is the
hal normalization of jason
how is what's called hypertext
application language which is
essentially a specification that adds on
to the base layer of jason so if you
want to do things like link data have
references to other documents or others
write other resources that you want the
client to be aware of that's where you
might want to use how so for those of
you who are favored we're familiar with
like json-ld as well that's related to
this views also by the way has what's
called a rest export as a native display
type so if you're building a view out
and you want to create a view that
allows for any consumer application to
take that view and just to turn it into
data that it can use in its own
templates that's what you can do with
chorused just to illustrate very quickly
what this looks like
just so you see what this actually is
doing what's happening here is that when
you perform a request to Drupal and some
of these examples by the way might be a
little bit out of date I just realized
that didn't go through an update these a
hundred percent so these might be a
little bit out of date these routes
might be wrong I will correct these for
the slides that do go out within a PDF
but essentially you know that's not the
important part what's important is that
when you perform a request against the
core REST API you're getting data back
in return now why am i showing you this
because I want to illustrate the
differences between core rest and some
of the other flavors of web services
that are available in Drupal such as
JSON API for those of you who don't know
this JSON API is a specification that
has been adopted by several large
communities such as ember Jas Ruby on
Rails to power their API sort of power
they're sort of in
of data Jason API is a spec written
actually co-authored by a good friend of
mine in New York but the interesting
thing about Jason API is that it
provides a standard for relationships as
well so when you have references to
other resources other entities in your
existing content entities those are
captured by jason api jason api codifies
the ability for you to be able to
retrieve those additional relationships
as well those related entities that are
attached as well so just to give you an
example of what that looks like by the
way it also includes things like filter
or sort pagination all sorts of things
that you want to be able to do when
you're manipulating data and so one of
the interesting things about the Drupal
Jason API implementation is that we do
have full pagination support for example
so you can request only ten articles for
instance out of all the articles that
you have so what does this look like
well what this looks like is that when I
go here and I want to include an
additional field because the author
field in this case is a reference entity
it's an enemy reference field that is
referring to an author node and this
author is right here right it's going to
serve me all the information about that
author which is not housed in this
entity it's actually housed in this
include which is a related entity but
not part of the initial payload so what
that means is that if you were trying to
do this in core rest you would have to
make two requests right and that's what
that previous example showed is that for
me to get the name Joe and also the body
of this article I would have had to make
two requests Jason API obviates that
necessity
all right now there's also graph QL I've
given several talks about graph QL in
the past graph QL is a really
interesting web service because it
allows you to perform fewer queries and
actually define what you want on the
client side from the server side if
that's confusing let me just illustrate
this with an example
when I perform a request against an
article and I say I want this article
but I only want the title of that
article if I perform a request against
the core REST API or JSON API I'm gonna
get to the title of the article plus
everything else but what if I only want
to tie it what if I'm building an
application on Raspberry Pi or some
low-level hardware that can only ingest
a certain amount of data before it
crashes out in that case I might want to
actually define more narrowly what my
data that I want to retrieve should be
so in graph QL what happens is that the
responsibility to serve the correct
response or to provide the correct
structure for a response is coming
directly from the client not from the
server the server is not the one that
dictates what it is that gets sent to
the client the server publishes what's
possible what the client is going to
publish it's requirements what does it
need from the server in the structure
that it wants but this looks like is
that if I only want the title of the
article and a title of the author who's
the name of the author and by the way
this is just illustrative this is not
how graph QL works today and I'm gonna
update this as well but if you see this
this is an example a very pure simple
example of how this works which is that
I don't get things like the note ID I
don't get things like the body of the
article or the user ID of the author all
right
so I want to talk about water wheel
because water wheel is an interesting
ecosystem that aqua has been working on
and we're just beginning to ramp up more
efforts in this area but water wheel is
our response to a lot of the other
headless CMS's or decoupled CMS's that
are out there how many people have heard
of contentful
or prism ik or
content stack okay so those providers
have already taken over this market to a
great degree
they've already known that this
decoupled CMS paradigm is very important
and these competitors of Drupal and
WordPress as well offer a series of SDKs
for any developer of any application
system or any kind of technology to be
able to consume data from those
respective backends and so for example
me as a Python developer I can use the
Python SDK that's been provided by
contentful to consume data from
contentful writing my native python or
if i'm an objective-c programmer god
bless that I can write Objective C
consume the data from those places and
get I need as well so just to give you
an idea of what this looks like what
we're really talking about here is two
different things which is that we want
to be able to provide the best developer
experience on both sides of that server
client boundary the way that we do that
is by providing number one on the
client-side SDKs reference
implementations starter kits that allow
people to get started very quickly
there's also API first distributions and
web services distributions which I'll
talk about a little bit later but these
kinds of things really improve that
Drupal developer experience from the
consumer standpoint right we're not
talking about triple developers we're
writing PHP we're talking about
developers who only want to use Drupal
because they're writing a JSF occation
that needs some content so a good
developer experience in this regard must
mean that it's easy for those consumers
those people who are writing those
applications to work with those api's
that Drupal has provisioned as I
mentioned just previously so SDKs can
really make it good to help developers
out and also started kids these
reference implementations where you can
just take what's there and build on top
of it is a really great way to get
started with Drupal and there's a couple
of projects that really do this very
well they're actually part of what's we
call the waterwheel ecosystem there's by
the way another ecosystem that's very
similar for this that I'll talk about in
a little bit as well but waterwheel is
aqueous own kind of sdk ecosystem so
we currently have SDK is available for
JavaScript and for Swift which means
that if you're building a react
application or an iOS application or a
plural watch OS Tbls application you can
use the waterwheel swift SDK if you're
building react react application or
let's say a view application you might
want to use waterwheel Jas
so waterwheel is really meant to be a
translator for developers in those
technologies right waterwheel helps
those nan Drupal developers who don't
know anything about Drupal and only want
to get that content out of Drupal and
give their clients something that they
can use to edit that content those non
drupal lists can now speak to they can
communicate with drupal in a very easy
way so waterwheel GS for example is a
really cool sdk that i built the first
version of and has now been sort of has
undergone several releases that allows
for these developers to consume and work
with this content without ever having to
learn Drupal learn PHP learn how the
rest API works how does that work no
first of all if you want to set up
Marvel GS it's very simple you go to the
git repo clone it
you've got your installation and PMI
you've got your tests you can run your
tests to make sure things are working
properly and then finally to go ahead
and create the client bundle now to use
this in nodejs and this is really
interesting while real Jas is unique not
unique it's not unique it's it's it's
great because it allows for you to use
it either on your node.js server on the
server side or in your application on
the client side in react right if you
want to do this in nodejs
all you have to do is go ahead and
create sorry instantiate a new
waterwheel create a new instance of
waterwheel and give it all of the sort
of oo authentication and I'm afraid I'm
not going to be covering authentication
today but at some point by the way just
the pic aside one thing I've been
working on over the last couple of weeks
has been a new column at dev Wacom it's
called experience Express
if you're interested in anything related
to Korah rest how to work with decoupled
rupal how to use Drupal how to build
react applications based on Drupal
please follow that column on dev da da
Wacom I will be posting every single
week actually in a couple of weeks I'm
going to be talking about authentication
so you can go ahead and bookmark that
and I'll make sure to let you know when
that's out next week I'll be talking a
little bit about the core rest module
and the serialization API so anyways so
what you want to do is you want to give
it the base URL your Roth information
your auth potentials and so on so forth
in a browser however it becomes very
different of course in this case we have
a browser that supports cs6 this Const
keyword by the way is an es6 feature the
s6 being the new version of javascript
that is now widely supported in heavier
green browsers um now this is where to
get to the good stuff so if you're a Jas
developer this is really awesome because
I have a promise that it's gonna give me
a promise yes I have the promise that's
gonna give me the Drupal data response
and guess what I don't have to look at a
single line of PHP I don't have to look
at a single URL to a bowl
I don't have to look at anything related
to Drupal at all all I have to do is
perform a get request within my native
JavaScript that's pretty cool number one
there yeah that in in that case that is
the user ID so this is fetching sorry I
should have made that clear this is
fetching the user with the user ID of
one so the first user I offended like a
node give yes there is a node get yeah
actually if you go to this page right
here this first link it'll give you all
of the documentation all of the methods
that you can invoke to get whatever you
need out of the waterwheel API there's
also a bunch of other stuff as I
mentioned there's water wheel swift
which is written by Kyle Browning who's
probably the the biggest booster of iOS
and Apple OS stuff and Drupal we also
used to have and I should have deleted
this actually a deprecated module called
waterwheel this is actually deprecated
so this is now actually part of the open
API module
and then we also have some reference
builds for you this is Edward ripple
waterwheel is an ember CLI I don't
so if you're an ember or developer and
you want to use your native ember CLI to
do some data request to Drupal you can
do that here then there's our site to
web scaffold a Drupal application for
example scaffold the adapter that you
want also there's two references that
we've built one for ember and one for
react and so those are both really good
starting points if you want to look at
how you can go ahead and work on a
foundation of art exists to build these
things okay I want to I'm running out of
time here so I want to talk a little bit
about Web Services distributions or API
first distributions so by the way a
distribution in Drupal is basically a
different flavor of Drupal simply put
instead of having the core installation
of Drupal which gives you a certain set
of modules that you're just stuck with
distributions will give you a different
set of modules of different set of
configurations that allow you to have a
bit more flexibility a very good example
of a distribution that's very popular is
for example open Y which is what YMCAs
use there's lots of other ones right
there's there's the conference
distribution I mean I you know I can go
for hours about this but distributions
are important because we want to enable
developers who solely want to use Drupal
as that data repository nothing else
right you don't want to we're not
worried about the site we're not worried
about twig or PHP template we just want
to get those API is in that content out
in that case a good developer experience
must mean that we have to be able to
give them tools that allow them to use
Drupal easily to get their content out
so what's an example of this well these
Web Services distributions have become
very common in recent months in the
Drupal community and have very active in
very large communities behind them
mainly Contenta actually has a very very
active community behind it and these
distributions are intended for
developers to be able to consume Drupal
and consume that data in a very easy way
by provisioning those api's and by
setting up Drupal in a way that it can
provide that data so these three are
reservoir content
and have less lightning now I don't have
time to go through all three of them but
I do want to talk about each of them
briefly because they are really
interesting to take a look at especially
from the standpoint of anyone who's
interested in looking at how Drupal can
be customized to serve very different
use cases in the case of content context
as a content API and CMS back-end it's
really focused on the JSON API use case
if you're building something based on
JSON API content is the way to go
because it has a great amount of
features it includes the JSON API extras
module for example which extends the
JSON API availability the sort of
available features they're really really
great to use if you're only using Drupal
as a content repository this is not for
building websites let me just make that
clear these are not for building
websites these are for building content
repositories right reservoir meanwhile
is a back-end for your front-end it's
really meant to be an austere flavor of
Drupal it's meant to be something that
is much more simple and actually one of
the biggest complaints that we often get
is there is no view support that's by
design because when it comes to a
developer when they encounter the views
you wide if you're if you're if you're
an apple OS developer or you're a job
developer and you look at the views you
are like what what the heck is this like
what is this stuff right we want to
avoid that we want to give them the most
simple and just down-to-earth easy to
use thing possible so what does that
look like well I'll show you right now
so this is a screencast by the way I
just realized this morning I try to
install reservoir there is something
worked so I think there's some
dependency issues in terms of versioning
if you try to install reservoir right
now you can't get it to work that's
probably above that we're already aware
of so but I'm just gonna go through this
right here and I'm gonna talk against
this I hope all right Wi-Fi come on this
is the co-author by the way of the
distribution when Lear's talking about
some of the features but I'm gonna just
kind of talk through this myself
so right now what woman's doing is he's
going ahead and acquiring and using
composer to install a new reservoir on
his computer right so this is gonna get
all the dependencies I'm gonna go ahead
and just kind of
fast forward here a little bit now what
happens is when you are you know I hold
stuff to play because this is really
good now when you go into your reservoir
local you would get the familiar Drupal
installation it's very easy right and it
sets up here you can set up a database
that's back it's just like the normal
Drupal installation process so your
thinking your stuff what's big
difference here what is so different
about reservoir versus Drupal and by the
way this is the same kind of way that
content and had this lighting both work
right and so right now he's just
throwing all this information doing all
this stuff now when you actually get to
this point you get a welcome to work
which is one of the biggest things that
can be of a huge help to developers you
get an idea of what it is that this can
do and as you can see the toolbar has
completely changed over there is no more
appearance tab there is no more extend
tab we're not giving people the ability
to create a website we're giving them
the bare essentials of what they need to
create a content service so you've got
your content modeling interface you've
got your API provisioning you've got
your content itself that you want to
have your editors build but
fundamentally what's happening here is
that we're giving this as a tool for
editors and developers but not for
people who are building websites as you
can see here on the right side we have a
preview of what this will look like
ultimately when you consume it via JSON
API and as you can see there's the raw
version there now this is really cool
because you can see side by side a
preview of the sort of Teck of the LIA
content as well as the JSON API preview
and that by the way is something that's
now present in Contenta as well and with
these documentation with the generated
documentation that's available through
open API in reservoir and also non
Contenta I believe you can actually go
through and browse and look at these
methods and actually very clearly have
an understanding of what the data
structure looks like on the front end
and what as a developer you need to know
about right so I know for example that
when I perform a gap I have to look at
for example this key and this value to
get what I need
right and then you also got
authentication as well and you can this
is how you get to the point where you
can get an OAuth token by the way I'm
sorry I can't cover authentication today
it is a very important issue I encourage
you to once again follow that column so
I can share all of the information that
you need on authentication with you we
also have users in permissioning you
know all the stuff that is already in
Drupal anyways I'm going to stop here
because we are a little bit short on
time and jump right back in here
so next headless lightning is a flavor
of lightning if you're familiar with
akio lightning which is a distribution
for Drupal websites that we build an
aqueous headless lightning is kind of
the headless flavor of that so there's
two options if you want to use aqueon
tools to get your decoupled fruitful
builds going the Community Supported one
and the one that really has a lot of
energy behind it is Contenta is is
Contenta and they also by the way have
their own library of SDKs as well
that you can use so we've heard from a
lot of people about issues around a
couple drupal in the form of what sorts
of things people want to build right we
heard this at aqueous and we said you
know what we really do need to provide
people the ability to not only build
really compelling decoupled drupal
architectures but also decoupled drupal
infrastructures we learned from talking
to a lot of our customers is that people
really want those application life
experiences that really only occur in
JavaScript these days and we also wanted
to make sure that you have a permission
to back end you have a Content back-end
the data back-end that really gives you
and your editors the peace of mind that
you want but most of all what people
really want these days is a single
manageable codebase or a single
manageable repository or a single
manageable set of code that is easy to
manage and gives you everything that you
need right there
both the server side and
client-side aqueous has a solution to
this which is our platform for decoupled
ruble regardless of whatever it is that
you're building we have the solution for
you namely if you're building a Drupal
site we got you I mean this is what our
bread and butter is obviously and of
course the other sponsors here as well
you know Cathy on thoughtfulness age
they we all specialize in Drupal and we
all specialize in awesome websites if
you're building a native application you
can still use what's available in the
Yaak be a platform by using things like
our web services that are available and
we don't have that posting available to
you but you can use something like
Heroku for example to host those
applications not if you're building a
JavaScript application that's built on
no GS that's got it back in that's
written in server-side JavaScript and
you want to be able to host that with
Acquia we have just in the last six
months released our new product which is
Acquia cloud nodejs hosting and now if
you want to build a Drupal site and also
have a node.js application in front of
that plus you're sort of your whole
architecture that is built on decoupled
Drupal and JavaScript you can host all
of that on one single vendor yeah how
many people are aqua customers in their
own by the way ok so a lot of you have
seen this before which is our FBA cloud
user interface which allows you to
basically move across elements and take
code and deploy it and really kind of do
a lot of different things that you might
want to do with your git repository the
most interesting thing that is on this
screen however is the fact that you've
got all of these environments and you've
got your ability to deploy a particular
commit of code with nodejs that's a
little bit different because first of
all you have the ability to set
environment variables nodejs is a little
bit different in that it's not part of
that same kind of dev stage prod
paradigm but you can actually provide
environment variables and you can also
deploy nodejs by using build artifacts
those artifacts are really kind of those
the elements that you would deploy
they're not like you know for this
commits but they are essentially
versioned forms of your nodejs
application that you can deploy to your
nodejs environments now what's
interesting here is that I can select
any build artifact in the same way that
you can select a git commit from your
history and you can go ahead and deploy
that to whatever environment you want to
with our nodejs platform and of course
one of the most important things of any
platform cloud platform is that you must
have an ability to manage your team's
management permissions manage whoever is
going to be able to touch those
applications and impact your
infrastructure so why would you want to
look it up with cloud for hosting your
entire decoupled oopall architecture in
your whole stack well the reason why is
because you know Acquia is really the
only provider that allows you to take
one platform one contract one SLA one
vendor a one-stop shop for both no js'
and drupal so if you're building any
sort of JavaScript application that
relies on data coming from the Drupal
website hosts both of those things are
not going flat we've got great support
for both we've got you know high
availability security and performance at
the same level that we provided for
Drupal and also we've got things like
copy of pipelines which allow you to do
things really richly in terms of the
DevOps perspective when it comes to both
no js' and Drupal so all things said
lockley cloud really is the best place
to host your decoupled Drupal stack so
what I want to do is I want to show you
very quickly in a tour of the UI and of
course I've been logged out which is of
course the thing that always happens now
if I really hope that this doesn't ask
me for a good ok good no two-factor ok
so as you can see here this is a normal
Drupal site you know there's def stage
prod obviously Drupal sorry happy cloud
has on-demand environments so you can
have an arbitrary number of environments
here if you want but the most important
thing here that I think is important to
look at is that you've got your ability
to choose the branch that you want to or
you know or your commit hash that you
want to provide to your deployment so
that a particular thing goes out into
your prod or your step environment or
stage environment right so yeah this is
kind of interesting because when you
actually take a look at this one of the
new things is that we actually now flag
all of our applications with either
Drupal or nodejs
so one actually switch over to my nodejs
application here but you'll see is now
I've got my node.js environments and I
can also switch the code here and deploy
I'm not going to do because this is a
demo application that other people
pretty you think so I don't want to
deploy anything but as you can see I can
find any artifact that I want to here
and deploy that to my environments and
as you can see this kind of parallelized
approach as part of this unified whole
is really powerful because now you only
have one place that you have to go for
both your nodejs hosting and your Drupal
hosting so that's really cool and that's
the sponsor portion of this talk by the
way in case you were wondering and not
really sure what was going on okay so
finally what I want to do and I'm sorry
I have to skip that session because I
got stuck a couple of case studies
really quickly first of all who's heard
of the New York City subway you've
probably heard a lot of bad things about
it well if you've ever been to the New
York City subway in the last month or
two you've probably seen a lot of these
new countdown clocks appear and you know
you've probably heard about them being
pretty buggy well you know the the truth
is that the state government agencies
can be very bureaucratic
as we've learned but we actually a
taqueria builds a very compelling
implementation for the MTA that uses
Drupal as that manager that's
responsible for serving content and
information to every single countdown
clock in the New York City subway system
this is a system that has over 400
stations and every single one of those
is going to have a countdown clock that
is talking to Drupal via angular it's
really really cool you don't see any
news tickers here but the news ticker
for example is taken from Drupal content
that MTA editors actually input into the
system and it's an incredible interface
on the backend I mean you have access to
every single station you can see what's
going on there and this is all coming
from that kind of live real-time feed
that MTA provides so really cool stuff
and we can talk about that more
afterwards and then Princess Cruises if
you've ever taken a cruise before and
you've always been wondering how is it
that a lot of these cruise liners have
the ability you know have the ability to
kind of show me content everywhere and
show me the things that are personalized
for me everywhere
Princess Cruises has a very rich array
of channels that it uses to reach its
customers on bore its cruise liners for
example there's a mobile app there's a
digital signage there's a tablet
application as well all of which are
served content from Drupal and serve
data front Drupal but it's $120 signs a
whole lot of stuff in there there's a
lot of interesting information about
Princess Cruises on the Yaqui website if
you're interested and we can talk more
about that as well so I want to finish
up here I know that we're out of time
but one of the things things I want to
have everyone take away is yes aqua is
great up the cloud is awesome
but that's not the only value you're
gonna get from this session I want to
also instill in this group that we are
encountering right now and in the midst
of a very fundamental shift in the way
that we think about software
architecture and this is true everywhere
you look if you look at things like the
blockchain and Bitcoin if you look at
things like Drupal and micro services if
you look at all
elements of software there is a
wholesale move away from centralized
monolithic architectures not just
because it's more convenient for
developer teams and more manageable it's
because the idea of actually decoupling
exposes a lot less surface area for
things like security risks it exposes
more developers to more of their tools
that they can use that they want to use
and of course it is really the way that
a lot of our omni-channel world is going
to be in the future you know we're no
longer gonna have that kind of an idea
of a single monolith but once again
decoupled architectures do mean these
kinds of platforms challenges
infrastructural challenges so how do we
face those well number one pop and cloud
is that one-stop solution for a
decoupled Drupal from end to end
meaning decoupled rupal plus nodejs host
it all and off with cloud and you're
good to go
but as architecture has become more and
more decentralized in the sense of
there's no longer that monolith that
really rely that really is that one
single place where everything is housed
we're seeing a little bit more
centralization infrastructure and that's
really what halfway cloud is doing we're
trying to provide the means for you to
be able to host everything that you have
on one place because frankly managing
multiple vendors paying to people out of
two separate pockets is not something
that any of us want to be doing in a
long run with that thank you very much
and some final notes first Sprint's on
Sunday
please join I will not be here
unfortunately but I do want to encourage
all of you to come it's always a good
time and finally please let me know how
you like this session and if you want to
send me an email or find me on Twitter
I'm interested to hear about your
feedback what was missing obviously
demos we're missing I already know that
but if you want to email me with any
feedback about the content how this
could be more helpful any questions you
might have
I'm very happy to answer those thank you
very much
I'll take maybe two questions or three
questions I think I might be eating into
the time of the next presenter so yes
you can run on basic Drupal so actually
a lot of people that I've seen use
waterwheel j/s on their Drupal sites to
enrich their sort of user interfaces so
one use case I didn't talk about is yeah
you might want to use it in nodejs you
might want to use it and react but you
might also will just want to use it in
Drupal in your jQuery to help kind of
drive a lot of those dynamic updates of
content that you might have for your
Google back-end so customer yeah so
waterwheel has the ability to so there's
a populate resources and get resources
method available in waterwheel that
allows you to define what those
resources are and this is actually
really helpful for things like
client-side validation but the but the
really custom entities is something that
I'm actually not sure that I've actually
played with in waterwheel but I'll let
you know okay let me see what I can dig
up there it was like I think that's like
a progressively decoupled app and I want
to move into making a Chrome extension
okay that's the work offline so you can
go to Drupal that works in issue click
subscribe and I have no boards I'll see
you naturally could make a collection of
issues e-track and then possibly like a
little sprinter is like event right
the tablet here's our sprit forth and I
want to try to make it work native
things with a good thermal back so you
claim to build that in react or its
react right now okay yes yes I want to
figure out how I can make before
extension or anything else and I'm you
can yeah exactly
well so so what are the GS fits react
with the glove um however custom
entities that's something I'll have to
look into Herrera I think I just want to
work I know this sounds like any other
great point yeah yeah I you know what
let me look that up right now because
that's I may just look it's been a while
since I touched water bill so I mean
assuming that because I was what I'd
like is it as simple as in the array
like can you just say plug in
I got pattern and it translates it to
what REST API we expect it should so
here's the thing there's this alright
okay right so this gets this so there's
a new endpoint in open API now which
allows you to get every single available
anytime okay with the bundle as well so
this might be your answer
riots I'll try out if it doesn't work
let me know and all the kit support
yeah we actually need to bring this up
but yeah so because the really cool
thing about this though is that with
that resource request you get all the
list event of the possible resources
that are available which should include
custom entities it definitely includes
configuration of these I'm pretty sure
and then you know to basically do
anything you want to as long as you are
aware of senators