SlideShare a Scribd company logo
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The Nanoservices Architecture
That Powers BBC Online
M a t t h e w C l a r k , B B C
N o v e m b e r 2 8 , 2 0 1 7
AWS re:INVENT
D A T 3 2 2
Background
Pattern
Our implementation
Pros & cons
This is the story of the
nanoservices pattern.
Small units of logic that are
easily understood, deployed,
operated, and shared.
Built on an AWS-hosted
platform that makes extensive
use of Amazon ElastiCache.
4
AWS’s hosted service for Redis (and Memcached)
Automates common administrative tasks (e.g., failed nodes,
server optimisation)
Multiple options available (different memory and network
sizes)
Redis is much more than a key-value store: multiple data
types, transactions, Lua scripting, pub/sub, …
Can grow with sharding and/or replication
Amazon ElastiCache
5
Make the common things easy
and the special things possible
8
http://2016.chartbeat.com/
Multiple teams
Multiple technologies
Smaller and safer deploys
Shareable and flexible
Easily scalable
Pros
9
Microservices Cons
Maintenance overhead
Comms overhead
Multi-version challenges
Harder to refactor
Cost
[Microservices] bring an enormous amount of operational complexity to
the table. Suddenly, you need to continuously deploy many different
(possibly containerized) services. New concerns arise: service
discovery, distributed logging, tracing and so on. You are now even more
prone to the fallacies of distributed computing. Versioning of interfaces
and configuration management become a major concern. The list goes
on and on.
–Sander Mak
https://www.oreilly.com/ideas/modules-vs-microservices
10
https://en.wikipedia.org/wiki/Microservices
Responsible for a single, non-trivial, business-understandable task
Smaller than a microservice, larger than a function
Likely to call other nanoservices, to offer rich functionality
The ideal sized thing to release (or MVT) in a CD environment
Example:
– Get customer order history
– Place order
Nanoservice
12
http://www.bbc.co.uk/news
Event
page
Top Left Centre Right
Medals
module
Medals
page
Medals
data
Mobile
alert
DB
Multi-
lingual
medals
Internet
connected
TV
Architecture
18
Developer
Data (APIs, etc.)
User
Nanoservice
store
Nanoservice
platform
Metadata
store
Content
cache
Queue
Every output from every run of
every nanoservice is stored
Cheap, simple, ephemeral
Maximises reuse, speed,
reliability, and scalability
Redis for content
19
4x m4.xlarge (sharded)
Redis: We store 6–8 million items
20
Metadata about every request, and its ‘tree’, is
stored in Redis
If the data changes, the metadata informs us what
nanoservices to rerun
The ‘relationship’ is stored both ways:
 ‘A uses B’ and ‘B is used by A’
 Not ‘normal form’, but fast
 Lua can help make atomic
 ‘Hexastore’ approach can do full graphs
Redis for metadata
21
Medals
page
Medals
module
Medals
Data
Mobile
alert
DB
Redis, as a queue, is extraordinarily fast (<5 ms end-to-end journey)
It’s the only solution fast enough for this architecture
We comfortably do 10k messages per second (r3.4xlarge)
Redis for queues
22
We use Lua to also write to a set, to then catch de-duplicates
producer
LPUSH queue msg BRPOP queue
consumer
Doesn’t really work with replication  Can be a SPOF
Lossy (due to consumer failure), though can be offset with:
 BRPOPLPUSH <queue> <in-progress-queue> <timeout>
 And something to analyse the in-progress-queue
