SlideShare una empresa de Scribd logo
1 de 38
Descargar para leer sin conexión
© 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

Más contenido relacionado

La actualidad más candente

virtualization and hypervisors
virtualization and hypervisorsvirtualization and hypervisors
virtualization and hypervisorsGaurav Suri
 
Aplicaciones distribuidas
Aplicaciones distribuidasAplicaciones distribuidas
Aplicaciones distribuidasTensor
 
Tipos de redes locales
Tipos de redes localesTipos de redes locales
Tipos de redes localesCarloz Kaztro
 
Que Es Windows 2000 Server
Que Es Windows 2000 ServerQue Es Windows 2000 Server
Que Es Windows 2000 ServerArnulfo Gomez
 
Sistemas operativos distribuidos y sistemas distribuidos
Sistemas operativos distribuidos y sistemas distribuidosSistemas operativos distribuidos y sistemas distribuidos
Sistemas operativos distribuidos y sistemas distribuidoscris_bar
 
Administración de procesos y del procesador
Administración de procesos y del procesadorAdministración de procesos y del procesador
Administración de procesos y del procesadorMicael Feliz Arias
 
Types of clouds in cloud computing
Types of clouds in cloud computingTypes of clouds in cloud computing
Types of clouds in cloud computingMahesh Chemmala
 
concepto para instalacion de un sistema operativo
concepto para instalacion de un sistema operativoconcepto para instalacion de un sistema operativo
concepto para instalacion de un sistema operativoAgustin Valdez
 
Virtualization & cloud computing
Virtualization & cloud computingVirtualization & cloud computing
Virtualization & cloud computingSoumyajit Basu
 
Sistemas operativos distribuidos
Sistemas operativos distribuidosSistemas operativos distribuidos
Sistemas operativos distribuidossaul_ramos
 
Paradigmas de Interaccion usuario-máquina
Paradigmas de Interaccion usuario-máquinaParadigmas de Interaccion usuario-máquina
Paradigmas de Interaccion usuario-máquinaXimena Tabares
 
Active directory domain service
Active directory domain serviceActive directory domain service
Active directory domain serviceFestus Oriaku
 

La actualidad más candente (20)

Red pan
Red panRed pan
Red pan
 
Windows Server
Windows ServerWindows Server
Windows Server
 
virtualization and hypervisors
virtualization and hypervisorsvirtualization and hypervisors
virtualization and hypervisors
 
Aplicaciones distribuidas
Aplicaciones distribuidasAplicaciones distribuidas
Aplicaciones distribuidas
 
Tipos de redes locales
Tipos de redes localesTipos de redes locales
Tipos de redes locales
 
Elementos básicos de redes
Elementos básicos de redesElementos básicos de redes
Elementos básicos de redes
 
Que Es Windows 2000 Server
Que Es Windows 2000 ServerQue Es Windows 2000 Server
Que Es Windows 2000 Server
 
Sistemas operativos distribuidos y sistemas distribuidos
Sistemas operativos distribuidos y sistemas distribuidosSistemas operativos distribuidos y sistemas distribuidos
Sistemas operativos distribuidos y sistemas distribuidos
 
Administración de procesos y del procesador
Administración de procesos y del procesadorAdministración de procesos y del procesador
Administración de procesos y del procesador
 
Cluster computing
Cluster computingCluster computing
Cluster computing
 
Types of clouds in cloud computing
Types of clouds in cloud computingTypes of clouds in cloud computing
Types of clouds in cloud computing
 
concepto para instalacion de un sistema operativo
concepto para instalacion de un sistema operativoconcepto para instalacion de un sistema operativo
concepto para instalacion de un sistema operativo
 
Virtualization & cloud computing
Virtualization & cloud computingVirtualization & cloud computing
Virtualization & cloud computing
 
Arquitectura distribuida
Arquitectura distribuidaArquitectura distribuida
Arquitectura distribuida
 
DNS Presentation
DNS PresentationDNS Presentation
DNS Presentation
 
Validations for an entry [Xamarin.Forms]
Validations for an entry [Xamarin.Forms]Validations for an entry [Xamarin.Forms]
Validations for an entry [Xamarin.Forms]
 
Sistemas operativos distribuidos
Sistemas operativos distribuidosSistemas operativos distribuidos
Sistemas operativos distribuidos
 
protocolos de red
protocolos de redprotocolos de red
protocolos de red
 
Paradigmas de Interaccion usuario-máquina
Paradigmas de Interaccion usuario-máquinaParadigmas de Interaccion usuario-máquina
Paradigmas de Interaccion usuario-máquina
 
Active directory domain service
Active directory domain serviceActive directory domain service
Active directory domain service
 

Similar a 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-2020Tim Wagner
 
Introduction to MANTL Data Platform
Introduction to MANTL Data PlatformIntroduction to MANTL Data Platform
Introduction to MANTL Data PlatformCisco 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 Cloudmoshfiq
 
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.pdfapidays
 
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.ukGraham 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 clickMichele 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 - RedisKrishna-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 viewPierre 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 DockerAjeet 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 ServicesCisco 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 RedisAmazon 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 computingPatrice 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 EinsatzMariaDB plc
 
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 EinsatzMariaDB 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
 
Cidr11 paper32
Cidr11 paper32Cidr11 paper32
Cidr11 paper32jujukoko
 

Similar a 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
 
Cidr11 paper32
Cidr11 paper32Cidr11 paper32
Cidr11 paper32
 

Más de 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 FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon 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
 
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 WorkloadsAmazon 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 sfatareAmazon 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 NodeJSAmazon 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 webAmazon 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 sfatareAmazon 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 ServiceAmazon Web Services
 

Más de 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