SlideShare a Scribd company logo
Middleware Service
for Search, Ads and
Recommender
Yen-Yu Chen
Web Application
Common Design Patterns
FE
BE
Client/Browser
Apache/Nginx
Other Services
Memcached
Redis
DB/MySQL
The Situations
 Business
 Promotions
 Black lists
 Special rules
 Product
 UX changes
 Frequent releases
 Low latency
 A/B test
 Engineering
 Reuse of code modules
 Isolation of modules
 Configuration driven
 Service/Operation
 Live updates/No down
time deployments
 Monitoring
 Less machines
The Situations
 Research/Science
 2nd/3rd Phase ranking
 Feature extraction/calculation
 Apply machine learned models
 Many more A/B tests
 Complicated tracking/loggings
 Replay ability/offline simulation
 Whole page awareness
Container
Middleware Serving Container
FE
BE
Client/Browser
Apache/Nginx
Container
Other Services
Memcached
Redis
DB/MySQL
MIDDLEWARE
The Middleware Serving Container
 Let the WD focus on UX
 An agile software development and deployment
 Provide horizontal capabilities
 Execution model
 Communication mechanisms
 Data marshalling
 Engineers focus on application logic
 Single request parallel execution ability
 A production playground for Research/Science
ArchitectureBoo
st.A
sio
HTTP 1.1
Standard
In/Out
Processor
Processor
Processor
Processor
Processor
Processor
SPDY
Application
Handler
Admin Handler
Clie
nt
Libr
ary
Thre
ad
Pool
Thre
ad
Pool
Search EngineBoo
st.A
sio
HTTP 1.1
XML Formatter
Search HandlerAdmin Handler
Query Parser
Inverted Index
XML Formatter
Spell Check
Query Parser
Inverted Index
Thre
ad
Pool
Thre
ad
Pool
Execution Model
 Processor:
logical unit of
processing
(module)
 Workflow:
directed acyclic
graph stitched
with processors
User Profile
Model B
Model A
Inverted Index
Cache
The Workflow
User Profile
Model B
Model A
Inverted Index
User Profile
Model BModel A
Inverted Index
CacheCache Hit
START
BRANCH
Known User Unknown User
END
END
END
Cache Miss
Control flow vs. U shape
1. Different types of
processors: BRANCH,
FORK, JOIN etc.
2. Hard to describe in
configuration
3. Early exit makes
workflow
complicated
4. Code path might be
complicated
1. One of a kind
processor
2. Configuration is
simple as a chain of
processors
3. Easy to exit early
4. Fixed/Limited code
path: easy for testing
and debugging
5. Natural for cache
layers
6. Keep application logic
together
7. Easily to split into
different containers
User Profile
Model B
Model A
Inverted Index
Cache
The Processor
 All implemented the virtual function “Match”
 Container calls the “Match” function in each
processor along the workflow
 Built as a shared object, dynamically linked library
 Container opens and loads the Processor form a .so
file
(Java: OSGi bundle as a jar file)
 Support live updates
Execution interface
 Result Match(Query query, Execution execution){
// could do something with query
// downward part in the U shape
Result result = execution.match(query);
// could do something with result
// upward part in the U shape
return result;
}
Ads Serving EngineBoo
st.A
sio
HTTP 1.1
Search HandlerAdmin Handler
XML Formatter
User Profile
Query Parser
Inverted Index
Clie
nt
Libr
ary
Thre
ad
Pool
Thre
ad
Pool
Change for Asynchronous Calls
 Match(Query query, Result result, Execution
execution){
// do something
// downward part in the U shape
execution.match(query, result, execution);
}
 Deliver(Query query, Result result, Execution
execution){
// do something
// upward part in the U shape
execution.deliver(query, result, execution);
}
User Profile
Thread pools
 Separate I/O thread and Worker thread into two
different pools
 Asynchronous calls make sense on when there will
be waiting/idling
 For example: calling for out-of-box services
 Keeping a thread busy without switching tasks is
more efficient
Administration &
Operation Interface
 Two virtual functions of the Processor
 Get_status: to show the processor specific status
 Exec_cmd: to execute a specific task inside the
processor
 No down time application deployment
 Update configuration without code change
 Deploy code change from another shared object file
 Visualized Configuration
