SlideShare a Scribd company logo
SYNCHRONOUS &
ASYNCHRONOUS SOFTWARE
COMMUNICATION COMPONENTS
Panos Tsilopoulos
Full stack software engineer @
Pheron
Email:
pan_tsilopoulos@outlook.com
Social media handle:
@tsilopoulos
SYNCHRONOUS
COMMUNICATIONS
SOFTWARE COMPONENTS
REST
Definitions & Core
Principal
What does it stand for?:
REpresentational State Transfer
What Is it?
It’s a way of providing interoperability between computer systems
over the Internet
Who/Where/When?
Resources:
Data, files,
methods
Where:
URL
based
How:
HTTP
What:
Up to
you
WHERE/HOW: A SIMPLE
EXAMPLE URLs
Premise:
• Data in a table could be a resource we want to read
• Database server called bbddb01
• Database called northwind
• Table called users
http://bbddb01/northwind/users
THE WHAT: DATA, DATA,
DATA JSON
What type of content you return is up
to you.
Most common are XML or JSON.
You could return complex types like a
picture.
“JSON (JavaScript Object Notation) is a lightweight
data-interchange format. It is easy for humans to
read and write. It is easy for machines to parse and
generate” – JSON.org
Important: JSON is a subset of JavaScript
{
"firstName": "John",
"lastName": "Smith",
"address": {
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": 10021
},
"phoneNumbers": [
"212 555-1234",
"646 555-4567"
]
}
String
Array
Number data
type
Child
properti
es
Name/Value
Pairs
DATA STRUCTURES JSON
A REAL LIFE EXAMPLE: FLICKR
REST API
Resource: Photos
Where:
 http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{secret}.jpg
 http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{secret}_[mstb].jpg
 http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{o-
secret}_o.(jpg|gif|png)
What: JPEG, GIF or PNG (defined in the URL)
http://farm1.static.flickr.com/2/1418878_1e92283336_m.jpg
METHODS REST
VERB
S
HTTP Methods are a key corner stone in REST.
They define the action to be taken with a URL.
Proper RESTful services expose all four – usually not the case though!
Google “RESTafarian” for more information on that debate.
Nothing stopping you doing some Mix & Match, especially when you’re time
constrained & don’t really wanna think the details through, like a Hackathon!
Build a working MVP(Minimum Viable Product) and worry about the
implementation details later!
What are the four methods and what should they do?
METHODS EXAMPLE
VERB
S
+ POST = Error
+ GET = Returns everyone who begins
with rob
+ PUT = Error
+ DELETE = Deletes everyone who begins
with rob
http://bbddb01/northwind/users
plus some input data
+ POST = Creates a new user
+ GET = Returns everyone who meets
criteria
+ PUT = Creates/Updates a user (based on
data)
+ DELETE = Deletes everyone who meets
criteria
http://bbddb01/northwind/users[firstname=“
rob%”]
COMMANDS REST
You can associate commands with a resource.
Commands can replace the need for using HTTP
methods and can provide a more familiar way of
dealing with data.
Example:
userResource = new
Resource('http://example.com/users/001')
userResource.delete()
ASYNCHRONOUS
COMMUNICATIONS
SOFTWARE COMPONENTS
MESSAGE
QUEUES
DEFINITIONS
Message queuing allow applications to communicate by sending messages to each other.
The message queue provide a temporary message storage when the destination program is busy or
not connected.
A queue is a line of things waiting to be handled - in sequential order starting at the beginning of the line.
A message queue is a queue of messages sent between applications. It includes a sequence of work objects
that are waiting to be processed.
A message is the data transported between the sender and the receiver application, it's essentially a byte
array with some headers on top. A message example could be anything that tells one system to start
processing a task, information about a finished task or a plain message.
The basic architecture of a message queue is simple, there are client applications called producers that
create messages and deliver them to the message queue. An other application, called consumer, connect to
the queue and get the messages to be processed. Messages placed onto the queue are stored until the
consumer retrieves them.
MESSAG
E
QUEUES
WHY SHOULD WE BE
INTERESTED IN MESSAGE
QUEUES? PT.1
Message queues
A message queue provide an asynchronous communications protocol, a system that puts a message onto a
message queue does not require an immediate response to continue processing. Email is probably the best
example of asynchronous messaging. When an email is sent can the sender continue processing other things
without an immediate response from the receiver. This way of handling messages decouple the producer from
the consumer. The producer and the consumer of the message do not need to interact with the message queue
at the same time.
DECOUPLING AND SCALABILITY
Decoupling is used to describe how much one piece of a system relies on another piece of the system.
Decoupling is the process of separating them so that their functionality will be more self contained.
A decoupled system are achieved when two or more systems are able to communicate without being connected.
The systems can remain completely autonomous and unaware of each other. Decoupling is often a sign of a
computer system that is well structured. It is usually easier to maintain, extend and debug.
If one process in a decoupled system fails processing messages from the queue, other messages can still be
added to the queue and be processed when the system has recovered. You can also use a message queue to
delay processing; A producer post messages to a queue. At the appointed time, the receivers are started up and
process the messages in the queue. Messages in queue can be stored-and-forwarded and the message be
redelivered until the message is processed.
MESSAG
E
QUEUES
WHY SHOULD WE BE
INTERESTED IN MESSAGE
QUEUES? PT.2
MESSAG
E
QUEUES
Instead of building one large application, is it beneficial to
decouple different parts of your application and only
communicate between them asynchronously with
messages. That way different parts of your application can
evolve independently, be written in different languages
and/or maintained by separated developer teams.
A message queue will keep the processes in your application separated and independent of each other. The first
process will never need to invoke another process, or post notifications to another process, or follow the process flow
of the other processes. It can just put the message on the queue and then continue processing. The other processes
can also handle their work independently. They can take the messages from the queue when they are able to process
them. This way of handling messages creates a system that is easy to maintain and easy to scale.
MESSAGE QUEUING - A
SIMPLE USE CASE
MESSAG
E
QUEUES
Imagine that you have a web service that receives many requests every second, where no request is afford to get lost
and all requests needs to be processed by a process that is time consuming.
Imagine that your web service always has to be highly available and ready to receive new request instead of being
locked by the processing of previous received requests. In this case it is ideal to put a queue between the web service
and the processing service. The web service can put the "start processing"-message on a queue and the other
process can take and handle messages in order. The two processes will be decoupled from each other and does not
need to wait for each other. If you have a lot of requests coming in a short amount of time, the processing system will
be able to process them all anyway. The queue will persist requests if their number becomes really huge.
You can then imagine that your business and your workload is growing and you need to scale up your
system. All that is needed to be done now is to add more workers, receivers, to work off the queues faster.
A REAL LIFE EXAMPLE:
HIRENAMI’S PUBLISH-
SUBSCRIBE PATTERN
COMMS
LIVE CODING SESSION UNDER WAY
REFERENCES & FURTHER
STUDYING MATERIAL
• Hypertext Transfer Protocol – HTTP/1.1 https://tools.ietf.org/html/rfc2616
• Introducing JSON - http://json.org/
• FLICKR Developer Services https://www.flickr.com/services/developer/api/
• Publish-Subscribe pattern – Wikipedia
https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern
• Amazon Web Services (AWS) Simple Queue Service (SQS)
https://aws.amazon.com/sqs/details/
THANKS FOR
ATTENDING!

