SlideShare a Scribd company logo
1 of 36
Download to read offline
MICROSERVICES ARCHITECTURE
FOR
CONVERSATIONAL INTELLIGENCE PLATFORM_
@Rafael_Casuso
2
A B O U T M E
•CEO @SnowStormIO
•Organizer @BotDevMad
•Software Engineer with +10 years
of experience leading teams and
developing.
•Software Architect looking for
revolutionary ways to change the
world.
•Specialties: JavaScript, NodeJS,
Conversational Intelligences.
CONVERSATIONAL
INTELLIGENCE
PLATFORM
+ BASIC STRUCTURE
WHICH ARE MY FUNCTIONAL REQUIREMENTS?_
‣ A SOFTWARE PLATFORM TO BUILD CHATBOTS ON
‣ MULTIPLE MESSAGING CHANNELS
‣ UNIFIED USER SYSTEM
‣ DATA PERSISTENCE
‣ DIALOG SYSTEM
‣ NATURAL LANGUAGE PROCESSING
‣ MULTI-LANGUAGE SUPPORT
‣ EVENT TRACKING
THE KRAKEN:
MONOLITH
ARCHITECTURE
+ THE PROBLEM
THE DARK TRUTH. A SMALL MONOLITH IS…_
‣ SIMPLE TO DEVELOP
‣ SIMPLE TO DEPLOY
‣ SIMPLE TO SCALE AS A WHOLE
‣ MORE APPROPRIATE FOR A SMALL PLATFORM OR APPLICATION
WHICH ARE THE DANGERS TO AVOID?_
‣ LARGE MONOLITH DIFFICULT TO UNDERSTAND AND MAINTAIN
‣ DEVELOPMENT SLOW DOWN, CODE BASE INTIMIDATION
‣ MODULARITY IS OPTIONAL, NO BOUNDARIES
‣ INFREQUENT, NOT CONTINUOUS DEPLOYMENT
‣ SCALING INDIVIDUAL COMPONENTS IS IMPOSSIBLE
‣ OBSTACLE TO SCALE DEVELOPMENT TEAMS
‣ TECHNOLOGY STACK LOCK-IN
HOW DOES IT LOOK LIKE?_
T
I
E
R
MESSAGING ADAPTER
USER SYSTEM DIALOG SYSTEM
CORE
ADMIN MULTILANGUAGE
CMS
PUBLIC API
DATABASE
INTEGRATION
INTEGRATION
INTEGRATIONTRACKING SYSTEM
CACHE OTHER SERVICES
DATA ACCESS LAYER
THE WHALES:
SPLITTED
ARCHITECTURE
+ THE EVOLUTION
BENEFITS & DRAWBACKS_
‣ MEDIUM SIZE TIERS EASIER TO LEARN AND MAINTAIN
‣ BETTER DEVELOPMENT SCALING
‣ MORE DEPLOYMENT AND SCALING INDEPENDENCE
‣ STILL MANY COMPONENTS IN THE SAME TIER
‣ MORE COMPLEX DEPLOYMENT
‣ TESTING IS MORE DIFFICULT
‣ NETWORK SLOWS DOWN SYSTEM INTERACTIONS
HOW DOES IT LOOK LIKE?_
T
I
E
R
MESSAGING ADAPTER
DIALOG SYSTEM
INTEGRATION
PUBLIC API
ADMIN
CMS
T
I
E
R
T
I
E
R
T
I
E
R
INTEGRATION
INTEGRATION
MESSAGING ADAPTER
POST-NLP
USER SYSTEM MULTILANGUAGE
MESSAGES
A
P
I
DATABASEOTHER SERVICES AI SERVICES
TRACKING SYSTEM
BUSINESS INTEL
THE DOLPHINS:
MICROSERVICES
ARCHITECTURE
+ THE SOLUTION
BENEFITS_
‣ EACH COMPONENT CAN BE A RELATIVELY SMALL MICROSERVICE
‣ COMPONENT INDEPENDENT DEPLOY
‣ EASIER TO SCALE DEVELOPMENT
‣ IMPROVED FAULT ISOLATION
‣ TECHNOLOGY STACK FREEDOM
‣ MODULARITY IS INHERENT TO THE ARCHITECTURE
DRAWBACKS_
‣ HIGH DEPLOYMENT COMPLEXITY
‣ HIGH INFRASTRUCTURE NEEDS
‣ INTER-COMMUNICATION MECANISM NEEDED
‣ IDES ARE NOT BUILT FOR MICROSERVICES
‣ NETWORK SLOWS DOWN SYSTEM INTERACTIONS
‣ INTEGRATION TESTING IS MORE DIFFICULT
DESIGN_
‣ WHICH IS MY STARTING POINT?
‣ IDEALLY MODULAR COMPONENTS
‣ IDENTIFY BOUNDED CONTEXTS
‣ DOES IT NEED DATA PERSISTANCE?
‣ WHICH ARE ITS DEPENDENCIES:
‣ OTHER MICROSERVICES (PROTECTION/COMMUNICATION/MONITORING)
‣ EXTERNAL SERVICES (PROTECTION)
‣ DEFINE PHASES
‣ BREAK THE CORE
‣ DECREASING COMPONENTS SIZE
BOUNDED CONTEXTS AND OPERATIONS_
‣ OPERATIONS ARE BASIC COMMANDS WITHIN A BOUNDED CONTEXT
‣ BOTS: Create, Get, Modify, Delete
‣ USERS: Create, Get, Modify, Delete, Login, External login, etc
‣ MESSAGES: Create, Get, Delete
‣ SEARCH: Search services, search categories, search detail, etc
‣ BOOKINGS: Create, Get detail, Get list, Modify, Delete
‣ NOTIFICATIONS: Push, schedule
‣ STATISTICS: Create, Get, Delete
‣ RECOMMENDED IMPLEMENTATION: OOP, Classes
DIALOG SYSTEM, INTENTS AND ACTIONS_
‣ DIALOG SYSTEM IS THE MOST IMPORTANT COMPONENT
‣ IT USES BOUNDED CONTEXTS
‣ INTENTS: ENTITIES PARSED FROM USER’S MESSAGE FOR A NLP SERVICE
‣ ACTIONS: CROSS-COMPONENT’S VERBS TRIGGERED BY MESSAGES OR FLOW
ELECTIONS WITHIN A CONVERSATION
‣ INTENTS CAN MATCH ACTIONS WITH 1-TO-1, N-TO-1 AND EVEN N-TO-N
RELATIONS, WHERE MULTIPLE INTENTS COMBINATION IS CHALLENGE
‣ RECOMMENDED IMPLEMENTATION: FP, Functions
TESTING, LOGGING AND MONITORING_
‣ UNIT TESTING
‣ FINE-GRAINED LOGGING
‣ MICROSECS TIME TRACKING
‣ UPSTREAM TRACKING
‣ DOWNSTREAM TRACKING
‣ MONITORING
‣ HEALTH CHECKING
‣ SCALING
‣ GUI ADMIN
NODEJS
MICROSERVICES
WITH SENECA
+ THE IMPLEMENTATION
WHAT IS SENECA?_
‣ IT IS A NODEJS TOOLKIT TO DEVELOP MICROSERVICES SYSTEMS
‣ IT OFFERS THREE CORE FEATURES:
‣ PATTERN MATCHING
‣ UNIQUE PATTERNS
‣ TRANSPORT INDEPENDENCE
‣ HTTP, TCP, AMQP, REDIS, etc
‣ COMPONENTIZATION
PATTERN MATCHING_
‣ CAN BE USED WITHOUT SERVICE DISCOVERY (CONSUL, ZOOKEEPER, ETC)
‣ IT IS BASED ON ASYNCHRONOUS MESSAGING OF JSON OBJECTS
‣ ACTIONS ARE DEFINED BY A PATTERN AND A CALLBACK:
‣ PATTERN like ‘role:math,cmd:sum’
‣ CALLBACK gets message and executes a reply
PATTERN MATCHING_
‣ EXECUTIONS SEND A MESSAGE AND RECEIVE A RESPONSE
seneca.act({role: 'math', cmd: 'sum', left: 1, right: 2}, function (err,
result) {
if (err) return console.error(err)
‣ MORE SPECIFIC PATTERN PREVAILS
‣ ACTIONS CAN EXECUTE ANOTHER ACTION FOR CODE RE-USE
‣ ACTIONS CAN BE ENHANCED BY OVERRIDE
PLUGINS_
‣ FUNCTION THAT CONTAINS A SET OF RELATED ACTIONS
‣ IT HAS AN INIT FUNCTION THAT IS CALLED SYNCHRONOUSLY
‣ EACH PLUGIN IS DEFINED IN A MODULE
‣ PLUGINS ARE TRANSPORT-AGNOSTIC
‣ YOU LOAD A PLUGIN WITH .USE
PLUGIN EXAMPLE_
MICROSERVICES_
‣ YOU RUN A MICROSERVICE IN ITS OWN PROCESS WITH .LISTEN
‣ YOU DEFINE:
‣ ITS MESSAGING TRANSPORT (HTTP - HOST, PORT… -, TCP, ETC)
‣ ITS SPECIFIC PATTERN MATCHING FOR PATTERNS (PIN)
‣ YOU INVOKE A MICROSERVICE WITH .CLIENT
‣ ALL EXECUTIONS MATCHING ITS PIN WILL BE EXECUTED REMOTELY
MICROSERVICE EXAMPLE_
LISTENER CLIENT
EXPOSING MICROSERVICES THROUGH WEB SERVER_
‣ YOU USE AN ADAPTER, FOR EXAMPLE, FOR EXPRESS
‣ IN THE PLUGIN INIT YOU DEFINE ROUTES WITH:
‣ PREFIX, like “/API”
‣ PIN, like ‘role:api,path:*’ (you only expose that matching actions)
‣ MAP, list of paths, like “calculate: { GET:true, suffix:'/:operation' }”
‣ MATCHING ACTION CAN EXECUTE OTHER INTERNAL ACTIONS
‣ FINAL ENDPOINT EXAMPLE “/api/calculate/:operation"
MICROSERVICES WEB SERVER EXAMPLE_
MICROSERVICES WEB SERVER EXAMPLE_
/api/calculate/:operation
DATA STORAGE_
‣ YOU CAN USE ANY PERSISTENCE YOU LIKE
‣ BUT YOU CAN DECIDE LATER
‣ USE PATTERN MATCHING AS ORM WITH SENECA-ENTITY:
‣ LOAD: load an entity by identifier
‣ SAVE: create or update (if you provide an identifier) an entity
‣ LIST: list entities matching a simple query
‣ REMOVE: delete an entity by identifier
‣ FINALLY USE A PLUGIN TO IMPLEMENT THIS ACTIONS
GENERAL TIPS_
‣ ONLY IF YOU MASTER THE DOMAIN
‣ DON’T MIGRATE A MONOLITH TO MICROSERVICES AT ONCE
‣ EACH PARTITION IS A BUSINESS CAPABILITY
‣ AUTONOMY OVER COORDINATION, MINIMIZE DEPENDENCIES
‣ NOT SUITABLE FOR SMALL APPLICATIONS OR PLATFORMS
‣ BE READY TO DEAL WITH INFRASTRUCTURE COMPLEXITY
THANK YOU

More Related Content

Viewers also liked

Principles of microservices velocity
Principles of microservices   velocityPrinciples of microservices   velocity
Principles of microservices velocity
Sam Newman
 

Viewers also liked (20)

Building a Bank out of Microservices (NDC Sydney, August 2016)
Building a Bank out of Microservices (NDC Sydney, August 2016)Building a Bank out of Microservices (NDC Sydney, August 2016)
Building a Bank out of Microservices (NDC Sydney, August 2016)
 
World of Services: Software Architecture That is Eating the World
World of Services: Software Architecture That is Eating the WorldWorld of Services: Software Architecture That is Eating the World
World of Services: Software Architecture That is Eating the World
 
Microservices: Architecture to scale Agile
Microservices: Architecture to scale AgileMicroservices: Architecture to scale Agile
Microservices: Architecture to scale Agile
 
Microservices: Architecture for the Real-time Organization
Microservices: Architecture for the Real-time OrganizationMicroservices: Architecture for the Real-time Organization
Microservices: Architecture for the Real-time Organization
 
Microservices: Architecture for Agile Software Development
Microservices: Architecture for Agile Software DevelopmentMicroservices: Architecture for Agile Software Development
Microservices: Architecture for Agile Software Development
 
Vert.x for Microservices Architecture
Vert.x for Microservices ArchitectureVert.x for Microservices Architecture
Vert.x for Microservices Architecture
 
Scalable Microservices at Netflix. Challenges and Tools of the Trade
Scalable Microservices at Netflix. Challenges and Tools of the TradeScalable Microservices at Netflix. Challenges and Tools of the Trade
Scalable Microservices at Netflix. Challenges and Tools of the Trade
 
Containers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioContainers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific Trio
 
MicroService Architecture
MicroService ArchitectureMicroService Architecture
MicroService Architecture
 
Microservices Workshop All Topics Deck 2016
Microservices Workshop All Topics Deck 2016Microservices Workshop All Topics Deck 2016
Microservices Workshop All Topics Deck 2016
 
Principles of microservices velocity
Principles of microservices   velocityPrinciples of microservices   velocity
Principles of microservices velocity
 
Down-to-Earth Microservices with Java EE
Down-to-Earth Microservices with Java EEDown-to-Earth Microservices with Java EE
Down-to-Earth Microservices with Java EE
 
Bots: ¿Profetas de una nueva era?
Bots: ¿Profetas de una nueva era?Bots: ¿Profetas de una nueva era?
Bots: ¿Profetas de una nueva era?
 
Microservices Architecture (MSA) - Presentation made at AEA-MN quarterly even...
Microservices Architecture (MSA) - Presentation made at AEA-MN quarterly even...Microservices Architecture (MSA) - Presentation made at AEA-MN quarterly even...
Microservices Architecture (MSA) - Presentation made at AEA-MN quarterly even...
 
RabbitMQ 101 : job scheduling, micro service communication, event based data...
 RabbitMQ 101 : job scheduling, micro service communication, event based data... RabbitMQ 101 : job scheduling, micro service communication, event based data...
RabbitMQ 101 : job scheduling, micro service communication, event based data...
 
Service Oriented Architecture 10 0
Service Oriented Architecture 10 0Service Oriented Architecture 10 0
Service Oriented Architecture 10 0
 
Nanoservices and Microservices with Java
Nanoservices and Microservices with JavaNanoservices and Microservices with Java
Nanoservices and Microservices with Java
 
Micro Services Architecture
Micro Services ArchitectureMicro Services Architecture
Micro Services Architecture
 
How Small Can Java Microservices Be?
How Small Can Java Microservices Be?How Small Can Java Microservices Be?
How Small Can Java Microservices Be?
 
Micro Services - Smaller is Better?
Micro Services - Smaller is Better?Micro Services - Smaller is Better?
Micro Services - Smaller is Better?
 

Similar to Microservices Architecture For Conversational Intelligence Platform

Making the Most of Customer Data
Making the Most of Customer DataMaking the Most of Customer Data
Making the Most of Customer Data
WSO2
 

Similar to Microservices Architecture For Conversational Intelligence Platform (20)

The Voice Interface Revolution
The Voice Interface RevolutionThe Voice Interface Revolution
The Voice Interface Revolution
 
Making the Most of Customer Data
Making the Most of Customer DataMaking the Most of Customer Data
Making the Most of Customer Data
 
(Micro?)services architecture in practice
(Micro?)services architecture in practice(Micro?)services architecture in practice
(Micro?)services architecture in practice
 
Open stack gbp final sn-4-slideshare
Open stack gbp final sn-4-slideshareOpen stack gbp final sn-4-slideshare
Open stack gbp final sn-4-slideshare
 
Straight Talk on Machine Learning -- What the Marketing Department Doesn’t Wa...
Straight Talk on Machine Learning -- What the Marketing Department Doesn’t Wa...Straight Talk on Machine Learning -- What the Marketing Department Doesn’t Wa...
Straight Talk on Machine Learning -- What the Marketing Department Doesn’t Wa...
 
Lambda Architectures in Practice
Lambda Architectures in PracticeLambda Architectures in Practice
Lambda Architectures in Practice
 
Tweak Geeks #FOS15
Tweak Geeks #FOS15Tweak Geeks #FOS15
Tweak Geeks #FOS15
 
Transforming to OpenStack: a sample roadmap to DevOps
Transforming to OpenStack: a sample roadmap to DevOpsTransforming to OpenStack: a sample roadmap to DevOps
Transforming to OpenStack: a sample roadmap to DevOps
 
DevOps LA Meetup Intro to Habitat
DevOps LA Meetup Intro to HabitatDevOps LA Meetup Intro to Habitat
DevOps LA Meetup Intro to Habitat
 
Developer Experience at Zalando - Handelsblatt Strategisches IT-Management 2019
Developer Experience at Zalando - Handelsblatt Strategisches IT-Management 2019Developer Experience at Zalando - Handelsblatt Strategisches IT-Management 2019
Developer Experience at Zalando - Handelsblatt Strategisches IT-Management 2019
 
21st Docker Switzerland Meetup - ISTIO
21st Docker Switzerland Meetup - ISTIO21st Docker Switzerland Meetup - ISTIO
21st Docker Switzerland Meetup - ISTIO
 
Coral id-python
Coral id-pythonCoral id-python
Coral id-python
 
mozzle: Monitoring your Cloud Foundry application
mozzle: Monitoring your Cloud Foundry applicationmozzle: Monitoring your Cloud Foundry application
mozzle: Monitoring your Cloud Foundry application
 
Gab2017 - Logic Apps, the power of new integration
Gab2017  - Logic Apps, the power of new integrationGab2017  - Logic Apps, the power of new integration
Gab2017 - Logic Apps, the power of new integration
 
Logic Apps, the power of new integration
Logic Apps, the power of new integrationLogic Apps, the power of new integration
Logic Apps, the power of new integration
 
Angular Offline Progressive Web Apps With NodeJS
Angular Offline Progressive Web Apps With NodeJSAngular Offline Progressive Web Apps With NodeJS
Angular Offline Progressive Web Apps With NodeJS
 
Cloudify your applications: microservices and beyond
Cloudify your applications: microservices and beyondCloudify your applications: microservices and beyond
Cloudify your applications: microservices and beyond
 
Flipping the script
Flipping the scriptFlipping the script
Flipping the script
 
DevOps Evolutions - Mike Bushong
DevOps Evolutions - Mike BushongDevOps Evolutions - Mike Bushong
DevOps Evolutions - Mike Bushong
 
Paris FOD meetup - koordinator
Paris FOD meetup - koordinatorParis FOD meetup - koordinator
Paris FOD meetup - koordinator
 

More from Rafael Casuso Romate

More from Rafael Casuso Romate (6)

Rise and Fall of the Frontend Developer
Rise and Fall of the Frontend DeveloperRise and Fall of the Frontend Developer
Rise and Fall of the Frontend Developer
 
Nuxt Avanzado (de Scaffolding a MVP)
Nuxt Avanzado (de Scaffolding a MVP)Nuxt Avanzado (de Scaffolding a MVP)
Nuxt Avanzado (de Scaffolding a MVP)
 
The Core of Agile
The Core of AgileThe Core of Agile
The Core of Agile
 
Solid NodeJS with TypeScript, Jest & NestJS
Solid NodeJS with TypeScript, Jest & NestJSSolid NodeJS with TypeScript, Jest & NestJS
Solid NodeJS with TypeScript, Jest & NestJS
 
Google Assistant Revolution
Google Assistant RevolutionGoogle Assistant Revolution
Google Assistant Revolution
 
JavaScript Editions ES7, ES8 and ES9 vs V8
JavaScript Editions ES7, ES8 and ES9 vs V8JavaScript Editions ES7, ES8 and ES9 vs V8
JavaScript Editions ES7, ES8 and ES9 vs V8
 

Recently uploaded

Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Recently uploaded (20)

Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 

Microservices Architecture For Conversational Intelligence Platform

  • 2. @Rafael_Casuso 2 A B O U T M E •CEO @SnowStormIO •Organizer @BotDevMad •Software Engineer with +10 years of experience leading teams and developing. •Software Architect looking for revolutionary ways to change the world. •Specialties: JavaScript, NodeJS, Conversational Intelligences.
  • 4. WHICH ARE MY FUNCTIONAL REQUIREMENTS?_ ‣ A SOFTWARE PLATFORM TO BUILD CHATBOTS ON ‣ MULTIPLE MESSAGING CHANNELS ‣ UNIFIED USER SYSTEM ‣ DATA PERSISTENCE ‣ DIALOG SYSTEM ‣ NATURAL LANGUAGE PROCESSING ‣ MULTI-LANGUAGE SUPPORT ‣ EVENT TRACKING
  • 6. THE DARK TRUTH. A SMALL MONOLITH IS…_ ‣ SIMPLE TO DEVELOP ‣ SIMPLE TO DEPLOY ‣ SIMPLE TO SCALE AS A WHOLE ‣ MORE APPROPRIATE FOR A SMALL PLATFORM OR APPLICATION
  • 7. WHICH ARE THE DANGERS TO AVOID?_ ‣ LARGE MONOLITH DIFFICULT TO UNDERSTAND AND MAINTAIN ‣ DEVELOPMENT SLOW DOWN, CODE BASE INTIMIDATION ‣ MODULARITY IS OPTIONAL, NO BOUNDARIES ‣ INFREQUENT, NOT CONTINUOUS DEPLOYMENT ‣ SCALING INDIVIDUAL COMPONENTS IS IMPOSSIBLE ‣ OBSTACLE TO SCALE DEVELOPMENT TEAMS ‣ TECHNOLOGY STACK LOCK-IN
  • 8. HOW DOES IT LOOK LIKE?_ T I E R MESSAGING ADAPTER USER SYSTEM DIALOG SYSTEM CORE ADMIN MULTILANGUAGE CMS PUBLIC API DATABASE INTEGRATION INTEGRATION INTEGRATIONTRACKING SYSTEM CACHE OTHER SERVICES DATA ACCESS LAYER
  • 9.
  • 11. BENEFITS & DRAWBACKS_ ‣ MEDIUM SIZE TIERS EASIER TO LEARN AND MAINTAIN ‣ BETTER DEVELOPMENT SCALING ‣ MORE DEPLOYMENT AND SCALING INDEPENDENCE ‣ STILL MANY COMPONENTS IN THE SAME TIER ‣ MORE COMPLEX DEPLOYMENT ‣ TESTING IS MORE DIFFICULT ‣ NETWORK SLOWS DOWN SYSTEM INTERACTIONS
  • 12. HOW DOES IT LOOK LIKE?_ T I E R MESSAGING ADAPTER DIALOG SYSTEM INTEGRATION PUBLIC API ADMIN CMS T I E R T I E R T I E R INTEGRATION INTEGRATION MESSAGING ADAPTER POST-NLP USER SYSTEM MULTILANGUAGE MESSAGES A P I DATABASEOTHER SERVICES AI SERVICES TRACKING SYSTEM BUSINESS INTEL
  • 13.
  • 15. BENEFITS_ ‣ EACH COMPONENT CAN BE A RELATIVELY SMALL MICROSERVICE ‣ COMPONENT INDEPENDENT DEPLOY ‣ EASIER TO SCALE DEVELOPMENT ‣ IMPROVED FAULT ISOLATION ‣ TECHNOLOGY STACK FREEDOM ‣ MODULARITY IS INHERENT TO THE ARCHITECTURE
  • 16. DRAWBACKS_ ‣ HIGH DEPLOYMENT COMPLEXITY ‣ HIGH INFRASTRUCTURE NEEDS ‣ INTER-COMMUNICATION MECANISM NEEDED ‣ IDES ARE NOT BUILT FOR MICROSERVICES ‣ NETWORK SLOWS DOWN SYSTEM INTERACTIONS ‣ INTEGRATION TESTING IS MORE DIFFICULT
  • 17. DESIGN_ ‣ WHICH IS MY STARTING POINT? ‣ IDEALLY MODULAR COMPONENTS ‣ IDENTIFY BOUNDED CONTEXTS ‣ DOES IT NEED DATA PERSISTANCE? ‣ WHICH ARE ITS DEPENDENCIES: ‣ OTHER MICROSERVICES (PROTECTION/COMMUNICATION/MONITORING) ‣ EXTERNAL SERVICES (PROTECTION) ‣ DEFINE PHASES ‣ BREAK THE CORE ‣ DECREASING COMPONENTS SIZE
  • 18. BOUNDED CONTEXTS AND OPERATIONS_ ‣ OPERATIONS ARE BASIC COMMANDS WITHIN A BOUNDED CONTEXT ‣ BOTS: Create, Get, Modify, Delete ‣ USERS: Create, Get, Modify, Delete, Login, External login, etc ‣ MESSAGES: Create, Get, Delete ‣ SEARCH: Search services, search categories, search detail, etc ‣ BOOKINGS: Create, Get detail, Get list, Modify, Delete ‣ NOTIFICATIONS: Push, schedule ‣ STATISTICS: Create, Get, Delete ‣ RECOMMENDED IMPLEMENTATION: OOP, Classes
  • 19. DIALOG SYSTEM, INTENTS AND ACTIONS_ ‣ DIALOG SYSTEM IS THE MOST IMPORTANT COMPONENT ‣ IT USES BOUNDED CONTEXTS ‣ INTENTS: ENTITIES PARSED FROM USER’S MESSAGE FOR A NLP SERVICE ‣ ACTIONS: CROSS-COMPONENT’S VERBS TRIGGERED BY MESSAGES OR FLOW ELECTIONS WITHIN A CONVERSATION ‣ INTENTS CAN MATCH ACTIONS WITH 1-TO-1, N-TO-1 AND EVEN N-TO-N RELATIONS, WHERE MULTIPLE INTENTS COMBINATION IS CHALLENGE ‣ RECOMMENDED IMPLEMENTATION: FP, Functions
  • 20. TESTING, LOGGING AND MONITORING_ ‣ UNIT TESTING ‣ FINE-GRAINED LOGGING ‣ MICROSECS TIME TRACKING ‣ UPSTREAM TRACKING ‣ DOWNSTREAM TRACKING ‣ MONITORING ‣ HEALTH CHECKING ‣ SCALING ‣ GUI ADMIN
  • 21.
  • 23. WHAT IS SENECA?_ ‣ IT IS A NODEJS TOOLKIT TO DEVELOP MICROSERVICES SYSTEMS ‣ IT OFFERS THREE CORE FEATURES: ‣ PATTERN MATCHING ‣ UNIQUE PATTERNS ‣ TRANSPORT INDEPENDENCE ‣ HTTP, TCP, AMQP, REDIS, etc ‣ COMPONENTIZATION
  • 24. PATTERN MATCHING_ ‣ CAN BE USED WITHOUT SERVICE DISCOVERY (CONSUL, ZOOKEEPER, ETC) ‣ IT IS BASED ON ASYNCHRONOUS MESSAGING OF JSON OBJECTS ‣ ACTIONS ARE DEFINED BY A PATTERN AND A CALLBACK: ‣ PATTERN like ‘role:math,cmd:sum’ ‣ CALLBACK gets message and executes a reply
  • 25. PATTERN MATCHING_ ‣ EXECUTIONS SEND A MESSAGE AND RECEIVE A RESPONSE seneca.act({role: 'math', cmd: 'sum', left: 1, right: 2}, function (err, result) { if (err) return console.error(err) ‣ MORE SPECIFIC PATTERN PREVAILS ‣ ACTIONS CAN EXECUTE ANOTHER ACTION FOR CODE RE-USE ‣ ACTIONS CAN BE ENHANCED BY OVERRIDE
  • 26. PLUGINS_ ‣ FUNCTION THAT CONTAINS A SET OF RELATED ACTIONS ‣ IT HAS AN INIT FUNCTION THAT IS CALLED SYNCHRONOUSLY ‣ EACH PLUGIN IS DEFINED IN A MODULE ‣ PLUGINS ARE TRANSPORT-AGNOSTIC ‣ YOU LOAD A PLUGIN WITH .USE
  • 28. MICROSERVICES_ ‣ YOU RUN A MICROSERVICE IN ITS OWN PROCESS WITH .LISTEN ‣ YOU DEFINE: ‣ ITS MESSAGING TRANSPORT (HTTP - HOST, PORT… -, TCP, ETC) ‣ ITS SPECIFIC PATTERN MATCHING FOR PATTERNS (PIN) ‣ YOU INVOKE A MICROSERVICE WITH .CLIENT ‣ ALL EXECUTIONS MATCHING ITS PIN WILL BE EXECUTED REMOTELY
  • 30. EXPOSING MICROSERVICES THROUGH WEB SERVER_ ‣ YOU USE AN ADAPTER, FOR EXAMPLE, FOR EXPRESS ‣ IN THE PLUGIN INIT YOU DEFINE ROUTES WITH: ‣ PREFIX, like “/API” ‣ PIN, like ‘role:api,path:*’ (you only expose that matching actions) ‣ MAP, list of paths, like “calculate: { GET:true, suffix:'/:operation' }” ‣ MATCHING ACTION CAN EXECUTE OTHER INTERNAL ACTIONS ‣ FINAL ENDPOINT EXAMPLE “/api/calculate/:operation"
  • 32. MICROSERVICES WEB SERVER EXAMPLE_ /api/calculate/:operation
  • 33. DATA STORAGE_ ‣ YOU CAN USE ANY PERSISTENCE YOU LIKE ‣ BUT YOU CAN DECIDE LATER ‣ USE PATTERN MATCHING AS ORM WITH SENECA-ENTITY: ‣ LOAD: load an entity by identifier ‣ SAVE: create or update (if you provide an identifier) an entity ‣ LIST: list entities matching a simple query ‣ REMOVE: delete an entity by identifier ‣ FINALLY USE A PLUGIN TO IMPLEMENT THIS ACTIONS
  • 34. GENERAL TIPS_ ‣ ONLY IF YOU MASTER THE DOMAIN ‣ DON’T MIGRATE A MONOLITH TO MICROSERVICES AT ONCE ‣ EACH PARTITION IS A BUSINESS CAPABILITY ‣ AUTONOMY OVER COORDINATION, MINIMIZE DEPENDENCIES ‣ NOT SUITABLE FOR SMALL APPLICATIONS OR PLATFORMS ‣ BE READY TO DEAL WITH INFRASTRUCTURE COMPLEXITY
  • 35.