We’re AGILE
we embrace CHANGE
we automate EVERYTHING
we always value TOP TALENT
Serverless
Real-time Tracking & Analysis
@heisthedon
about://me
dev manager @carsales
head of retail platform
@heisthedon
Agenda
• Motivation behind this
• Serverless.. What and Why?
• The Architecture
• What We Learnt
Our Motivation
Our Inspiration
Feedback Loop
we want faster feedback
be autonomous and resourceful
take ownership and be accountable
so we build our own tracking solution
Our Success Metrics are
Speed of Implementation Must be Cost Effectives No Reinvent the Wheels Less Maintenance
What Is Serverless Architectures?
Serverless != No Server
Serverless is…
• Orchestration. Event-driven - the "if this, then that" trigger
• Microservices architecture
• In the Cloud
Why Serverless Architectures?
Focus on what matters
Serverless helps us to focus on what matters…
• Business problem to solve
• Infrastructure – less maintenance, auto-scale, capacity and
underutilization servers not a big concern
• Less code to write
• Logging and monitoring built-in
Our Lego Building Blocks
Amazon
CloudWatch
Amazon API
Gateway
Amazon
S3
Amazon
Elasticsearch
Service
Amazon
Kinesis
Streams
AWS
Lambda
Amazon
Redshift
Amazon
API Gateway
API Management Tools
• REST Endpoint
• Authentication
• Caching
• Monitoring
• Request throttling
• Cloudfront integration
• Cloudwatch Monitoring
• Stage features – dev vs prod
Maintenance
• No schedule downtime
Pricing Model
• Pay what you use
AWS
Lambda
Function as a Service (FAAS)
• Execute in response to events
• Deploy in millisecond
• Live in second (max 300s)
• Auto-scale by throughput (run 100 concurrent execution)
• Built-in retry mechanism
• Support versioning / aliasing
• Cloudwatch Log & Monitoring
Maintenance
• No schedule downtime
Pricing Model
• Pay what you use on execution and compute
(per execution on 100ms block)
Amazon
Kinesis Stream
Streaming Data Platform
• Scale in / out by Shard
• Data retention 1 – 7 days
• One shard has capacity of 1MB/sec in & 2MB/sec out,
and throughput of 1000 records / sec
• Cloudwatch Monitoring
Maintenance
• No schedule downtime
Pricing Model
• Pay what you use on data in
(PUT Payload Unit per 25KB block = $0.014 per million unit)
• Shard Hour (1 Shard = $11 per month)
• Data Retention
Amazon
Elasticsearch
Service
The Power of Elasticsearch and Cloud Combined
• The Full ELK Stacks
• High availability
• Failure detection, patch, snapshot are fully managed
• Cloudwatch Monitoring
Maintenance
• No schedule downtime
Pricing Model
• Pay what you use on compute hours & EBS storage
AWS
Lambda
Amazon
Elasticsearch
Service
Realtime Analytic
The Architecture
Amazon
CloudWatch
Amazon API
Gateway
Amazon
Kinesis
Streams
We are going to send…
100m requests / month
Amazon API
Gateway
Ajax /
img 1x1 Amazon
Kinesis
Streams
Integration with AWS Service Proxy
Map API Payload into Kinesis Stream Payload
Cost
$350
Cost
$18
Amazon
Kinesis
Streams
AWS
Lambda
Amazon
Elasticsearch
Service
POST to ES IndexPoll in batches
Cost
$94
Cost
$50
Kibana Dashboard
Few Cost Optimisation
• API Gateway and Lambda can be very
expensive..
• 100m requests = $350
• 200m requests = $700
• Batch requests to API Gateway
• Retrieve records in batch from Kinesis
• Lambda execution time
Deployment
Cloud Formation
for rest
Lambda utilises
Serverless Framework
Monitoring and Logging
For cost management
and visibility
CloudWatch
integration with all
services
CloudWatch Dashboard
CloudWatch Logs
Amazon
S3
AWS
Lambda
Amazon
Redshift
AWS
Lambda
Amazon
Elasticsearch
Service
Realtime Analytic
Extensibility
Amazon
CloudWatch
Amazon API
Gateway
Amazon
Kinesis
Streams
Our Success Metrics Revisited
Speed of Implementation Must be Cost Effectives No Reinvent the Wheels Less Maintenance
• Duplicate record on Kinesis Stream
• Cold-start on Lambda
Question?
Stay in touch
- careers.carsalesnetwork.com.au
- linkedin.com/carsales.com.au
- facebook.com/carsales.com.au
- Twitter: @carsales

Serverless Real-time Tracking & Analysis

Editor's Notes

  • #16 Free up our time for the important things.
  • #25 Further extension we can easily create another lambda function that can help us integrate with Redshift