SlideShare a Scribd company logo
Scheduled
delivery of a
large amount
of emails
By trial and error
Author
Roman Valihura
C
O
N
T
E
N
T
1. The mails delivery evolution
2. What our team is doing at Wise
3. Design scheduling architecture
problems
How to fetch emails in time
How to send emails in time
How to split emails between workers
4. Solutions conclusion
We are here
Usagesimplicity
Time
M A I L S D E L I V E R Y E V O L U T I O N
What our
team is
doing at
Wise
We are creating an
ESP (Email
Service Provider) that
provides convenient
Rest API for working
with large newsletters
and collect statistics
about how users
interact with your
emails
U S E C A S E D I A G R A M
R E G U L A R F L O W
I N 3 0 D A Y S
3-party
APP
I N   9 0 D A Y S
According to Wikipedia, a
presentation is the process
of presenting a topic to an
audience. It is typically a
demonstration,
introduction, lecture, or
speech meant to inform,
persuade, or build good will.
ESP API
Send E
mail
HTTP
Request
GrayBox
processing Sendemail to
user
Event
Storage
WE NEED A
scheduling
BETTER
CONTROL
Users can send emails
in advance and
monitor sending
process from their side
LESS LOAD
FOR API
You need to have less
servers and less
throughput if you have
more time
NO PERSONAL
CRON
You don't need
personal CRON for
delivery postponed
emails
U S E C A S E D I A G R A M
S C H E D U L I N G F L O W ( S T A G E 0 )
3-party
APP
I N   9 0 D A Y S
According to Wikipedia, a
presentation is the process
of presenting a topic to an
audience. It is typically a
demonstration,
introduction, lecture, or
speech meant to inform,
persuade, or build good will.
ESP API
Send
E
mail
HTTP
Request
Sendemail to
user
Event
Storage
Scheduling
Storage
S O U R C E : W I S E C H A R A C T E R S D A T A B A S E
M E E T T H E W O R K E R ( V 1 )
Bio
Name
Worker (v1)
Age
4 month
Sex
Male
Responsibility
Make query to data storage with certain interval
Send ready to send emails to target users 
How to find and fetch
emails in time?
S O U R C E : W I S E C H A R A C T E R S D A T A B A S E
M E E T T H E C L I C K H O U S E
Bio
Name
ClickHouse
Age
2 years 4 month
Sex
Undefined
Features
True column-oriented storage
Local and distributed joins
We use ClickHouse for events storage
Metrics (EC2 c5.large)
Read speed is 1.2 GB/s
Write speed is 50 to 200 MB/s 
Finding 335K scheduled emails on a
dataset with size 5M take 0.061 second
With network latency for transfer, we
able to fetch 3.5M emails per second
Summary
U S E C A S E D I A G R A M
S C H E D U L I N G F L O W ( S T A G E 1 )
3-party
APP
I N   9 0 D A Y S
According to Wikipedia, a
presentation is the process
of presenting a topic to an
audience. It is typically a
demonstration,
introduction, lecture, or
speech meant to inform,
persuade, or build good will.
ESP API
Send
E
mail
HTTP
Request
Sendemail to
user
Event
Storage
Clickhouse
S O U R C E : W I S E C H A R A C T E R S D A T A B A S E
N O B O D Y I S P E R F E C T
Bio
Name
Worker (v1)
Age
4 month
Sex
Male
Responsibility
Make query to data storage with certain interval
Send ready to send emails to target users 
Disadvantages
Works slow
How to send emails in
time when we have
limited throughput?
U S E C A S E D I A G R A M
S C H E D U L I N G F L O W ( S T A G E 2 )
3-party
APP
I N   9 0 D A Y S
According to Wikipedia, a
presentation is the process
of presenting a topic to an
audience. It is typically a
demonstration,
introduction, lecture, or
speech meant to inform,
persuade, or build good will.
ESP API
Send
E
mail
HTTP
Request
Sendemail to
user
Event
Storage
Scheduling
Storage
S O U R C E : W I S E C H A R A C T E R S D A T A B A S E
N O B O D Y I S P E R F E C T
Bio
Name
Worker (v1)
Age
4 month
Sex
Regular
Responsibility
Make query to data storage with certain interval
Send ready to send emails to target users 
Disadvantages
Works slow
Not team member
How to split emails
between workers without
duplicates?
S O U R C E : W I S E C H A R A C T E R S D A T A B A S E
M E E T T H E R A N G E R
Bio
Name
Ranger
Age
4 month
Sex
Male
Responsibility
The Ranger is responsible for making a range for
workers. Each range has unique properties that allow
worker decide which records need to fetch from a
database. Ready to send ranges creates internally.
Throughput
Working in pair with a ClickHouse as data storage, this
system is able to create about 700 ranges per second
with size 5000 emails.
U S E C A S E D I A G R A M
T H E R A N G E R F L O W
Scheduling
Storage
(ClickHouse)
Ranger
[2018-10-08T07:47:56.144Z, 3], [2018-10-08T07:47:56.144Z, 4] ...
dateFrom: Date('iso-format')
dateTo: Date('iso-format')
Workers
Messaging
Queue
Send email
to user
dateFrom: Date('iso-format')
dateTo: Date('iso-format')
S O U R C E : W I S E C H A R A C T E R S D A T A B A S E
M E E T T H E W O R K E R ( V 2 )
Bio
Name
Worker (v2)
Age
3 month
Sex
Male
Responsibility
Pull Message Queue with ranges
Fetch emails from ClickHouse by range payload
Send emails to target users
Advantages
Works
Team member
U S E C A S E D I A G R A M
T H E R A N G E R F L O W
Scheduling
Storage
(ClickHouse)
Ranger
[2018-10-08T07:47:56.144Z, 3], [2018-10-08T07:47:56.144Z, 4] ...
dateFrom: Date('iso-format')
dateTo: Date('iso-format')
Workers
Messaging
Queue
Send email
to user
dateFrom: Date('iso-format')
dateTo: Date('iso-format')
U S E C A S E D I A G R A M
S C H E D U L I N G F L O W ( S T A G E 3 )
I N 3 0 D A Y S
3-party
APP
ESP API
Send
E
mail
HTTP
Request
Send
email to
user
Scheduling
Storage
(ClickHouse)
Ranger
Workers
01
02
03
HOW TO FETCH EMAILS IN TIME?
We selected proper storage for that case.
With ĐĄlickhouse, we can fetch 335K
records per second and filtering by ready
date take 0.1 seconds for 5M database set
(including network latency)
HOW SEND EMAILS IN TIME?
Obviously, we need a scaling for that case.
Using multiple workers we can reach such
throughput that we need.
HOW TO SPLIT EMAILS FOR WORKERS?
We created one more additional
component that doing ranges for our
workers and put them into a queue. Then
each worker fetches different range from
a queue.
Time
questions
for

More Related Content

Similar to Scheduled delivery of a large amount of emails

Email
EmailEmail
Email
Roy Thomas
 
Web 2.0: Making Email a Useful Web App
Web 2.0: Making Email a Useful Web AppWeb 2.0: Making Email a Useful Web App
Web 2.0: Making Email a Useful Web App
Andy Denmark
 
Building Email Apps
Building Email AppsBuilding Email Apps
Building Email Apps
Andy Denmark
 
Using Email to Send Push Notifications with Parse & Mailgun
Using Email to Send Push Notifications with Parse & MailgunUsing Email to Send Push Notifications with Parse & Mailgun
Using Email to Send Push Notifications with Parse & Mailgun
ParseIt
 
I C T for JHS 3
I C T for JHS 3I C T for JHS 3
I C T for JHS 3
Abacheng Ghadafi
 
S N A I L Final Presentation
S N A I L    Final  PresentationS N A I L    Final  Presentation
S N A I L Final PresentationQiong Wu
 
8 Ways To Improve Email Performance During End-of-Year.pdf
8 Ways To Improve Email Performance During End-of-Year.pdf8 Ways To Improve Email Performance During End-of-Year.pdf
8 Ways To Improve Email Performance During End-of-Year.pdf
Bloomerang
 
Top Essay Writing Websites
Top Essay Writing WebsitesTop Essay Writing Websites
Top Essay Writing Websites
Beth Hernandez
 
Sales Email Hacks for Gmail and Salesforce
Sales Email Hacks for Gmail and SalesforceSales Email Hacks for Gmail and Salesforce
Sales Email Hacks for Gmail and Salesforce
RingLead
 
Effective communication via email
Effective communication via emailEffective communication via email
Effective communication via email
Marianna Semenova
 