Production Configuration
Replay & Offline Simulation
 Some people do:
 Have another set of code to simulate
 Some other people do:
 Have another setup identical to production system
 Prepare the log, copy over to simulation clients
 Have multiple clients sending requests and saving
results
 Copy the result back to your research platform
 Configure to use the standard I/O interface
 Utilize the Hadoop streaming to simulate over
hundreds of machines
 Must-have for efficient research
Recommender EngineBoo
st.A
sio
HTTP 1.1
Search HandlerAdmin Handler
User Profile
Model A
Model B
Inverted Index
Clie
nt
Libr
ary
User Profile
Model A
Model B
Redis Adapter
Thre
ad
Pool
Thre
ad
Pool
Ecosystem Client/Browser/App
Frontend
Middleware
Serving
Container
Hadoop
DataHighway
Back Ends
Models
Indexes
RDBMS
Data
Thank You!
Have an A1 day (-:

More Related Content

Similar to Middleware Services for Search, Online Ads and Recommender

Dh2 Apps Training Part2
Dh2   Apps Training Part2Dh2   Apps Training Part2
Dh2 Apps Training Part2jamram82
 
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful  Protocol BuffersJavaOne 2009 - TS-5276 - RESTful  Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
Matt O'Keefe
 
MOSS 2007 Deployment Fundamentals -Part2
MOSS 2007 Deployment Fundamentals -Part2MOSS 2007 Deployment Fundamentals -Part2
MOSS 2007 Deployment Fundamentals -Part2Information Technology
 
Best Implementation Practices with BI Publisher
Best Implementation Practices with BI PublisherBest Implementation Practices with BI Publisher
Best Implementation Practices with BI Publisher
Mohan Dutt
 
Intro to VS 2010 & .Net 4.0
Intro to VS 2010 & .Net 4.0Intro to VS 2010 & .Net 4.0
Intro to VS 2010 & .Net 4.0
Clint Edmonson
 
Datastage details
Datastage detailsDatastage details
Datastage details
Krishna Prasad
 
Kma share point 2010 overview infra and dev technical info
Kma share point 2010 overview infra and dev   technical infoKma share point 2010 overview infra and dev   technical info
Kma share point 2010 overview infra and dev technical info
Knowledge Management Associates, LLC
 
TestComplete 7.50 New Features
TestComplete 7.50 New FeaturesTestComplete 7.50 New Features
TestComplete 7.50 New Features
Vlad Kuznetsov
 
TestComplete 7.50 New Features
TestComplete 7.50 New FeaturesTestComplete 7.50 New Features
TestComplete 7.50 New Features
Vlad Kuznetsov
 
MOSS 2007 Deployment Fundamentals -Part1
MOSS 2007 Deployment Fundamentals -Part1MOSS 2007 Deployment Fundamentals -Part1
MOSS 2007 Deployment Fundamentals -Part1Information Technology
 
SPSPTCDC - SharePoint Admin 101 - SpeedMetal - PowerUser to Admin in 75 Minutes
SPSPTCDC - SharePoint Admin 101 - SpeedMetal - PowerUser to Admin in 75 MinutesSPSPTCDC - SharePoint Admin 101 - SpeedMetal - PowerUser to Admin in 75 Minutes
SPSPTCDC - SharePoint Admin 101 - SpeedMetal - PowerUser to Admin in 75 Minutes
Knowledge Management Associates, LLC
 
TechDays11 Geneva - Going Further with SharePoint 2010 Search
TechDays11 Geneva - Going Further with SharePoint 2010 SearchTechDays11 Geneva - Going Further with SharePoint 2010 Search
TechDays11 Geneva - Going Further with SharePoint 2010 SearchMarius Constantinescu [MVP]
 
Performance Testing in Oracle Apps
Performance Testing in Oracle AppsPerformance Testing in Oracle Apps
Performance Testing in Oracle Apps
Biswajit Pratihari
 
Satyapriya rajguru oracle app test
Satyapriya rajguru oracle app testSatyapriya rajguru oracle app test
Satyapriya rajguru oracle app test
Satyapriya Rajguru
 
Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthrough
mitesh_sharma
 
Sun Web Server Brief
Sun Web Server BriefSun Web Server Brief
Sun Web Server Brief
Murthy Chintalapati
 
Whats New In 2010 (Msdn & Visual Studio)
Whats New In 2010 (Msdn & Visual Studio)Whats New In 2010 (Msdn & Visual Studio)
Whats New In 2010 (Msdn & Visual Studio)
Steve Lange
 
Asp dot net final (2)
Asp dot net   final (2)Asp dot net   final (2)
Asp dot net final (2)
Amelina Ahmeti
 

Similar to Middleware Services for Search, Online Ads and Recommender (20)

Dh2 Apps Training Part2
Dh2   Apps Training Part2Dh2   Apps Training Part2
Dh2 Apps Training Part2
 
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful  Protocol BuffersJavaOne 2009 - TS-5276 - RESTful  Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
 
MOSS 2007 Deployment Fundamentals -Part2
MOSS 2007 Deployment Fundamentals -Part2MOSS 2007 Deployment Fundamentals -Part2
MOSS 2007 Deployment Fundamentals -Part2
 
Best Implementation Practices with BI Publisher
Best Implementation Practices with BI PublisherBest Implementation Practices with BI Publisher
Best Implementation Practices with BI Publisher
 
Intro to VS 2010 & .Net 4.0
Intro to VS 2010 & .Net 4.0Intro to VS 2010 & .Net 4.0
Intro to VS 2010 & .Net 4.0
 
Datastage details
Datastage detailsDatastage details
Datastage details
 
Kma share point 2010 overview infra and dev technical info
Kma share point 2010 overview infra and dev   technical infoKma share point 2010 overview infra and dev   technical info
Kma share point 2010 overview infra and dev technical info
 
TestComplete 7.50 New Features
TestComplete 7.50 New FeaturesTestComplete 7.50 New Features
TestComplete 7.50 New Features
 
TestComplete 7.50 New Features
TestComplete 7.50 New FeaturesTestComplete 7.50 New Features
TestComplete 7.50 New Features
 
MOSS 2007 Deployment Fundamentals -Part1
MOSS 2007 Deployment Fundamentals -Part1MOSS 2007 Deployment Fundamentals -Part1
MOSS 2007 Deployment Fundamentals -Part1
 
SPSPTCDC - SharePoint Admin 101 - SpeedMetal - PowerUser to Admin in 75 Minutes
SPSPTCDC - SharePoint Admin 101 - SpeedMetal - PowerUser to Admin in 75 MinutesSPSPTCDC - SharePoint Admin 101 - SpeedMetal - PowerUser to Admin in 75 Minutes
SPSPTCDC - SharePoint Admin 101 - SpeedMetal - PowerUser to Admin in 75 Minutes
 
TechDays11 Geneva - Going Further with SharePoint 2010 Search
TechDays11 Geneva - Going Further with SharePoint 2010 SearchTechDays11 Geneva - Going Further with SharePoint 2010 Search
TechDays11 Geneva - Going Further with SharePoint 2010 Search
 
Performance Testing in Oracle Apps
Performance Testing in Oracle AppsPerformance Testing in Oracle Apps
Performance Testing in Oracle Apps
 
Satyapriya rajguru oracle app test
Satyapriya rajguru oracle app testSatyapriya rajguru oracle app test
Satyapriya rajguru oracle app test
 
Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthrough
 
Les02
Les02Les02
Les02
 
Sun Web Server Brief
Sun Web Server BriefSun Web Server Brief
Sun Web Server Brief
 
Whats New In 2010 (Msdn & Visual Studio)
Whats New In 2010 (Msdn & Visual Studio)Whats New In 2010 (Msdn & Visual Studio)
Whats New In 2010 (Msdn & Visual Studio)
 
Kscope presentation 2013
Kscope presentation 2013Kscope presentation 2013
Kscope presentation 2013
 
Asp dot net final (2)
Asp dot net   final (2)Asp dot net   final (2)
Asp dot net final (2)
 

Recently uploaded

原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
ufdana
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
GTProductions1
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
laozhuseo02
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
laozhuseo02
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Sanjeev Rampal
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
VivekSinghShekhawat2
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
Javier Lasa
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
natyesu
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
nirahealhty
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
JeyaPerumal1
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
Gal Baras
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
JungkooksNonexistent
 

Recently uploaded (20)

原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
 

Middleware Services for Search, Online Ads and Recommender

  • 1. Middleware Service for Search, Ads and Recommender Yen-Yu Chen
  • 2. Web Application Common Design Patterns FE BE Client/Browser Apache/Nginx Other Services Memcached Redis DB/MySQL
  • 3. The Situations  Business  Promotions  Black lists  Special rules  Product  UX changes  Frequent releases  Low latency  A/B test  Engineering  Reuse of code modules  Isolation of modules  Configuration driven  Service/Operation  Live updates/No down time deployments  Monitoring  Less machines
  • 4. The Situations  Research/Science  2nd/3rd Phase ranking  Feature extraction/calculation  Apply machine learned models  Many more A/B tests  Complicated tracking/loggings  Replay ability/offline simulation  Whole page awareness
  • 6. The Middleware Serving Container  Let the WD focus on UX  An agile software development and deployment  Provide horizontal capabilities  Execution model  Communication mechanisms  Data marshalling  Engineers focus on application logic  Single request parallel execution ability  A production playground for Research/Science
  • 8. Search EngineBoo st.A sio HTTP 1.1 XML Formatter Search HandlerAdmin Handler Query Parser Inverted Index XML Formatter Spell Check Query Parser Inverted Index Thre ad Pool Thre ad Pool
  • 9. Execution Model  Processor: logical unit of processing (module)  Workflow: directed acyclic graph stitched with processors User Profile Model B Model A Inverted Index Cache
  • 10. The Workflow User Profile Model B Model A Inverted Index User Profile Model BModel A Inverted Index CacheCache Hit START BRANCH Known User Unknown User END END END Cache Miss
  • 11. Control flow vs. U shape 1. Different types of processors: BRANCH, FORK, JOIN etc. 2. Hard to describe in configuration 3. Early exit makes workflow complicated 4. Code path might be complicated 1. One of a kind processor 2. Configuration is simple as a chain of processors 3. Easy to exit early 4. Fixed/Limited code path: easy for testing and debugging 5. Natural for cache layers 6. Keep application logic together 7. Easily to split into different containers User Profile Model B Model A Inverted Index Cache
  • 12. The Processor  All implemented the virtual function “Match”  Container calls the “Match” function in each processor along the workflow  Built as a shared object, dynamically linked library  Container opens and loads the Processor form a .so file (Java: OSGi bundle as a jar file)  Support live updates
  • 13. Execution interface  Result Match(Query query, Execution execution){ // could do something with query // downward part in the U shape Result result = execution.match(query); // could do something with result // upward part in the U shape return result; }
  • 14. Ads Serving EngineBoo st.A sio HTTP 1.1 Search HandlerAdmin Handler XML Formatter User Profile Query Parser Inverted Index Clie nt Libr ary Thre ad Pool Thre ad Pool
  • 15. Change for Asynchronous Calls  Match(Query query, Result result, Execution execution){ // do something // downward part in the U shape execution.match(query, result, execution); }  Deliver(Query query, Result result, Execution execution){ // do something // upward part in the U shape execution.deliver(query, result, execution); } User Profile
  • 16. Thread pools  Separate I/O thread and Worker thread into two different pools  Asynchronous calls make sense on when there will be waiting/idling  For example: calling for out-of-box services  Keeping a thread busy without switching tasks is more efficient
  • 17. Administration & Operation Interface  Two virtual functions of the Processor  Get_status: to show the processor specific status  Exec_cmd: to execute a specific task inside the processor  No down time application deployment  Update configuration without code change  Deploy code change from another shared object file  Visualized Configuration
  • 19. Replay & Offline Simulation  Some people do:  Have another set of code to simulate  Some other people do:  Have another setup identical to production system  Prepare the log, copy over to simulation clients  Have multiple clients sending requests and saving results  Copy the result back to your research platform  Configure to use the standard I/O interface  Utilize the Hadoop streaming to simulate over hundreds of machines  Must-have for efficient research
  • 20. Recommender EngineBoo st.A sio HTTP 1.1 Search HandlerAdmin Handler User Profile Model A Model B Inverted Index Clie nt Libr ary User Profile Model A Model B Redis Adapter Thre ad Pool Thre ad Pool
  • 22.
  • 23. Thank You! Have an A1 day (-: