SlideShare ist ein Scribd-Unternehmen logo
1 von 46
Downloaden Sie, um offline zu lesen
Serverless and Streaming
- Building the auction platform
- Event driven architectures on Kafka
- FaaS for streaming
- Putting it in action
●
●
●
●
●
users
the world
selling
buying
the sketch
●
●
●
●
●
Auction items
Items being placed
1.
Bids against item ‘duran duran’
stream-table
join against ‘duran duran’
2.
Item ‘duran duran’
3.
CDC Stream
{ item:duran res: 100 bid: 125 buyer: michael }
{ item:duran res: 100 bid: 120 buyer: nick }
{ item:duran res: 100 bid: 121 buyer: damian }
{ item:duran res: 100 bid: 115 buyer: andy }
{ item:duran res: 100 bid: 110 buyer: andy }
KSQL: SELECT * from bidding-stream
where item=’duran duran’
4.
{...}
{...}
{...}
FaaSKafka cluster
stream
processing
Kafka Streams
KSQL
Producer/Consumer
SOMETHING
HAPPENED!
BEING EVENT-FIRST CHANGES HOW YOU
THINK ABOUT WHAT YOU ARE BUILDING
...more importantly...
1. Any (data) application can be a data flow
2. A series of events and reacting to those events
3. Kafka then becomes a database
● User signup
● Item bid
● Item sold
● Notify user
Neil bid: 100
Michael bid: 200
Ben bid: 200
>> SOLD!
store all events
replay all events
transactional
etc
Databases Databases
Customer
Data Updates
Unified 360
Merged Customer
Profiles
“Who bought what”
Events
Shoulders of Streaming Giants
subscribe(), poll(), send(),
flush(), beginTransaction(), …
KStream, KTable, filter(),
map(), flatMap(), join(),
aggregate(), transform(), …
CREATE STREAM, CREATE TABLE,
SELECT, JOIN, GROUP BY, SUM, …
KSQL UDFs
Ease of Use
Flexibility
Stream
processor
STREAM
/user-reg
FILTER
SELECT users > 18
PROJECT
SELECT user.name
JOIN
SELECT u.name, a.country
from user-reg u JOIN
address a WHERE u.id = a.id
GROUP BY (TABLE)
SELECT u.country,
count(u.name) FROM user-reg u
GROUP BY u.country
WINDOW (TABLE)
SELECT u.country, count(u.name)
FROM user-reg u WINDOW TUMBLING
(SIZE 1 MIN) group by u.country
STREAM
/address
5.
/bidding-history
{ item:duran res: 100 bid: 125 buyer: michael }
{ item:duran res: 100 bid: 120 buyer: nick }
{ item:duran res: 100 bid: 121 buyer: damian }
{ item:duran res: 100 bid: 115 buyer: andy }
{ item:duran res: 100 bid: 110 buyer: andy }
KSQL: SELECT * from
bidding-stream where
item=’duran duran’
6.
Auction items
3.
KSQL Table
Table
Bidding Status
stream-table
join
4.
Table
Kafka Streams - KTable
Kafka Topic
/bids (stream)
2.
Kafka Topic
/items (stream)
1.
SELECT u.country, count(u.name) FROM user-reg u
WINDOW TUMBLING (SIZE 1 MIN) GROUP BY u.country
KStream<String, String> userBids = builder.stream("stream-user-bids");
final KTable<String, Long> bidCount = userBids
.flatMapValues(value ->
Arrays.asList(pattern.split(value.toLowerCase()))
)
.groupBy((user, count) -> user)
.count();
bidCounts.toStream().to("streams-bid-count-output",
Produced.with(stringSerde, longSerde));
Model events not commands,
-> streams of events,
-> series of streams to model the domain
{
item-id: 389*
user: 100
type: bid
cat: bikes/mtb
region: dc-east
}
/bikes/mtb by item-id*
/bikes/ by dc-east‘-’item-id*
-
-
-
-
-
-
-
{
user: 100
type: bid
item: 389
cat: bikes/mtb
region: dc-east
}
/bikes/mtb by item-id
key#
partition
topic
key space
Low level analytics
counter
Producer/Consumer
Item Summary
Kafka Streams
User Activity
KSQL
/stream-1
/stream-2
join
Stream
processor
1. Ops:
2. Stream-based:
3. Data-based:
→
the log, event sourcing, source of truth,
CQRS, event collaboration, replayability,
at-least once, exactly one, evolutionary
architectures, data-virtualization and
more
{...}
●
●
●
●
● {...}
1.
stateless
2. Non-stream non-time
3. Analytics
4. Edge
5. incoming
outgoing
{...}
●
●
●
●
●
{...}
{...}
{...}
{...}
the log the log
Event sourcing:
How did we get here?
{...}
{...}
{...}
{...}
bad stream
- Enrich users on signup (address validation)
- Geo-enrich items on placement (city, state, lat-lon cell identification)
- Notify users on item sold or reserve not met
- Perform analytics on auction when item ‘completes’
- Notify user of items-of-interest from their history when browsing
- Ad-placement analytics (watched items, interested items, users-purchased
- Monte-carlo auction simulations to guide users and calc item trending scores
● Search
● Bid
● Item-Complete
● Marketplace analytics
Auction items
Items being placed
1.
Bids against item ‘duran duran’
stream-table
join against ‘duran duran’
2.
Item ‘duran duran’
3.
/bidding-stream
{ item:duran res: 100 bid: 125 buyer: michael }
{ item:duran res: 100 bid: 120 buyer: nick }
{ item:duran res: 100 bid: 121 buyer: damian }
{ item:duran res: 100 bid: 115 buyer: andy }
{ item:duran res: 100 bid: 110 buyer: andy }
KSQL: SELECT * from bidding-stream
where item=’duran duran’
4.
4. KStream: Interactive query
3. Table: Materialized view
topic: /auction/records/80sSearch: Identify set of topics
1.
2. Locate KTables
1. Stream processor runs ‘future’ on
local-state of item-bids
auction items
3. Rejoined
removes item
4. Stream triggers FaaS
complete item processor
bid-history
Stream table join
5. FaaS Notify all bidders
bid-notifications
2.
Rewrite ‘completed’ item status
to retrigger join
item status
● How is the item trending? Banding on condition (new, as-new, used)
● What’s the usual bid-offer spread?
● Frequency of sale?
● Percentiles?
{...}
{...}
{...}
{ bid:100; sold:1000;}
/bid-history
{
stream-lib.TDigest(values[])
}
{
stream-lib.TDigest(values[])
}
{
stream-lib.TDigest(values[])
}
Calculating percentiles using the ‘unit-of-work’ pattern
{
digest.merge(digest)
}
{...}
/auction/items
{...}
{ item:100;}
Stream
processor
1. Items
{ bid:100;}
{...} Stream
processor
/auction/bids
2. Bidding
{...}
notify bidders & seller
{ item:100; offer:101}
/auction/bids/history
{...}
analytics for bidders
3. Processing
● Event-First
● Streams →
→
● App Infra
● FaaS
Event-first forces you to think about behaviour of the system
Event sourcing captures that behaviour
● Stream processing:
● Streaming platform:
● Closer affinity:
● FaaS
Serverless and stream processing
Building Ebay using Serverless and stream processing - Big Data London November 2018

Weitere ähnliche Inhalte

Kürzlich hochgeladen

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 

Kürzlich hochgeladen (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 

Empfohlen

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Empfohlen (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Building Ebay using Serverless and stream processing - Big Data London November 2018

  • 2. - Building the auction platform - Event driven architectures on Kafka - FaaS for streaming - Putting it in action
  • 3.
  • 6. Auction items Items being placed 1. Bids against item ‘duran duran’ stream-table join against ‘duran duran’ 2. Item ‘duran duran’ 3. CDC Stream { item:duran res: 100 bid: 125 buyer: michael } { item:duran res: 100 bid: 120 buyer: nick } { item:duran res: 100 bid: 121 buyer: damian } { item:duran res: 100 bid: 115 buyer: andy } { item:duran res: 100 bid: 110 buyer: andy } KSQL: SELECT * from bidding-stream where item=’duran duran’ 4.
  • 8.
  • 9.
  • 11.
  • 12. BEING EVENT-FIRST CHANGES HOW YOU THINK ABOUT WHAT YOU ARE BUILDING ...more importantly...
  • 13. 1. Any (data) application can be a data flow 2. A series of events and reacting to those events 3. Kafka then becomes a database ● User signup ● Item bid ● Item sold ● Notify user Neil bid: 100 Michael bid: 200 Ben bid: 200 >> SOLD! store all events replay all events transactional etc
  • 14. Databases Databases Customer Data Updates Unified 360 Merged Customer Profiles “Who bought what” Events
  • 15. Shoulders of Streaming Giants subscribe(), poll(), send(), flush(), beginTransaction(), … KStream, KTable, filter(), map(), flatMap(), join(), aggregate(), transform(), … CREATE STREAM, CREATE TABLE, SELECT, JOIN, GROUP BY, SUM, … KSQL UDFs Ease of Use Flexibility
  • 16. Stream processor STREAM /user-reg FILTER SELECT users > 18 PROJECT SELECT user.name JOIN SELECT u.name, a.country from user-reg u JOIN address a WHERE u.id = a.id GROUP BY (TABLE) SELECT u.country, count(u.name) FROM user-reg u GROUP BY u.country WINDOW (TABLE) SELECT u.country, count(u.name) FROM user-reg u WINDOW TUMBLING (SIZE 1 MIN) group by u.country STREAM /address
  • 17. 5. /bidding-history { item:duran res: 100 bid: 125 buyer: michael } { item:duran res: 100 bid: 120 buyer: nick } { item:duran res: 100 bid: 121 buyer: damian } { item:duran res: 100 bid: 115 buyer: andy } { item:duran res: 100 bid: 110 buyer: andy } KSQL: SELECT * from bidding-stream where item=’duran duran’ 6. Auction items 3. KSQL Table Table Bidding Status stream-table join 4. Table Kafka Streams - KTable Kafka Topic /bids (stream) 2. Kafka Topic /items (stream) 1.
  • 18. SELECT u.country, count(u.name) FROM user-reg u WINDOW TUMBLING (SIZE 1 MIN) GROUP BY u.country
  • 19. KStream<String, String> userBids = builder.stream("stream-user-bids"); final KTable<String, Long> bidCount = userBids .flatMapValues(value -> Arrays.asList(pattern.split(value.toLowerCase())) ) .groupBy((user, count) -> user) .count(); bidCounts.toStream().to("streams-bid-count-output", Produced.with(stringSerde, longSerde));
  • 20. Model events not commands, -> streams of events, -> series of streams to model the domain { item-id: 389* user: 100 type: bid cat: bikes/mtb region: dc-east } /bikes/mtb by item-id* /bikes/ by dc-east‘-’item-id* - - - - - - -
  • 21. { user: 100 type: bid item: 389 cat: bikes/mtb region: dc-east } /bikes/mtb by item-id key# partition topic key space Low level analytics counter Producer/Consumer Item Summary Kafka Streams User Activity KSQL
  • 23. 1. Ops: 2. Stream-based: 3. Data-based: →
  • 24. the log, event sourcing, source of truth, CQRS, event collaboration, replayability, at-least once, exactly one, evolutionary architectures, data-virtualization and more
  • 25. {...}
  • 27. 1. stateless 2. Non-stream non-time 3. Analytics 4. Edge 5. incoming outgoing {...}
  • 29. {...} {...} {...} the log the log Event sourcing: How did we get here?
  • 31. - Enrich users on signup (address validation) - Geo-enrich items on placement (city, state, lat-lon cell identification) - Notify users on item sold or reserve not met - Perform analytics on auction when item ‘completes’ - Notify user of items-of-interest from their history when browsing - Ad-placement analytics (watched items, interested items, users-purchased - Monte-carlo auction simulations to guide users and calc item trending scores
  • 32.
  • 33.
  • 34. ● Search ● Bid ● Item-Complete ● Marketplace analytics
  • 35. Auction items Items being placed 1. Bids against item ‘duran duran’ stream-table join against ‘duran duran’ 2. Item ‘duran duran’ 3. /bidding-stream { item:duran res: 100 bid: 125 buyer: michael } { item:duran res: 100 bid: 120 buyer: nick } { item:duran res: 100 bid: 121 buyer: damian } { item:duran res: 100 bid: 115 buyer: andy } { item:duran res: 100 bid: 110 buyer: andy } KSQL: SELECT * from bidding-stream where item=’duran duran’ 4.
  • 36. 4. KStream: Interactive query 3. Table: Materialized view topic: /auction/records/80sSearch: Identify set of topics 1. 2. Locate KTables
  • 37. 1. Stream processor runs ‘future’ on local-state of item-bids auction items 3. Rejoined removes item 4. Stream triggers FaaS complete item processor bid-history Stream table join 5. FaaS Notify all bidders bid-notifications 2. Rewrite ‘completed’ item status to retrigger join item status
  • 38. ● How is the item trending? Banding on condition (new, as-new, used) ● What’s the usual bid-offer spread? ● Frequency of sale? ● Percentiles? {...} {...} {...} { bid:100; sold:1000;} /bid-history { stream-lib.TDigest(values[]) } { stream-lib.TDigest(values[]) } { stream-lib.TDigest(values[]) } Calculating percentiles using the ‘unit-of-work’ pattern { digest.merge(digest) } {...}
  • 39. /auction/items {...} { item:100;} Stream processor 1. Items { bid:100;} {...} Stream processor /auction/bids 2. Bidding {...} notify bidders & seller { item:100; offer:101} /auction/bids/history {...} analytics for bidders 3. Processing
  • 40.
  • 41. ● Event-First ● Streams → → ● App Infra ● FaaS
  • 42. Event-first forces you to think about behaviour of the system Event sourcing captures that behaviour
  • 43.
  • 44. ● Stream processing: ● Streaming platform: ● Closer affinity: ● FaaS
  • 45. Serverless and stream processing