WIA 2019 - Using Embeddings to Understand the Variance and Evolution of Data ...
WIA 2019 - Using Embeddings to Understand the Variance and Evolution of Data ...WIA 2019 - Using Embeddings to Understand the Variance and Evolution of Data ...
WIA 2019 - Using Embeddings to Understand the Variance and Evolution of Data ...
Women in Analytics Conference
 
Email and groupware
Email and groupwareEmail and groupware
Email and groupwareRoy Thomas
 
miniproject.ppt.pptx
miniproject.ppt.pptxminiproject.ppt.pptx
miniproject.ppt.pptx
Anush90
 
Brains R Us Technology
Brains  R  Us  TechnologyBrains  R  Us  Technology
Brains R Us Technology
Mike Danielsen
 
Brains R Us Technology
Brains R Us TechnologyBrains R Us Technology
Brains R Us Technology
Terri Ertlmeier
 
Report on web development
Report on web developmentReport on web development
Report on web development
AJEETKUMAR932614
 
2. DD-sample.docx
2. DD-sample.docx2. DD-sample.docx
2. DD-sample.docx
dpgdpg
 
Nova Spivack - Semantic Web Talk
Nova Spivack - Semantic Web TalkNova Spivack - Semantic Web Talk
Nova Spivack - Semantic Web Talk
syawal
 
How Email Works storyboarad_cartoon
How Email Works storyboarad_cartoonHow Email Works storyboarad_cartoon
How Email Works storyboarad_cartoonLori deRoin
 

Similar to Scheduled delivery of a large amount of emails (20)

Email
EmailEmail
Email
 
Web 2.0: Making Email a Useful Web App
Web 2.0: Making Email a Useful Web AppWeb 2.0: Making Email a Useful Web App
Web 2.0: Making Email a Useful Web App
 
Building Email Apps
Building Email AppsBuilding Email Apps
Building Email Apps
 
Using Email to Send Push Notifications with Parse & Mailgun
Using Email to Send Push Notifications with Parse & MailgunUsing Email to Send Push Notifications with Parse & Mailgun
Using Email to Send Push Notifications with Parse & Mailgun
 
I C T for JHS 3
I C T for JHS 3I C T for JHS 3
I C T for JHS 3
 
S N A I L Final Presentation
S N A I L    Final  PresentationS N A I L    Final  Presentation
S N A I L Final Presentation
 
8 Ways To Improve Email Performance During End-of-Year.pdf
8 Ways To Improve Email Performance During End-of-Year.pdf8 Ways To Improve Email Performance During End-of-Year.pdf
8 Ways To Improve Email Performance During End-of-Year.pdf
 
Pankaj Kh_Updated
Pankaj Kh_UpdatedPankaj Kh_Updated
Pankaj Kh_Updated
 
Top Essay Writing Websites
Top Essay Writing WebsitesTop Essay Writing Websites
Top Essay Writing Websites
 
Sales Email Hacks for Gmail and Salesforce
Sales Email Hacks for Gmail and SalesforceSales Email Hacks for Gmail and Salesforce
Sales Email Hacks for Gmail and Salesforce
 
Effective communication via email
Effective communication via emailEffective communication via email
Effective communication via email
 
WIA 2019 - Using Embeddings to Understand the Variance and Evolution of Data ...
WIA 2019 - Using Embeddings to Understand the Variance and Evolution of Data ...WIA 2019 - Using Embeddings to Understand the Variance and Evolution of Data ...
WIA 2019 - Using Embeddings to Understand the Variance and Evolution of Data ...
 
Email and groupware
Email and groupwareEmail and groupware
Email and groupware
 
miniproject.ppt.pptx
miniproject.ppt.pptxminiproject.ppt.pptx
miniproject.ppt.pptx
 
Brains R Us Technology
Brains  R  Us  TechnologyBrains  R  Us  Technology
Brains R Us Technology
 
Brains R Us Technology
Brains R Us TechnologyBrains R Us Technology
Brains R Us Technology
 
Report on web development
Report on web developmentReport on web development
Report on web development
 
2. DD-sample.docx
2. DD-sample.docx2. DD-sample.docx
2. DD-sample.docx
 
Nova Spivack - Semantic Web Talk
Nova Spivack - Semantic Web TalkNova Spivack - Semantic Web Talk
Nova Spivack - Semantic Web Talk
 