Metrics not so obvious
Harder to scale
No advanced features (dead-letter, prioritization, data pushes)
Redis for queues: Trade-offs
23
Cross-AZ Redis calls can be 4x slower* (though still very quick)
Replication helps (but you become eventually consistent)
To minimise latency, consider multiple single-AZ deployments:
An alternative cross-AZ structure
24
* redis-benchmark -c 1 -n 10000 -t GET on m4.large against m4.large ElastiCache, does 7,200/sec same AZ, 1,800/sec different AZ
Availability Zone #1 Availability Zone #2
Each nanoservice is developed
& managed independently
Nanoservice
Owner Tests
Connected
nanoservices
Single-click
deploy Analytics UsersStatic files
CodeVersions
Demo
26
Great ‘Lego bricks’ for sharing
Easy to understand concepts, reduces barrier-to-entry
Should be good value (sharing infrastructure, highly cacheable)
Looks after much of the operational side (scaling, resilience, monitoring,
etc.)
Fast deployment
 Greater development speed
Nanoservices: Advantages
27
Single point of failure
Must be conservative, isolate and limit
Can be restrictive
Not very fast
Needs great tooling to manage and understand usage
Challenges
28
Multiple teams
Multiple technologies
Smaller and safer deploys
Shareable and flexible
More scalable
Pros
29
Microservices Cons
Maintenance overhead
Comms overhead
Multi-version challenges
Harder to refactor
Cost
✓
✓
✓
✓
?
Serverless
AWS Lambda
functions
Azure functions Google Cloud
functions
30
Why should they have all the fun?
The world needs powerful serverless platforms.
Is this serverless?
31
We didn’t use Lambda because:
 The need for consistent, <10 ms response
 Instantiation from a Redis queue
 Twiddling thumbs (waiting for dependencies)
We’re considering ‘burst to Lambda’ possibilities
To the developers, this is serverless
Serverless will fundamentally change how we build business around
technology and how you code. …
You thought devops was big but it’s chicken feed compared to this…
...expect to see the whole world being overtaken by serverless by 2025
–Simon Wardley, in Why the fuss about serverless?
https://www.linkedin.com/pulse/why-fuss-serverless-simon-wardley
32
33
Is nanoservices a paradigm for
future serverless architecture?
https://medium.com/netflix-techblog/developer-experience-lessons-operating-a-serverless-like-platform-at-netflix-
a8bbd5b899a0
It’s not just us
34
https://tinyurl.com/nanoservices
But this is (if you want to read more)
35
Nanoservices have
brought the BBC:
Sharing
Flexibility
Efficiency
Velocity
Summary
Using Redis, you can achieve phenomenal performance, not just in
caching content, but as a control and communication layer.
Which can let you build fast and flexible serverless-like platforms that
allow your organisation to move faster.
The nanoservice pattern is an interesting way to design for serverless,
and can maximise the potential of continuous delivery, reusability, and
flexibility.
37
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!
M a t t h e w C l a r k
m a t t h e w . c l a r k @ b b c . c o . u k
@ m a t t h e w 1 0 0 0

More Related Content

What's hot

Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and Permissions
Ahmed El-Arabawy
 
Hive(ppt)
Hive(ppt)Hive(ppt)
Hive(ppt)
Abhinav Tyagi
 
10 big data hadoop
10 big data hadoop10 big data hadoop
10 big data hadoop
Patrick Bury
 
Design of Hadoop Distributed File System
Design of Hadoop Distributed File SystemDesign of Hadoop Distributed File System
Design of Hadoop Distributed File System
Dr. C.V. Suresh Babu
 
Introduction to Cloud Computing
Introduction to Cloud ComputingIntroduction to Cloud Computing
Introduction to Cloud Computing
Animesh Chaturvedi
 
Laravel Lab
Laravel LabLaravel Lab
Laravel Lab
Leo Nguyen
 
HTTP In-depth
HTTP In-depthHTTP In-depth
HTTP In-depth
Vinayak Hegde
 
Overview of Zookeeper, Helix and Kafka (Oakjug)
Overview of Zookeeper, Helix and Kafka (Oakjug)Overview of Zookeeper, Helix and Kafka (Oakjug)
Overview of Zookeeper, Helix and Kafka (Oakjug)
Chris Richardson
 
