SlideShare ist ein Scribd-Unternehmen logo
1 von 47
Downloaden Sie, um offline zu lesen
Turning the web stack upside down
Rethinking how data ïŹ‚ows through systems
By Paolo Negri
Paolo Negri
CTO & co-founder, Contentful
@hungryblank
linkedin.com/in/panegri
Before we talk
about data ïŹ‚ows...
Let’s talk about online gaming
Traditional architecture
Everything is driven by a request
Game
App
server
Persistent
datastore
@hungryblank
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
We turned it upside down
● 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
Wooga’s upside-down stack
Game
Data layer
App server
Persistent
datastore
@hungryblank
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
● 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
But
you’re probably not building games...
...and these days neither am I
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
Contentful allows customers
to create all kinds of experiences
@hungryblank
More often than not, it’s a website
@hungryblank
More often than not, it’s a website
@hungryblank
More often than not, it’s a website
@hungryblank
More often than not, it’s a website
@hungryblank
More often than not, it’s a website
@hungryblank
More often than not, it’s a website
@hungryblank
Traditional web architecture
Everything is driven by a request
Browser
App
server
Database
@hungryblank
Is there an upside-down stack
for the web?
Static site generators
@hungryblank
Static site generators
Browser Static site
host
Build
server
SCM
Developers
Editors
@hungryblank
Events in a static site generator
Browser Static site
host
Build
server
SCM
Developers
Editors
Request
Build
completed
Code
changed
@hungryblank
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
Static site generators with services
Browser Static site host Build server
SCM Developers
Editors
AWS Lambda
Algolia
SendGrid
Content infrastructure
StripeCommerce
layer
@hungryblank
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
Static sites are an
upside-down stack for the web
Events drive the system
Requests are just another event
Most of the work happens when
code or data changes
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
User requests are cheap
Events in a static site generator
Browser Static site host Build server
SCM Developers
Editors
AWS Lambda
Algolia
SendGrid
Content infrastructure
StripeCommerce
layer
@hungryblank
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
Four things
to consider
O N E
Build driven or
reactive?
@hungryblank
● 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
T W O
Do work only on
meaningful events
@hungryblank
● 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
T H R E E
Data = code
(They move through the system in the same way)
@hungryblank
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
F O U R
Your domain model
needs strong tooling
@hungryblank
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
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
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?
Thank you
twitter: @hungryblank
linkedin.com/in/panegri

Weitere Àhnliche Inhalte

Was ist angesagt?

Microservices Coordination using Saga
Microservices Coordination using SagaMicroservices Coordination using Saga
Microservices Coordination using SagaEran Levy
 
Synthetic and RUM - Best of bo
Synthetic and RUM - Best of boSynthetic and RUM - Best of bo
Synthetic and RUM - Best of boCliff Crocker
 
Measure Customer Experience of Your OutSystems Web and Mobile Applications
Measure Customer Experience of Your OutSystems Web and Mobile ApplicationsMeasure Customer Experience of Your OutSystems Web and Mobile Applications
Measure Customer Experience of Your OutSystems Web and Mobile ApplicationsOutSystems
 
When the connection fails
When the connection failsWhen the connection fails
When the connection failsBarbara Fusinska
 
Client side production monitoring using - SyncApp Tool
Client side production monitoring using - SyncApp ToolClient side production monitoring using - SyncApp Tool
Client side production monitoring using - SyncApp ToolBhupesh Pant
 
PowerPoint and Airtable Integration
PowerPoint and Airtable IntegrationPowerPoint and Airtable Integration
PowerPoint and Airtable IntegrationKurt Dupont
 
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...OutSystems
 
Digital Gaggle 2017 - Mobile Index
Digital Gaggle 2017 - Mobile IndexDigital Gaggle 2017 - Mobile Index
Digital Gaggle 2017 - Mobile IndexErudite
 

Was ist angesagt? (8)

Microservices Coordination using Saga
Microservices Coordination using SagaMicroservices Coordination using Saga
Microservices Coordination using Saga
 
Synthetic and RUM - Best of bo
Synthetic and RUM - Best of boSynthetic and RUM - Best of bo
Synthetic and RUM - Best of bo
 