More Related Content

What's hot

email clients and webmail (presentation)
email clients and webmail   (presentation)email clients and webmail   (presentation)
email clients and webmail (presentation)kay2
 
Electronic mail
Electronic mailElectronic mail
Electronic mail
Ahmad Zahid
 
Internet mail server
Internet mail server Internet mail server
Internet mail server
Akasha Kumar Das
 
Interanet Mailing
Interanet Mailing  Interanet Mailing
Interanet Mailing
Dharmraj Sharma
 
Webmail and Mail Clients
Webmail and Mail ClientsWebmail and Mail Clients
Webmail and Mail Clients
Someone Else
 
Mail server using Linux(Ubuntu)
Mail server using Linux(Ubuntu)Mail server using Linux(Ubuntu)
Mail server using Linux(Ubuntu)
Navjot Navi
 
About Web and E-mail
About Web and E-mailAbout Web and E-mail
About Web and E-mail
sai prakash
 
Java servlets
Java servletsJava servlets
Java servlets
VijayapriyaPandi
 
Mail services and mail commands in linux
Mail services and mail commands in linuxMail services and mail commands in linux
Mail services and mail commands in linux
Gracia Marcom
 
Application layer protocol
Application layer protocolApplication layer protocol
Application layer protocolTom Hanstead
 
All about email
All about emailAll about email
All about emailestefana4
 
Web Programming: Basics of Internet and Introduction to HTML5 and CSS
Web Programming: Basics of Internet and Introduction to HTML5 and CSSWeb Programming: Basics of Internet and Introduction to HTML5 and CSS
Web Programming: Basics of Internet and Introduction to HTML5 and CSS
Kajal Singh
 
Email ppt
Email pptEmail ppt
Email pptmelgade
 
Web services Concepts
Web services ConceptsWeb services Concepts
Web services Concepts
pasam suresh
 
I Need Help NOW! Instant Messaging Reference Service @ McNeese
I Need Help NOW! Instant Messaging Reference Service @ McNeeseI Need Help NOW! Instant Messaging Reference Service @ McNeese
I Need Help NOW! Instant Messaging Reference Service @ McNeese
Rebecca Troy-Horton
 

What's hot (20)

Smtp
SmtpSmtp
Smtp
 
email clients and webmail (presentation)
email clients and webmail   (presentation)email clients and webmail   (presentation)
email clients and webmail (presentation)
 
Electronic mail
Electronic mailElectronic mail
Electronic mail
 
Mail server
Mail serverMail server
Mail server
 
Internet mail server
Internet mail server Internet mail server
Internet mail server
 
Form 1 Term 2 Week 4.2
Form 1   Term 2   Week 4.2Form 1   Term 2   Week 4.2
Form 1 Term 2 Week 4.2
 
Interanet Mailing
Interanet Mailing  Interanet Mailing
Interanet Mailing
 
Webmail and Mail Clients
Webmail and Mail ClientsWebmail and Mail Clients
Webmail and Mail Clients
 
Mail server using Linux(Ubuntu)
Mail server using Linux(Ubuntu)Mail server using Linux(Ubuntu)
Mail server using Linux(Ubuntu)
 
About Web and E-mail
About Web and E-mailAbout Web and E-mail
About Web and E-mail
 
Java servlets
Java servletsJava servlets
Java servlets
 
Mail services and mail commands in linux
Mail services and mail commands in linuxMail services and mail commands in linux
Mail services and mail commands in linux
 
Application layer protocol
Application layer protocolApplication layer protocol
Application layer protocol
 
All about email
All about emailAll about email
All about email
 
Web Programming: Basics of Internet and Introduction to HTML5 and CSS
Web Programming: Basics of Internet and Introduction to HTML5 and CSSWeb Programming: Basics of Internet and Introduction to HTML5 and CSS
Web Programming: Basics of Internet and Introduction to HTML5 and CSS
 
Email ppt
Email pptEmail ppt
Email ppt
 
Email Client Server System
Email Client Server SystemEmail Client Server System
Email Client Server System
 
Web services Concepts
Web services ConceptsWeb services Concepts
Web services Concepts
 
Cn u5
Cn u5Cn u5
Cn u5
 
I Need Help NOW! Instant Messaging Reference Service @ McNeese
I Need Help NOW! Instant Messaging Reference Service @ McNeeseI Need Help NOW! Instant Messaging Reference Service @ McNeese
I Need Help NOW! Instant Messaging Reference Service @ McNeese
 

Similar to Synchronous and asynchronous software communication components

Differences Between Architectures
Differences Between ArchitecturesDifferences Between Architectures
Differences Between Architecturesprasadsmn
 
Patterns&Antipatternsof SOA
Patterns&Antipatternsof SOAPatterns&Antipatternsof SOA
Patterns&Antipatternsof SOA
Mohamed Samy
 
ProposalRequirements document This is part 1 of the project, I .docx
ProposalRequirements document This is part 1 of the project, I .docxProposalRequirements document This is part 1 of the project, I .docx
ProposalRequirements document This is part 1 of the project, I .docx
denneymargareta
 
Apache ActiveMQ and Apache Camel
Apache ActiveMQ and Apache CamelApache ActiveMQ and Apache Camel
Apache ActiveMQ and Apache CamelOmi Om
 