Cloud Computing.pptx
Cloud Computing.pptxCloud Computing.pptx
Cloud Computing.pptx
Atif Razi
 
Лекция 13. YARN
Лекция 13. YARNЛекция 13. YARN
Лекция 13. YARN
Technopark
 
Instalar SDK Google Cloud
Instalar SDK Google CloudInstalar SDK Google Cloud
Instalar SDK Google Cloud
Moisés Elías Araya
 
WCAG 2.2 e 3.0
WCAG 2.2 e 3.0WCAG 2.2 e 3.0
WCAG 2.2 e 3.0
Reinaldo Ferraz
 
Real data models of silicon valley
Real data models of silicon valleyReal data models of silicon valley
Real data models of silicon valley
Patrick McFadin
 
Cloud computing and Cloudsim
Cloud computing and CloudsimCloud computing and Cloudsim
Cloud computing and Cloudsim
Manash Kumar Mondal
 
Mapreduce by examples
Mapreduce by examplesMapreduce by examples
Mapreduce by examples
Andrea Iacono
 
Introduction to Hadoop and Cloudera, Louisville BI & Big Data Analytics Meetup
Introduction to Hadoop and Cloudera, Louisville BI & Big Data Analytics MeetupIntroduction to Hadoop and Cloudera, Louisville BI & Big Data Analytics Meetup
Introduction to Hadoop and Cloudera, Louisville BI & Big Data Analytics Meetup
iwrigley
 
Cloud ppt
Cloud pptCloud ppt
Cloud ppt
Manoj Jhawar
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
DrSonali Vyas
 
Introduction to MapReduce - Hadoop Streaming | Big Data Hadoop Spark Tutorial...
Introduction to MapReduce - Hadoop Streaming | Big Data Hadoop Spark Tutorial...Introduction to MapReduce - Hadoop Streaming | Big Data Hadoop Spark Tutorial...
Introduction to MapReduce - Hadoop Streaming | Big Data Hadoop Spark Tutorial...
CloudxLab
 

What's hot (20)

Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and Permissions
 
Hive(ppt)
Hive(ppt)Hive(ppt)
Hive(ppt)
 
10 big data hadoop
10 big data hadoop10 big data hadoop
10 big data hadoop
 
Design of Hadoop Distributed File System
Design of Hadoop Distributed File SystemDesign of Hadoop Distributed File System
Design of Hadoop Distributed File System
 
Introduction to Cloud Computing
Introduction to Cloud ComputingIntroduction to Cloud Computing
Introduction to Cloud Computing
 
Use a cabeça jsp & servlets
Use a cabeça   jsp & servletsUse a cabeça   jsp & servlets
Use a cabeça jsp & servlets
 
Laravel Lab
Laravel LabLaravel Lab
Laravel Lab
 
HTTP In-depth
HTTP In-depthHTTP In-depth
HTTP In-depth
 
Overview of Zookeeper, Helix and Kafka (Oakjug)
Overview of Zookeeper, Helix and Kafka (Oakjug)Overview of Zookeeper, Helix and Kafka (Oakjug)
Overview of Zookeeper, Helix and Kafka (Oakjug)
 
Cloud Computing.pptx
Cloud Computing.pptxCloud Computing.pptx
Cloud Computing.pptx
 
Лекция 13. YARN
Лекция 13. YARNЛекция 13. YARN
Лекция 13. YARN
 
Instalar SDK Google Cloud
Instalar SDK Google CloudInstalar SDK Google Cloud
Instalar SDK Google Cloud
 
WCAG 2.2 e 3.0
WCAG 2.2 e 3.0WCAG 2.2 e 3.0
WCAG 2.2 e 3.0
 
Real data models of silicon valley
Real data models of silicon valleyReal data models of silicon valley
Real data models of silicon valley
 
Cloud computing and Cloudsim
Cloud computing and CloudsimCloud computing and Cloudsim
Cloud computing and Cloudsim
 