How Email Works storyboarad_cartoon
How Email Works storyboarad_cartoonHow Email Works storyboarad_cartoon
How Email Works storyboarad_cartoon
 

More from Wise Engineering

Releasing Elixir/Phoenix Applications
Releasing Elixir/Phoenix ApplicationsReleasing Elixir/Phoenix Applications
Releasing Elixir/Phoenix Applications
Wise Engineering
 
Transition to Infrastructure as Code
Transition to Infrastructure as CodeTransition to Infrastructure as Code
Transition to Infrastructure as Code
Wise Engineering
 
Local development environment evolution
Local development environment evolutionLocal development environment evolution
Local development environment evolution
Wise Engineering
 
Launch safely with Feature Flags
Launch safely with Feature FlagsLaunch safely with Feature Flags
Launch safely with Feature Flags
Wise Engineering
 
Search query assistance. Autosuggestion
Search query assistance. AutosuggestionSearch query assistance. Autosuggestion
Search query assistance. Autosuggestion
Wise Engineering
 
Build and release iOS apps using Fastlane tools
Build and release iOS apps using Fastlane toolsBuild and release iOS apps using Fastlane tools
Build and release iOS apps using Fastlane tools
Wise Engineering
 

More from Wise Engineering (6)

Releasing Elixir/Phoenix Applications
Releasing Elixir/Phoenix ApplicationsReleasing Elixir/Phoenix Applications
Releasing Elixir/Phoenix Applications
 
Transition to Infrastructure as Code
Transition to Infrastructure as CodeTransition to Infrastructure as Code
Transition to Infrastructure as Code
 
Local development environment evolution
Local development environment evolutionLocal development environment evolution
Local development environment evolution
 
Launch safely with Feature Flags
Launch safely with Feature FlagsLaunch safely with Feature Flags
Launch safely with Feature Flags
 
Search query assistance. Autosuggestion
Search query assistance. AutosuggestionSearch query assistance. Autosuggestion
Search query assistance. Autosuggestion
 
Build and release iOS apps using Fastlane tools
Build and release iOS apps using Fastlane toolsBuild and release iOS apps using Fastlane tools
Build and release iOS apps using Fastlane tools
 

Recently uploaded

Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 

Recently uploaded (20)

Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 