Measure Customer Experience of Your OutSystems Web and Mobile Applications
Measure Customer Experience of Your OutSystems Web and Mobile ApplicationsMeasure Customer Experience of Your OutSystems Web and Mobile Applications
Measure Customer Experience of Your OutSystems Web and Mobile Applications
 
When the connection fails
When the connection failsWhen the connection fails
When the connection fails
 
Client side production monitoring using - SyncApp Tool
Client side production monitoring using - SyncApp ToolClient side production monitoring using - SyncApp Tool
Client side production monitoring using - SyncApp Tool
 
PowerPoint and Airtable Integration
PowerPoint and Airtable IntegrationPowerPoint and Airtable Integration
PowerPoint and Airtable Integration
 
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
 
Digital Gaggle 2017 - Mobile Index
Digital Gaggle 2017 - Mobile IndexDigital Gaggle 2017 - Mobile Index
Digital Gaggle 2017 - Mobile Index
 

Ähnlich wie Turning the web stack upside down rethinking how data flows through systems

Flink Forward San Francisco 2018: Gregory Fee - "Bootstrapping State In Apach...
Flink Forward San Francisco 2018: Gregory Fee - "Bootstrapping State In Apach...Flink Forward San Francisco 2018: Gregory Fee - "Bootstrapping State In Apach...
Flink Forward San Francisco 2018: Gregory Fee - "Bootstrapping State In Apach...Flink Forward
 
Bootstrapping state in Apache Flink
Bootstrapping state in Apache FlinkBootstrapping state in Apache Flink
Bootstrapping state in Apache FlinkDataWorks Summit
 
Storing State Forever: Why It Can Be Good For Your Analytics
Storing State Forever: Why It Can Be Good For Your AnalyticsStoring State Forever: Why It Can Be Good For Your Analytics
Storing State Forever: Why It Can Be Good For Your AnalyticsYaroslav Tkachenko
 
Buckle Up! With Valerie Burchby and Xinran Waibe | Current 2022
Buckle Up! With Valerie Burchby and Xinran Waibe | Current 2022Buckle Up! With Valerie Burchby and Xinran Waibe | Current 2022
Buckle Up! With Valerie Burchby and Xinran Waibe | Current 2022HostedbyConfluent
 
The End of Data Entry: Liberate Your Organization Through Automation and Inte...
The End of Data Entry: Liberate Your Organization Through Automation and Inte...The End of Data Entry: Liberate Your Organization Through Automation and Inte...
The End of Data Entry: Liberate Your Organization Through Automation and Inte...CAMT
 
GraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
GraphQL Munich Meetup #1 - How We Use GraphQL At CommercetoolsGraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
GraphQL Munich Meetup #1 - How We Use GraphQL At CommercetoolsNicola Molinari
 
Predicting Startup Market Trends based on the news and social media - Albert ...
Predicting Startup Market Trends based on the news and social media - Albert ...Predicting Startup Market Trends based on the news and social media - Albert ...
Predicting Startup Market Trends based on the news and social media - Albert ...GetInData
 
Scaling Production Data across Microservices
Scaling Production Data across MicroservicesScaling Production Data across Microservices
Scaling Production Data across MicroservicesErik Ashepa
 
Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...
Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...
Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...David Geurts
 
Stateful Stream Processing at In-Memory Speed
Stateful Stream Processing at In-Memory SpeedStateful Stream Processing at In-Memory Speed
Stateful Stream Processing at In-Memory SpeedJamie Grier
 
Challenges and Best Practices of Database Continuous Delivery
Challenges and Best Practices of Database Continuous DeliveryChallenges and Best Practices of Database Continuous Delivery
Challenges and Best Practices of Database Continuous DeliveryDBmaestro - Database DevOps
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performanceAndrew Siemer
 
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...Kaxil Naik
 
Are you there Page Experience? It's Me, DevTools.
Are you there Page Experience? It's Me, DevTools.Are you there Page Experience? It's Me, DevTools.
Are you there Page Experience? It's Me, DevTools.Rachel Anderson
 
Are you there Page Experience? It's me, DevTools
Are you there Page Experience? It's me, DevToolsAre you there Page Experience? It's me, DevTools
Are you there Page Experience? It's me, DevToolsJamie Indigo
 
Raising ux bar with offline first design
Raising ux bar with offline first designRaising ux bar with offline first design
Raising ux bar with offline first designKyrylo Reznykov
 
Building real time Data Pipeline using Spark Streaming
Building real time Data Pipeline using Spark StreamingBuilding real time Data Pipeline using Spark Streaming
Building real time Data Pipeline using Spark Streamingdatamantra
 
More Dev. Less Drama.pdf
More Dev. Less Drama.pdfMore Dev. Less Drama.pdf
More Dev. Less Drama.pdfWP Engine
 
State management with GraphQL [Angular Minsk, Online, 13.06.20]
State management with GraphQL [Angular Minsk, Online, 13.06.20]State management with GraphQL [Angular Minsk, Online, 13.06.20]
State management with GraphQL [Angular Minsk, Online, 13.06.20]Mikhail Asavkin
 

Ähnlich wie Turning the web stack upside down rethinking how data flows through systems (20)

Flink Forward San Francisco 2018: Gregory Fee - "Bootstrapping State In Apach...
Flink Forward San Francisco 2018: Gregory Fee - "Bootstrapping State In Apach...Flink Forward San Francisco 2018: Gregory Fee - "Bootstrapping State In Apach...
Flink Forward San Francisco 2018: Gregory Fee - "Bootstrapping State In Apach...
 
Bootstrapping state in Apache Flink
Bootstrapping state in Apache FlinkBootstrapping state in Apache Flink
Bootstrapping state in Apache Flink
 
Storing State Forever: Why It Can Be Good For Your Analytics
Storing State Forever: Why It Can Be Good For Your AnalyticsStoring State Forever: Why It Can Be Good For Your Analytics
Storing State Forever: Why It Can Be Good For Your Analytics
 
Buckle Up! With Valerie Burchby and Xinran Waibe | Current 2022
Buckle Up! With Valerie Burchby and Xinran Waibe | Current 2022Buckle Up! With Valerie Burchby and Xinran Waibe | Current 2022
Buckle Up! With Valerie Burchby and Xinran Waibe | Current 2022
 
The End of Data Entry: Liberate Your Organization Through Automation and Inte...
The End of Data Entry: Liberate Your Organization Through Automation and Inte...The End of Data Entry: Liberate Your Organization Through Automation and Inte...
The End of Data Entry: Liberate Your Organization Through Automation and Inte...
 
GraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
GraphQL Munich Meetup #1 - How We Use GraphQL At CommercetoolsGraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
GraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
 
Predicting Startup Market Trends based on the news and social media - Albert ...
Predicting Startup Market Trends based on the news and social media - Albert ...Predicting Startup Market Trends based on the news and social media - Albert ...
Predicting Startup Market Trends based on the news and social media - Albert ...
 
Scaling Production Data across Microservices
Scaling Production Data across MicroservicesScaling Production Data across Microservices
Scaling Production Data across Microservices
 
Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...
Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...
Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...
 
Stateful Stream Processing at In-Memory Speed
Stateful Stream Processing at In-Memory SpeedStateful Stream Processing at In-Memory Speed
Stateful Stream Processing at In-Memory Speed
 
Challenges and Best Practices of Database Continuous Delivery
Challenges and Best Practices of Database Continuous DeliveryChallenges and Best Practices of Database Continuous Delivery
Challenges and Best Practices of Database Continuous Delivery
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performance
 
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...
 
Are you there Page Experience? It's Me, DevTools.
Are you there Page Experience? It's Me, DevTools.Are you there Page Experience? It's Me, DevTools.
Are you there Page Experience? It's Me, DevTools.
 
Are you there Page Experience? It's me, DevTools
Are you there Page Experience? It's me, DevToolsAre you there Page Experience? It's me, DevTools
Are you there Page Experience? It's me, DevTools
 
Raising ux bar with offline first design
Raising ux bar with offline first designRaising ux bar with offline first design
Raising ux bar with offline first design
 
Building real time Data Pipeline using Spark Streaming
Building real time Data Pipeline using Spark StreamingBuilding real time Data Pipeline using Spark Streaming
Building real time Data Pipeline using Spark Streaming
 
Sea of Data
Sea of DataSea of Data
Sea of Data
 
More Dev. Less Drama.pdf
More Dev. Less Drama.pdfMore Dev. Less Drama.pdf
More Dev. Less Drama.pdf
 
State management with GraphQL [Angular Minsk, Online, 13.06.20]
State management with GraphQL [Angular Minsk, Online, 13.06.20]State management with GraphQL [Angular Minsk, Online, 13.06.20]
State management with GraphQL [Angular Minsk, Online, 13.06.20]
 

Mehr von Paolo Negri

AWS Lambda in infrastructure
AWS Lambda in infrastructureAWS Lambda in infrastructure
AWS Lambda in infrastructurePaolo Negri
 
Erlang introduction geek2geek Berlin
Erlang introduction geek2geek BerlinErlang introduction geek2geek Berlin
Erlang introduction geek2geek BerlinPaolo Negri
 
Erlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughputErlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughputPaolo Negri
 
Getting real with erlang
Getting real with erlangGetting real with erlang
Getting real with erlangPaolo Negri
 
Erlang factory 2011 london
Erlang factory 2011 londonErlang factory 2011 london
Erlang factory 2011 londonPaolo Negri
 
Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"Paolo Negri
 
Scaling Social Games
Scaling Social GamesScaling Social Games
Scaling Social GamesPaolo Negri
 
Mongrel2, a short introduction
Mongrel2, a short introductionMongrel2, a short introduction
Mongrel2, a short introductionPaolo Negri
 
RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009Paolo Negri
 
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...Paolo Negri
 
SimpleDb, an introduction
SimpleDb, an introductionSimpleDb, an introduction
SimpleDb, an introductionPaolo Negri
 
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim CrontabsPaolo Negri
 

Mehr von Paolo Negri (12)

AWS Lambda in infrastructure
AWS Lambda in infrastructureAWS Lambda in infrastructure
AWS Lambda in infrastructure
 
Erlang introduction geek2geek Berlin
Erlang introduction geek2geek BerlinErlang introduction geek2geek Berlin
Erlang introduction geek2geek Berlin
 
Erlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughputErlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughput
 
Getting real with erlang
Getting real with erlangGetting real with erlang
Getting real with erlang
 
Erlang factory 2011 london
Erlang factory 2011 londonErlang factory 2011 london
Erlang factory 2011 london
 
Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"
 
Scaling Social Games
Scaling Social GamesScaling Social Games
Scaling Social Games
 
Mongrel2, a short introduction
Mongrel2, a short introductionMongrel2, a short introduction
Mongrel2, a short introduction
 
RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009
 
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
 
SimpleDb, an introduction
SimpleDb, an introductionSimpleDb, an introduction
SimpleDb, an introduction
 
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
 

KĂŒrzlich hochgeladen

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraĂșjo
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...gurkirankumar98700
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

KĂŒrzlich hochgeladen (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Turning the web stack upside down rethinking how data flows through systems

  • 1. Turning the web stack upside down Rethinking how data ïŹ‚ows through systems By Paolo Negri
  • 2. Paolo Negri CTO & co-founder, Contentful @hungryblank linkedin.com/in/panegri
  • 3. Before we talk about data ïŹ‚ows...
  • 4. Let’s talk about online gaming
  • 5. Traditional architecture Everything is driven by a request Game App server Persistent datastore @hungryblank
  • 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
  • 7. We turned it upside down
  • 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
  • 9. Wooga’s upside-down stack Game Data layer App server Persistent datastore @hungryblank
  • 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
  • 12. But you’re probably not building games... ...and these days neither am I
  • 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
  • 14. Contentful allows customers to create all kinds of experiences @hungryblank
  • 15. More often than not, it’s a website @hungryblank
  • 16. More often than not, it’s a website @hungryblank
  • 17. More often than not, it’s a website @hungryblank
  • 18. More often than not, it’s a website @hungryblank
  • 19. More often than not, it’s a website @hungryblank
  • 20. More often than not, it’s a website @hungryblank
  • 21. Traditional web architecture Everything is driven by a request Browser App server Database @hungryblank
  • 22. Is there an upside-down stack for the web?
  • 24. Static site generators Browser Static site host Build server SCM Developers Editors @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
  • 29. Static sites are an upside-down stack for the web
  • 30. Events drive the system Requests are just another event
  • 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
  • 37. O N E Build driven or reactive? @hungryblank
  • 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?