Mapreduce by examples
Mapreduce by examplesMapreduce by examples
Mapreduce by examples
 
Introduction to Hadoop and Cloudera, Louisville BI & Big Data Analytics Meetup
Introduction to Hadoop and Cloudera, Louisville BI & Big Data Analytics MeetupIntroduction to Hadoop and Cloudera, Louisville BI & Big Data Analytics Meetup
Introduction to Hadoop and Cloudera, Louisville BI & Big Data Analytics Meetup
 
Cloud ppt
Cloud pptCloud ppt
Cloud ppt
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
 
Introduction to MapReduce - Hadoop Streaming | Big Data Hadoop Spark Tutorial...
Introduction to MapReduce - Hadoop Streaming | Big Data Hadoop Spark Tutorial...Introduction to MapReduce - Hadoop Streaming | Big Data Hadoop Spark Tutorial...
Introduction to MapReduce - Hadoop Streaming | Big Data Hadoop Spark Tutorial...
 

Similar to DAT322_The Nanoservices Architecture That Powers BBC Online

AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020
AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020
AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020
Tim Wagner
 
Introduction to MANTL Data Platform
Introduction to MANTL Data PlatformIntroduction to MANTL Data Platform
Introduction to MANTL Data Platform
Cisco DevNet
 
Database Architecture & Scaling Strategies, in the Cloud & on the Rack
Database Architecture & Scaling Strategies, in the Cloud & on the Rack Database Architecture & Scaling Strategies, in the Cloud & on the Rack
Database Architecture & Scaling Strategies, in the Cloud & on the Rack
Clustrix
 
Presentation on Databases in the Cloud
Presentation on Databases in the CloudPresentation on Databases in the Cloud
Presentation on Databases in the Cloud
moshfiq
 
Managing Data with Amazon ElastiCache for Redis - August 2016 Monthly Webinar...
Managing Data with Amazon ElastiCache for Redis - August 2016 Monthly Webinar...Managing Data with Amazon ElastiCache for Redis - August 2016 Monthly Webinar...
Managing Data with Amazon ElastiCache for Redis - August 2016 Monthly Webinar...
Amazon Web Services
 
apidays LIVE Singapore 2022_Redesigning Data Architecture.pdf
apidays LIVE Singapore 2022_Redesigning Data Architecture.pdfapidays LIVE Singapore 2022_Redesigning Data Architecture.pdf
apidays LIVE Singapore 2022_Redesigning Data Architecture.pdf
apidays
 
Why we chose mongodb for guardian.co.uk
Why we chose mongodb for guardian.co.ukWhy we chose mongodb for guardian.co.uk
Why we chose mongodb for guardian.co.uk
Graham Tackley
 
Build your Software Defined Datacenter in a click
Build your Software Defined Datacenter in a clickBuild your Software Defined Datacenter in a click
Build your Software Defined Datacenter in a click
Michele Naldini
 
Highly scalable caching service on cloud - Redis
Highly scalable caching service on cloud - RedisHighly scalable caching service on cloud - Redis
Highly scalable caching service on cloud - Redis
Krishna-Kumar
 
MongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of viewMongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of view
Pierre Baillet
 
Real time Object Detection and Analytics using RedisEdge and Docker
Real time Object Detection and Analytics using RedisEdge and DockerReal time Object Detection and Analytics using RedisEdge and Docker
Real time Object Detection and Analytics using RedisEdge and Docker
Ajeet Singh Raina
 
MANTL Data Platform, Microservices and BigData Services
MANTL Data Platform, Microservices and BigData ServicesMANTL Data Platform, Microservices and BigData Services
MANTL Data Platform, Microservices and BigData Services
Cisco DevNet
 
Managing Data with Voume Velocity, and Variety with Amazon ElastiCache for Redis
Managing Data with Voume Velocity, and Variety with Amazon ElastiCache for RedisManaging Data with Voume Velocity, and Variety with Amazon ElastiCache for Redis
Managing Data with Voume Velocity, and Variety with Amazon ElastiCache for Redis
Amazon Web Services
 
Cloud Spotting 2017: An overview of cloud computing
Cloud Spotting 2017: An overview of cloud computingCloud Spotting 2017: An overview of cloud computing
Cloud Spotting 2017: An overview of cloud computing
Patrice Kerremans
 
Open Source für den geschäftskritischen Einsatz
Open Source für den geschäftskritischen EinsatzOpen Source für den geschäftskritischen Einsatz
Open Source für den geschäftskritischen Einsatz
MariaDB plc
 
Computer project
Computer projectComputer project
Computer project
Pranav Nedungadi
 
Keynote: Open Source für den geschäftskritischen Einsatz
Keynote: Open Source für den geschäftskritischen EinsatzKeynote: Open Source für den geschäftskritischen Einsatz
Keynote: Open Source für den geschäftskritischen Einsatz
MariaDB plc
 
Cloud Has Become the New Normal: TCS
Cloud Has Become the New Normal: TCS Cloud Has Become the New Normal: TCS
Cloud Has Become the New Normal: TCS
Amazon Web Services
 
Megastore providing scalable, highly available storage for interactive services
Megastore providing scalable, highly available storage for interactive servicesMegastore providing scalable, highly available storage for interactive services
Megastore providing scalable, highly available storage for interactive services
João Gabriel Lima
 

Similar to DAT322_The Nanoservices Architecture That Powers BBC Online (20)

AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020
AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020
AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020
 
Introduction to MANTL Data Platform
Introduction to MANTL Data PlatformIntroduction to MANTL Data Platform
Introduction to MANTL Data Platform
 
Database Architecture & Scaling Strategies, in the Cloud & on the Rack
Database Architecture & Scaling Strategies, in the Cloud & on the Rack Database Architecture & Scaling Strategies, in the Cloud & on the Rack
Database Architecture & Scaling Strategies, in the Cloud & on the Rack
 
Presentation on Databases in the Cloud
Presentation on Databases in the CloudPresentation on Databases in the Cloud
Presentation on Databases in the Cloud
 
Managing Data with Amazon ElastiCache for Redis - August 2016 Monthly Webinar...
Managing Data with Amazon ElastiCache for Redis - August 2016 Monthly Webinar...Managing Data with Amazon ElastiCache for Redis - August 2016 Monthly Webinar...
Managing Data with Amazon ElastiCache for Redis - August 2016 Monthly Webinar...
 
apidays LIVE Singapore 2022_Redesigning Data Architecture.pdf
apidays LIVE Singapore 2022_Redesigning Data Architecture.pdfapidays LIVE Singapore 2022_Redesigning Data Architecture.pdf
apidays LIVE Singapore 2022_Redesigning Data Architecture.pdf
 
Why we chose mongodb for guardian.co.uk
Why we chose mongodb for guardian.co.ukWhy we chose mongodb for guardian.co.uk
Why we chose mongodb for guardian.co.uk
 
No sql
No sqlNo sql
No sql
 
Build your Software Defined Datacenter in a click
Build your Software Defined Datacenter in a clickBuild your Software Defined Datacenter in a click
Build your Software Defined Datacenter in a click
 
Highly scalable caching service on cloud - Redis
Highly scalable caching service on cloud - RedisHighly scalable caching service on cloud - Redis
Highly scalable caching service on cloud - Redis
 
MongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of viewMongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of view
 
Real time Object Detection and Analytics using RedisEdge and Docker
Real time Object Detection and Analytics using RedisEdge and DockerReal time Object Detection and Analytics using RedisEdge and Docker
Real time Object Detection and Analytics using RedisEdge and Docker
 
MANTL Data Platform, Microservices and BigData Services
MANTL Data Platform, Microservices and BigData ServicesMANTL Data Platform, Microservices and BigData Services
MANTL Data Platform, Microservices and BigData Services
 
