SlideShare a Scribd company logo
1 of 23
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 BuffersMatt 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 PublisherMohan 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.0Clint Edmonson
 
TestComplete 7.50 New Features
TestComplete 7.50 New FeaturesTestComplete 7.50 New Features
TestComplete 7.50 New FeaturesVlad Kuznetsov
 
TestComplete 7.50 New Features
TestComplete 7.50 New FeaturesTestComplete 7.50 New Features
TestComplete 7.50 New FeaturesVlad 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 MinutesKnowledge 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]
 
Satyapriya rajguru oracle app test
Satyapriya rajguru oracle app testSatyapriya rajguru oracle app test
Satyapriya rajguru oracle app testSatyapriya Rajguru
 
Performance Testing in Oracle Apps
Performance Testing in Oracle AppsPerformance Testing in Oracle Apps
Performance Testing in Oracle AppsBiswajit Pratihari
 
Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthroughmitesh_sharma
 
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
 

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
 
Satyapriya rajguru oracle app test
Satyapriya rajguru oracle app testSatyapriya rajguru oracle app test
Satyapriya rajguru oracle app test
 
Performance Testing in Oracle Apps
Performance Testing in Oracle AppsPerformance Testing in Oracle Apps
Performance Testing in Oracle Apps
 
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

Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhimiss dipika
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 
Elevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New OrleansElevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New Orleanscorenetworkseo
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一Fs
 
NSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationNSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationMarko4394
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predieusebiomeyer
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一Fs
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxDyna Gilbert
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMartaLoveguard
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书rnrncn29
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一Fs
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Excelmac1
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Sonam Pathan
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作ys8omjxb
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Sonam Pathan
 

Recently uploaded (20)

Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 
Elevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New OrleansElevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New Orleans
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
 
NSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationNSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentation
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predi
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptx
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptx
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
 
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
 

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 (-: