Learn how there's a new technology stack emerging for the web.
Technologies like Static Site Generators, serverless, graphql, headless, content infrastructure and event driven architecture are positioned to change how we build web applications and provide performant user experiences.
This talk was given at "We are developers world congress" 2019 in Berlin
6. Advantages
â Simple to reason about
â Stateless app servers are
very easy to operate and
scale
â Data is always up to date
in database
Disadvantages
â DifïŹcult to scale
horizontally
â Heavy load on the
database server
â Heavy load on app servers
continuously loading and
writing data to DB
Trade-offs
8. â On startup, load all game state
from the database
â All state kept in memory
â Events modify the in-memory state
â Periodically snapshot the current
state into the database
â If player is inactive for a while,
snapshot the state and take it out
of memory
Gaming
upside-
down stack
10. Advantages
â Easier to scale
â 2-3 orders of magnitude
fewer interactions with
database
â Game logic entirely testable
without DB attached
Disadvantages
â Must use a runtime that
works well with long lived
state (we used erlang)
â Might experience data loss
by design (one snapshot
time unit)
Trade-offs
11. â State can live out of Database
â Thereâs a time and place for the
runtime
â There might be a third way: Normal
form, denormalized and data
artifacts
â You can reduce your computation
needs by a factor of 1000 if you are
mindful of your computation
â What data you process
â Why
â When
â Where
What we
learned
13. Donât let a CMS get in the way
of shipping software
Contentful provides a content infrastructure that enables
teams to power content in any digital product
@hungryblank
25. Events in a static site generator
Browser Static site
host
Build
server
SCM
Developers
Editors
Request
Build
completed
Code
changed
@hungryblank
26. Advantages
â Trivial to scale for high
trafïŹc
â Very reliable: operations are
simple
â Failure results in stale
content, not downtime
â Small security surface
Disadvantages
â Less intuitive editing
experience for
editors/marketeers
â Every update similar to a
software release
â Latency until new content
appears depends on build
process
Trade-offs
27. Static site generators with services
Browser Static site host Build server
SCM Developers
Editors
AWS Lambda
Algolia
SendGrid
Content infrastructure
StripeCommerce
layer
@hungryblank
28. Events in a static site generator
Browser Static site host Build server
SCM Developers
Editors
AWS Lambda
Algolia
Commerce
layer
SendGrid
Content infrastructure
Stripe
User request
Build complete
Content
changed
Code
changed
@hungryblank
31. Most of the work happens when
code or data changes
32. Work in a static site generator
Browser Static site host Build server
SCM Developers
Editors
AWS Lambda
Algolia
SendGrid
Content infrastructure
Stripe
Most
work
here
Commerce
layer
@hungryblank
34. Events in a static site generator
Browser Static site host Build server
SCM Developers
Editors
AWS Lambda
Algolia
SendGrid
Content infrastructure
StripeCommerce
layer
@hungryblank
35. Advantages
â Easy to scale
â Easy to integrate third party
services
â Easy to gracefully degrade
â Better general performance
Disadvantages
â Requires thinking out of the
request/response box
â If not architected carefully
at risk of exploding
complexity
â Itâs a distributed system and
requires understanding of
the topic
Trade-offs
38. â Must classify how you want to handle events
â Events that build artifacts
â Events that trigger instant reaction (login, ecommerce purchase)
â Writing applications in both paradigms might be needed, but not a
must
O N E
@hungryblank
39. T W O
Do work only on
meaningful events
@hungryblank
40. â Take advantage of pre-built artifacts
â No more âcurrent stateâ rebuild
â Events build their new state into artifacts
â Artifacts are used in place of what is currently computation
T W O
@hungryblank
41. T H R E E
Data = code
(They move through the system in the same way)
@hungryblank
42. T H R E E
â In this pattern, data and code follow the same lifecycle
â Every update in data or code is very much like a deployment
â Continuous delivery becomes quite literally continuous
@hungryblank
43. F O U R
Your domain model
needs strong tooling
@hungryblank
44. F O U R
â In this pattern, the architecture is fundamentally distributed, so
you need strong tooling tomode events and data.
â Events and data model can be directly mapped to
domain-driven design.
@hungryblank
45. F O U R
â The GraphQL ecosystem is a very promising solution to all
this, as it helps in deïŹning clear contracts across services (own
or third party).
@hungryblank
46. 1. Reframe: Request/Response as events
2. Investigate: What are events that happen
outside of request/response?
Example: Deployments are events
3. Document all the above
4. Extract: Move computation to meaningful
events
Example: Re-build data during an external
event â easiest during deployments
How do I
even start?