The Art of Message Queues - TEKX
The Art of Message Queues - TEKXThe Art of Message Queues - TEKX
The Art of Message Queues - TEKXMike Willbanks
 
Sending the data already gathered from the client to the Server
Sending the data already gathered from the client to the ServerSending the data already gathered from the client to the Server
Sending the data already gathered from the client to the Server
hussam242
 
Integration Patterns With Spring integration
Integration Patterns With Spring integrationIntegration Patterns With Spring integration
Integration Patterns With Spring integration
Eldad Dor
 
Tef con2016 (1)
Tef con2016 (1)Tef con2016 (1)
Tef con2016 (1)
ggarber
 
444963864-INTEGRATIVE-PROGRAMMING-lesson1-pptx.pptx
444963864-INTEGRATIVE-PROGRAMMING-lesson1-pptx.pptx444963864-INTEGRATIVE-PROGRAMMING-lesson1-pptx.pptx
444963864-INTEGRATIVE-PROGRAMMING-lesson1-pptx.pptx
Arianne47
 
Task communication
Task communicationTask communication
Task communication
1jayanti
 
Web Services in SOA | Torry Harris
Web Services in SOA | Torry HarrisWeb Services in SOA | Torry Harris
Web Services in SOA | Torry Harris
Torry Harris Business Solutions
 
Web services-synchronous-or-asynchronous
Web services-synchronous-or-asynchronousWeb services-synchronous-or-asynchronous
Web services-synchronous-or-asynchronous
Aravindharamanan S
 
PROJECT ARRANGED (FINAL)
PROJECT ARRANGED (FINAL)PROJECT ARRANGED (FINAL)
PROJECT ARRANGED (FINAL)Joseph Olumide
 
Designing Application over mobile environment
Designing Application over mobile environmentDesigning Application over mobile environment
Designing Application over mobile environment
Maulik Patel
 
RabbitMQ in Microservice Architecture.docx
RabbitMQ in Microservice Architecture.docxRabbitMQ in Microservice Architecture.docx
RabbitMQ in Microservice Architecture.docx
Shakuro
 
Web 7 | HTTP Request and Response
Web 7 | HTTP Request and ResponseWeb 7 | HTTP Request and Response
Web 7 | HTTP Request and Response
Mohammad Imam Hossain
 
Intranet mailing system
Intranet mailing systemIntranet mailing system
Intranet mailing system
saili mane
 
Enterprise messaging with jms
Enterprise messaging with jmsEnterprise messaging with jms
Enterprise messaging with jms
Sridhar Reddy
 
Distributed system
Distributed systemDistributed system
Distributed system
chirag patil
 

Similar to Synchronous and asynchronous software communication components (20)

Differences Between Architectures
Differences Between ArchitecturesDifferences Between Architectures
Differences Between Architectures
 
Patterns&Antipatternsof SOA
Patterns&Antipatternsof SOAPatterns&Antipatternsof SOA
Patterns&Antipatternsof SOA
 
ProposalRequirements document This is part 1 of the project, I .docx
ProposalRequirements document This is part 1 of the project, I .docxProposalRequirements document This is part 1 of the project, I .docx
ProposalRequirements document This is part 1 of the project, I .docx
 
Apache ActiveMQ and Apache Camel
Apache ActiveMQ and Apache CamelApache ActiveMQ and Apache Camel
Apache ActiveMQ and Apache Camel
 
The Art of Message Queues - TEKX
The Art of Message Queues - TEKXThe Art of Message Queues - TEKX
The Art of Message Queues - TEKX
 
Sending the data already gathered from the client to the Server
Sending the data already gathered from the client to the ServerSending the data already gathered from the client to the Server
Sending the data already gathered from the client to the Server
 
Integration Patterns With Spring integration
Integration Patterns With Spring integrationIntegration Patterns With Spring integration
Integration Patterns With Spring integration
 
Tef con2016 (1)
Tef con2016 (1)Tef con2016 (1)
Tef con2016 (1)
 
444963864-INTEGRATIVE-PROGRAMMING-lesson1-pptx.pptx
444963864-INTEGRATIVE-PROGRAMMING-lesson1-pptx.pptx444963864-INTEGRATIVE-PROGRAMMING-lesson1-pptx.pptx
444963864-INTEGRATIVE-PROGRAMMING-lesson1-pptx.pptx
 