Managing Data with Voume Velocity, and Variety with Amazon ElastiCache for Redis
Managing Data with Voume Velocity, and Variety with Amazon ElastiCache for RedisManaging Data with Voume Velocity, and Variety with Amazon ElastiCache for Redis
Managing Data with Voume Velocity, and Variety with Amazon ElastiCache for Redis
 
Cloud Spotting 2017: An overview of cloud computing
Cloud Spotting 2017: An overview of cloud computingCloud Spotting 2017: An overview of cloud computing
Cloud Spotting 2017: An overview of cloud computing
 
Open Source für den geschäftskritischen Einsatz
Open Source für den geschäftskritischen EinsatzOpen Source für den geschäftskritischen Einsatz
Open Source für den geschäftskritischen Einsatz
 
Computer project
Computer projectComputer project
Computer project
 
Keynote: Open Source für den geschäftskritischen Einsatz
Keynote: Open Source für den geschäftskritischen EinsatzKeynote: Open Source für den geschäftskritischen Einsatz
Keynote: Open Source für den geschäftskritischen Einsatz
 
Cloud Has Become the New Normal: TCS
Cloud Has Become the New Normal: TCS Cloud Has Become the New Normal: TCS
Cloud Has Become the New Normal: TCS
 
Megastore providing scalable, highly available storage for interactive services
Megastore providing scalable, highly available storage for interactive servicesMegastore providing scalable, highly available storage for interactive services
Megastore providing scalable, highly available storage for interactive services
 

More from Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
Amazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
Amazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
Amazon Web Services
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Amazon Web Services
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
Amazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
Amazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Amazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
Amazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Amazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
Amazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

DAT322_The Nanoservices Architecture That Powers BBC Online

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. The Nanoservices Architecture That Powers BBC Online M a t t h e w C l a r k , B B C N o v e m b e r 2 8 , 2 0 1 7 AWS re:INVENT D A T 3 2 2
  • 2.
  • 3.
  • 4. Background Pattern Our implementation Pros & cons This is the story of the nanoservices pattern. Small units of logic that are easily understood, deployed, operated, and shared. Built on an AWS-hosted platform that makes extensive use of Amazon ElastiCache. 4
  • 5. AWS’s hosted service for Redis (and Memcached) Automates common administrative tasks (e.g., failed nodes, server optimisation) Multiple options available (different memory and network sizes) Redis is much more than a key-value store: multiple data types, transactions, Lua scripting, pub/sub, … Can grow with sharding and/or replication Amazon ElastiCache 5
  • 6.
  • 7. Make the common things easy and the special things possible
  • 9. Multiple teams Multiple technologies Smaller and safer deploys Shareable and flexible Easily scalable Pros 9 Microservices Cons Maintenance overhead Comms overhead Multi-version challenges Harder to refactor Cost
  • 10. [Microservices] bring an enormous amount of operational complexity to the table. Suddenly, you need to continuously deploy many different (possibly containerized) services. New concerns arise: service discovery, distributed logging, tracing and so on. You are now even more prone to the fallacies of distributed computing. Versioning of interfaces and configuration management become a major concern. The list goes on and on. –Sander Mak https://www.oreilly.com/ideas/modules-vs-microservices 10
  • 12. Responsible for a single, non-trivial, business-understandable task Smaller than a microservice, larger than a function Likely to call other nanoservices, to offer rich functionality The ideal sized thing to release (or MVT) in a CD environment Example: – Get customer order history – Place order Nanoservice 12
  • 14.
  • 15. Event page Top Left Centre Right Medals module Medals page Medals data Mobile alert DB Multi- lingual medals Internet connected TV
  • 16.
  • 17.
  • 19. Every output from every run of every nanoservice is stored Cheap, simple, ephemeral Maximises reuse, speed, reliability, and scalability Redis for content 19
  • 20. 4x m4.xlarge (sharded) Redis: We store 6–8 million items 20
  • 21. Metadata about every request, and its ‘tree’, is stored in Redis If the data changes, the metadata informs us what nanoservices to rerun The ‘relationship’ is stored both ways:  ‘A uses B’ and ‘B is used by A’  Not ‘normal form’, but fast  Lua can help make atomic  ‘Hexastore’ approach can do full graphs Redis for metadata 21 Medals page Medals module Medals Data Mobile alert DB
  • 22. Redis, as a queue, is extraordinarily fast (<5 ms end-to-end journey) It’s the only solution fast enough for this architecture We comfortably do 10k messages per second (r3.4xlarge) Redis for queues 22 We use Lua to also write to a set, to then catch de-duplicates producer LPUSH queue msg BRPOP queue consumer
  • 23. Doesn’t really work with replication  Can be a SPOF Lossy (due to consumer failure), though can be offset with:  BRPOPLPUSH <queue> <in-progress-queue> <timeout>  And something to analyse the in-progress-queue Metrics not so obvious Harder to scale No advanced features (dead-letter, prioritization, data pushes) Redis for queues: Trade-offs 23
  • 24. Cross-AZ Redis calls can be 4x slower* (though still very quick) Replication helps (but you become eventually consistent) To minimise latency, consider multiple single-AZ deployments: An alternative cross-AZ structure 24 * redis-benchmark -c 1 -n 10000 -t GET on m4.large against m4.large ElastiCache, does 7,200/sec same AZ, 1,800/sec different AZ Availability Zone #1 Availability Zone #2
  • 25. Each nanoservice is developed & managed independently Nanoservice Owner Tests Connected nanoservices Single-click deploy Analytics UsersStatic files CodeVersions
  • 27. Great ‘Lego bricks’ for sharing Easy to understand concepts, reduces barrier-to-entry Should be good value (sharing infrastructure, highly cacheable) Looks after much of the operational side (scaling, resilience, monitoring, etc.) Fast deployment  Greater development speed Nanoservices: Advantages 27
  • 28. Single point of failure Must be conservative, isolate and limit Can be restrictive Not very fast Needs great tooling to manage and understand usage Challenges 28
  • 29. Multiple teams Multiple technologies Smaller and safer deploys Shareable and flexible More scalable Pros 29 Microservices Cons Maintenance overhead Comms overhead Multi-version challenges Harder to refactor Cost ✓ ✓ ✓ ✓ ?
  • 30. Serverless AWS Lambda functions Azure functions Google Cloud functions 30 Why should they have all the fun? The world needs powerful serverless platforms.
  • 31. Is this serverless? 31 We didn’t use Lambda because:  The need for consistent, <10 ms response  Instantiation from a Redis queue  Twiddling thumbs (waiting for dependencies) We’re considering ‘burst to Lambda’ possibilities To the developers, this is serverless
  • 32. Serverless will fundamentally change how we build business around technology and how you code. … You thought devops was big but it’s chicken feed compared to this… ...expect to see the whole world being overtaken by serverless by 2025 –Simon Wardley, in Why the fuss about serverless? https://www.linkedin.com/pulse/why-fuss-serverless-simon-wardley 32
  • 33. 33 Is nanoservices a paradigm for future serverless architecture?
  • 35. https://tinyurl.com/nanoservices But this is (if you want to read more) 35
  • 36. Nanoservices have brought the BBC: Sharing Flexibility Efficiency Velocity
  • 37. Summary Using Redis, you can achieve phenomenal performance, not just in caching content, but as a control and communication layer. Which can let you build fast and flexible serverless-like platforms that allow your organisation to move faster. The nanoservice pattern is an interesting way to design for serverless, and can maximise the potential of continuous delivery, reusability, and flexibility. 37
  • 38. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you! M a t t h e w C l a r k m a t t h e w . c l a r k @ b b c . c o . u k @ m a t t h e w 1 0 0 0