Scheduled delivery of a large amount of emails

  • 1. Scheduled delivery of a large amount of emails By trial and error Author Roman Valihura
  • 2. C O N T E N T 1. The mails delivery evolution 2. What our team is doing at Wise 3. Design scheduling architecture problems How to fetch emails in time How to send emails in time How to split emails between workers 4. Solutions conclusion
  • 3. We are here Usagesimplicity Time M A I L S D E L I V E R Y E V O L U T I O N
  • 4. What our team is doing at Wise We are creating an ESP (Email Service Provider) that provides convenient Rest API for working with large newsletters and collect statistics about how users interact with your emails
  • 5. U S E C A S E D I A G R A M R E G U L A R F L O W I N 3 0 D A Y S 3-party APP I N   9 0 D A Y S According to Wikipedia, a presentation is the process of presenting a topic to an audience. It is typically a demonstration, introduction, lecture, or speech meant to inform, persuade, or build good will. ESP API Send E mail HTTP Request GrayBox processing Sendemail to user Event Storage
  • 6. WE NEED A scheduling BETTER CONTROL Users can send emails in advance and monitor sending process from their side LESS LOAD FOR API You need to have less servers and less throughput if you have more time NO PERSONAL CRON You don't need personal CRON for delivery postponed emails
  • 7. U S E C A S E D I A G R A M S C H E D U L I N G F L O W ( S T A G E 0 ) 3-party APP I N   9 0 D A Y S According to Wikipedia, a presentation is the process of presenting a topic to an audience. It is typically a demonstration, introduction, lecture, or speech meant to inform, persuade, or build good will. ESP API Send E mail HTTP Request Sendemail to user Event Storage Scheduling Storage
  • 8. S O U R C E : W I S E C H A R A C T E R S D A T A B A S E M E E T T H E W O R K E R ( V 1 ) Bio Name Worker (v1) Age 4 month Sex Male Responsibility Make query to data storage with certain interval Send ready to send emails to target users 
  • 9. How to find and fetch emails in time?
  • 10. S O U R C E : W I S E C H A R A C T E R S D A T A B A S E M E E T T H E C L I C K H O U S E Bio Name ClickHouse Age 2 years 4 month Sex Undefined Features True column-oriented storage Local and distributed joins We use ClickHouse for events storage Metrics (EC2 c5.large) Read speed is 1.2 GB/s Write speed is 50 to 200 MB/s  Finding 335K scheduled emails on a dataset with size 5M take 0.061 second With network latency for transfer, we able to fetch 3.5M emails per second Summary
  • 11. U S E C A S E D I A G R A M S C H E D U L I N G F L O W ( S T A G E 1 ) 3-party APP I N   9 0 D A Y S According to Wikipedia, a presentation is the process of presenting a topic to an audience. It is typically a demonstration, introduction, lecture, or speech meant to inform, persuade, or build good will. ESP API Send E mail HTTP Request Sendemail to user Event Storage Clickhouse
  • 12. S O U R C E : W I S E C H A R A C T E R S D A T A B A S E N O B O D Y I S P E R F E C T Bio Name Worker (v1) Age 4 month Sex Male Responsibility Make query to data storage with certain interval Send ready to send emails to target users  Disadvantages Works slow
  • 13. How to send emails in time when we have limited throughput?
  • 14. U S E C A S E D I A G R A M S C H E D U L I N G F L O W ( S T A G E 2 ) 3-party APP I N   9 0 D A Y S According to Wikipedia, a presentation is the process of presenting a topic to an audience. It is typically a demonstration, introduction, lecture, or speech meant to inform, persuade, or build good will. ESP API Send E mail HTTP Request Sendemail to user Event Storage Scheduling Storage
  • 15. S O U R C E : W I S E C H A R A C T E R S D A T A B A S E N O B O D Y I S P E R F E C T Bio Name Worker (v1) Age 4 month Sex Regular Responsibility Make query to data storage with certain interval Send ready to send emails to target users  Disadvantages Works slow Not team member
  • 16. How to split emails between workers without duplicates?
  • 17. S O U R C E : W I S E C H A R A C T E R S D A T A B A S E M E E T T H E R A N G E R Bio Name Ranger Age 4 month Sex Male Responsibility The Ranger is responsible for making a range for workers. Each range has unique properties that allow worker decide which records need to fetch from a database. Ready to send ranges creates internally. Throughput Working in pair with a ClickHouse as data storage, this system is able to create about 700 ranges per second with size 5000 emails.
  • 18. U S E C A S E D I A G R A M T H E R A N G E R F L O W Scheduling Storage (ClickHouse) Ranger [2018-10-08T07:47:56.144Z, 3], [2018-10-08T07:47:56.144Z, 4] ... dateFrom: Date('iso-format') dateTo: Date('iso-format') Workers Messaging Queue Send email to user dateFrom: Date('iso-format') dateTo: Date('iso-format')
  • 19. S O U R C E : W I S E C H A R A C T E R S D A T A B A S E M E E T T H E W O R K E R ( V 2 ) Bio Name Worker (v2) Age 3 month Sex Male Responsibility Pull Message Queue with ranges Fetch emails from ClickHouse by range payload Send emails to target users Advantages Works Team member
  • 20. U S E C A S E D I A G R A M T H E R A N G E R F L O W Scheduling Storage (ClickHouse) Ranger [2018-10-08T07:47:56.144Z, 3], [2018-10-08T07:47:56.144Z, 4] ... dateFrom: Date('iso-format') dateTo: Date('iso-format') Workers Messaging Queue Send email to user dateFrom: Date('iso-format') dateTo: Date('iso-format')
  • 21. U S E C A S E D I A G R A M S C H E D U L I N G F L O W ( S T A G E 3 ) I N 3 0 D A Y S 3-party APP ESP API Send E mail HTTP Request Send email to user Scheduling Storage (ClickHouse) Ranger Workers
  • 22. 01 02 03 HOW TO FETCH EMAILS IN TIME? We selected proper storage for that case. With ĐĄlickhouse, we can fetch 335K records per second and filtering by ready date take 0.1 seconds for 5M database set (including network latency) HOW SEND EMAILS IN TIME? Obviously, we need a scaling for that case. Using multiple workers we can reach such throughput that we need. HOW TO SPLIT EMAILS FOR WORKERS? We created one more additional component that doing ranges for our workers and put them into a queue. Then each worker fetches different range from a queue.