Task communication
Task communicationTask communication
Task communication
 
BigDataDebugging
BigDataDebuggingBigDataDebugging
BigDataDebugging
 
Web Services in SOA | Torry Harris
Web Services in SOA | Torry HarrisWeb Services in SOA | Torry Harris
Web Services in SOA | Torry Harris
 
Web services-synchronous-or-asynchronous
Web services-synchronous-or-asynchronousWeb services-synchronous-or-asynchronous
Web services-synchronous-or-asynchronous
 
PROJECT ARRANGED (FINAL)
PROJECT ARRANGED (FINAL)PROJECT ARRANGED (FINAL)
PROJECT ARRANGED (FINAL)
 
Designing Application over mobile environment
Designing Application over mobile environmentDesigning Application over mobile environment
Designing Application over mobile environment
 
RabbitMQ in Microservice Architecture.docx
RabbitMQ in Microservice Architecture.docxRabbitMQ in Microservice Architecture.docx
RabbitMQ in Microservice Architecture.docx
 
Web 7 | HTTP Request and Response
Web 7 | HTTP Request and ResponseWeb 7 | HTTP Request and Response
Web 7 | HTTP Request and Response
 
Intranet mailing system
Intranet mailing systemIntranet mailing system
Intranet mailing system
 
Enterprise messaging with jms
Enterprise messaging with jmsEnterprise messaging with jms
Enterprise messaging with jms
 
Distributed system
Distributed systemDistributed system
Distributed system
 

Recently uploaded

Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
MayankTawar1
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
Jelle | Nordend
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
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
WSO2
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 

Recently uploaded (20)

Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
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
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 

Synchronous and asynchronous software communication components

  • 1. SYNCHRONOUS & ASYNCHRONOUS SOFTWARE COMMUNICATION COMPONENTS Panos Tsilopoulos Full stack software engineer @ Pheron Email: pan_tsilopoulos@outlook.com Social media handle: @tsilopoulos
  • 3. Definitions & Core Principal What does it stand for?: REpresentational State Transfer What Is it? It’s a way of providing interoperability between computer systems over the Internet Who/Where/When? Resources: Data, files, methods Where: URL based How: HTTP What: Up to you
  • 4. WHERE/HOW: A SIMPLE EXAMPLE URLs Premise: • Data in a table could be a resource we want to read • Database server called bbddb01 • Database called northwind • Table called users http://bbddb01/northwind/users
  • 5. THE WHAT: DATA, DATA, DATA JSON What type of content you return is up to you. Most common are XML or JSON. You could return complex types like a picture. “JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate” – JSON.org Important: JSON is a subset of JavaScript { "firstName": "John", "lastName": "Smith", "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": 10021 }, "phoneNumbers": [ "212 555-1234", "646 555-4567" ] } String Array Number data type Child properti es Name/Value Pairs
  • 7. A REAL LIFE EXAMPLE: FLICKR REST API Resource: Photos Where:  http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{secret}.jpg  http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{secret}_[mstb].jpg  http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{o- secret}_o.(jpg|gif|png) What: JPEG, GIF or PNG (defined in the URL) http://farm1.static.flickr.com/2/1418878_1e92283336_m.jpg
  • 9. VERB S HTTP Methods are a key corner stone in REST. They define the action to be taken with a URL. Proper RESTful services expose all four – usually not the case though! Google “RESTafarian” for more information on that debate. Nothing stopping you doing some Mix & Match, especially when you’re time constrained & don’t really wanna think the details through, like a Hackathon! Build a working MVP(Minimum Viable Product) and worry about the implementation details later! What are the four methods and what should they do?
  • 10. METHODS EXAMPLE VERB S + POST = Error + GET = Returns everyone who begins with rob + PUT = Error + DELETE = Deletes everyone who begins with rob http://bbddb01/northwind/users plus some input data + POST = Creates a new user + GET = Returns everyone who meets criteria + PUT = Creates/Updates a user (based on data) + DELETE = Deletes everyone who meets criteria http://bbddb01/northwind/users[firstname=“ rob%”]
  • 12. You can associate commands with a resource. Commands can replace the need for using HTTP methods and can provide a more familiar way of dealing with data. Example: userResource = new Resource('http://example.com/users/001') userResource.delete()
  • 14. DEFINITIONS Message queuing allow applications to communicate by sending messages to each other. The message queue provide a temporary message storage when the destination program is busy or not connected. A queue is a line of things waiting to be handled - in sequential order starting at the beginning of the line. A message queue is a queue of messages sent between applications. It includes a sequence of work objects that are waiting to be processed. A message is the data transported between the sender and the receiver application, it's essentially a byte array with some headers on top. A message example could be anything that tells one system to start processing a task, information about a finished task or a plain message. The basic architecture of a message queue is simple, there are client applications called producers that create messages and deliver them to the message queue. An other application, called consumer, connect to the queue and get the messages to be processed. Messages placed onto the queue are stored until the consumer retrieves them. MESSAG E QUEUES
  • 15. WHY SHOULD WE BE INTERESTED IN MESSAGE QUEUES? PT.1 Message queues A message queue provide an asynchronous communications protocol, a system that puts a message onto a message queue does not require an immediate response to continue processing. Email is probably the best example of asynchronous messaging. When an email is sent can the sender continue processing other things without an immediate response from the receiver. This way of handling messages decouple the producer from the consumer. The producer and the consumer of the message do not need to interact with the message queue at the same time. DECOUPLING AND SCALABILITY Decoupling is used to describe how much one piece of a system relies on another piece of the system. Decoupling is the process of separating them so that their functionality will be more self contained. A decoupled system are achieved when two or more systems are able to communicate without being connected. The systems can remain completely autonomous and unaware of each other. Decoupling is often a sign of a computer system that is well structured. It is usually easier to maintain, extend and debug. If one process in a decoupled system fails processing messages from the queue, other messages can still be added to the queue and be processed when the system has recovered. You can also use a message queue to delay processing; A producer post messages to a queue. At the appointed time, the receivers are started up and process the messages in the queue. Messages in queue can be stored-and-forwarded and the message be redelivered until the message is processed. MESSAG E QUEUES
  • 16. WHY SHOULD WE BE INTERESTED IN MESSAGE QUEUES? PT.2 MESSAG E QUEUES Instead of building one large application, is it beneficial to decouple different parts of your application and only communicate between them asynchronously with messages. That way different parts of your application can evolve independently, be written in different languages and/or maintained by separated developer teams. A message queue will keep the processes in your application separated and independent of each other. The first process will never need to invoke another process, or post notifications to another process, or follow the process flow of the other processes. It can just put the message on the queue and then continue processing. The other processes can also handle their work independently. They can take the messages from the queue when they are able to process them. This way of handling messages creates a system that is easy to maintain and easy to scale.
  • 17. MESSAGE QUEUING - A SIMPLE USE CASE MESSAG E QUEUES Imagine that you have a web service that receives many requests every second, where no request is afford to get lost and all requests needs to be processed by a process that is time consuming. Imagine that your web service always has to be highly available and ready to receive new request instead of being locked by the processing of previous received requests. In this case it is ideal to put a queue between the web service and the processing service. The web service can put the "start processing"-message on a queue and the other process can take and handle messages in order. The two processes will be decoupled from each other and does not need to wait for each other. If you have a lot of requests coming in a short amount of time, the processing system will be able to process them all anyway. The queue will persist requests if their number becomes really huge. You can then imagine that your business and your workload is growing and you need to scale up your system. All that is needed to be done now is to add more workers, receivers, to work off the queues faster.
  • 18. A REAL LIFE EXAMPLE: HIRENAMI’S PUBLISH- SUBSCRIBE PATTERN COMMS
  • 19. LIVE CODING SESSION UNDER WAY
  • 20. REFERENCES & FURTHER STUDYING MATERIAL • Hypertext Transfer Protocol – HTTP/1.1 https://tools.ietf.org/html/rfc2616 • Introducing JSON - http://json.org/ • FLICKR Developer Services https://www.flickr.com/services/developer/api/ • Publish-Subscribe pattern – Wikipedia https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern • Amazon Web Services (AWS) Simple Queue Service (SQS) https://aws.amazon.com/sqs/details/