SlideShare a Scribd company logo
1 of 18
What is Synchronous programming?
In programming, synchronous programs allocate a single thread to handle a request
or complete a task.
Since synchronous operations happen one at a time, a painstakingly long task
like a database query will block all other threads in the meantime.
While asynchronous operations can run multiple tasks concurrently on a single
thread, synchronous programs have a task queue where every other task remains
idle while the first is completed.
By definition, synchronous means ‘connected’ or ‘dependent’. In essence,
synchronous communication is tightly coupled.
For reactive systems, when programs work best when they react to environmental
input, synchronous programs can be useful
What is Synchronous programming?
Synchronous programs use blocking I/O operations in which each operation
has to run before the next is executed.
Generally, computers are fast, so synchronous communication isn’t necessarily
disadvantageous.
However, in a real-life, non-technical application, this would be the equivalent of your
waiter refusing to bring out any of the dishes you ordered until each and every dish
were fully prepared.
Benefits of Synchronous programming?
Synchronous programming is well-supported amongst all programming languages.
Developers do not have to worry about whether it is possible to code asynchronous
applications as this is the default.
Plus, writing synchronous programs is objectively easier than writing asynchronous
programs.
In utilizing a blocking I/O architecture you can save time in the software development
process and run tests with fewer complications.
Benefits of Synchronous programming?
Search engines find it easier to crawl for web pages that make use of traditional
synchronous architecture.
For marketers who depend on search engine optimization (SEO) to build their
reputation and brand awareness, this is an appreciable advantage.
What is Asynchronous programming?
Asynchronous programming relies on a non-blocking input and output (I/O) protocol.
This signifies that an asynchronous program does not execute operations in a
hierarchical or sequential order.
The resulting parallelization means an asynchronous program can take on multiple
requests simultaneously and independently.
When one request fails, it has no effect on another request. And the program can
move to another task before finishing the last.
In software development, an advantage of this kind is called loose coupling. Loosely
coupled communication and/or programming allows for decentralized processes.
What is Asynchronous programming?
Fewer dependencies lead to higher fault tolerance and increased flexibility.
For businesses that prioritize getting things done, asynchronous programming can be
a fundamental building block in meeting project requirements.
Imagine a non-technical example of how asynchronous communication would look
like in a real-world scenario.
As an illustration, envision you’re at a restaurant. Your waiter has just taken multiple
orders at your table and brings out your appetizer as soon as it’s ready, instead of
waiting for your main entree to be prepared as well.
Not only is this simply efficient service, but it’s an exemplary demonstration of a non-
blocking I/O or asynchronous architecture.
Benefits of Asynchronous programming?
In comparing asynchronous and synchronous programming, asynchronous programs
improve user experience in a variety of ways.
First, all the scripts of a program or web page can load at one time, resulting in better
responsiveness and decreased page load delays.
And the failure of a thread has no consequence on the ability of other threads to run
or render. Therefore, there is more availability overall with asynchronous
applications.
Benefits of Asynchronous programming?
In practice, asynchronous programming requires writing callback functions in
line with errors that may occur and disrupt a program.
These callbacks instruct the machine to move past the error and run the next task.
This also gives programmers the opportunity to write a personalized error message.
As a result, errors do not mean that your program altogether fails to run. Users get a
nice note while all the other features of the program work just fine.
Use case of Synchronous vs Asynchronous
For example if you want to download a file from the internet you might use a
synchronous function to do that but it will block your thread until the file finished
downloading. This can make your application unresponsive to any user input.
Instead you could download the file in the background using asynchronous
method. In this case the download function returns immediately and program
execution continues normally. All the download operations are done in the
background and your program will be notified when it's finished.
Use case of Synchronous vs Asynchronous
When you execute something synchronously, you wait for it to finish before moving
on to another task. When you execute something asynchronously, you can move
on to another task before it finishes.
Synchronous execution means the execution happens in a series a->b->c->d. If
you are calling methods ‘a ‘will run first and then when ‘a’ finish then ‘b’ will start.
With Asynchronous execution , you can start with ‘a’, and then ‘a’ can go in
background and we don’t need to wait for ‘a’ to finish, ‘b’ can start parallely.
Use case of Synchronous vs Asynchronous
The biggest contribution that asynchronous programming provides is enhanced
throughput.
Throughput refers to the deliverables a product or company can produce
within a specified time.
As established, computers are fast. Thus, synchronous programming is not as
time-consuming as you might imagine.
If you merely wish to develop a front-end application or execute a basic central
process unit (CPU) function, then asynchronous programming is way out of
bounds.
Use case of Synchronous
User Interfaces: User interface (UI) designs are typically synchronous. Since UIs
are spaces where humans and computers interact, it is ideal for them to replicate
the communication standards and practices humans are familiar with. Humans
expect an immediate response when they interact with a computer!
•HTTP APIs: HTTP APIs pass requests and responses in a synchronous fashion.
Client programs sending HTTP requests usually expect a fast answer from the
web server.
Use case of Asynchronous
•Batch-processing: is a data-processing method to handle large amounts of data
asynchronously. With asynchronous batch-processing, large batches of data are
processed at scheduled times to avoid blocking computing resources.
•Long-running tasks: such as fulfilling an order placed on an e-commerce site are
best handled asynchronously. There is no need to block resources while this task
is executed.
Summary
Synchronous and asynchronous, also known as sync and async, are
two types of programming models. At an abstract level, programming
models define how software is designed and executed.
The basic programming models are synchronous, but asynchronous
models are critical for performance reasons and to more efficiently use
computing resources. Programming languages usually have built-in
primitives to deal with asynchronous programming.
Asynchronous programming is a style of programming in which
the execution of a task is not guaranteed to occur in a
specific order. This contrasts with synchronous programming,
where all code execution is guaranteed to happen in a
specific order.
THANK YOU
Like the Video and Subscribe the Channel

More Related Content

What's hot

CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling AlgorithmsShubhashish Punj
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management SystemJanki Shah
 
Transactions (Distributed computing)
Transactions (Distributed computing)Transactions (Distributed computing)
Transactions (Distributed computing)Sri Prasanna
 
Introduction to Distributed System
Introduction to Distributed SystemIntroduction to Distributed System
Introduction to Distributed SystemSunita Sahu
 
Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computingSVijaylakshmi
 
Introduction to Parallel and Distributed Computing
Introduction to Parallel and Distributed ComputingIntroduction to Parallel and Distributed Computing
Introduction to Parallel and Distributed ComputingSayed Chhattan Shah
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed systemSunita Sahu
 
Distributed transaction
Distributed transactionDistributed transaction
Distributed transactionMohitKothari26
 
Scheduling in Cloud Computing
Scheduling in Cloud ComputingScheduling in Cloud Computing
Scheduling in Cloud ComputingHitesh Mohapatra
 
Reader/writer problem
Reader/writer problemReader/writer problem
Reader/writer problemRinkuMonani
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)Prakhar Maurya
 
Types of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed SystemTypes of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed SystemDHIVYADEVAKI
 
Congestion avoidance in TCP
Congestion avoidance in TCPCongestion avoidance in TCP
Congestion avoidance in TCPselvakumar_b1985
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Ravindra Raju Kolahalam
 
Importance & Principles of Modeling from UML Designing
Importance & Principles of Modeling from UML DesigningImportance & Principles of Modeling from UML Designing
Importance & Principles of Modeling from UML DesigningABHISHEK KUMAR
 

What's hot (20)

CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
Distributed System ppt
Distributed System pptDistributed System ppt
Distributed System ppt
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management System
 
Transactions (Distributed computing)
Transactions (Distributed computing)Transactions (Distributed computing)
Transactions (Distributed computing)
 
Introduction to Distributed System
Introduction to Distributed SystemIntroduction to Distributed System
Introduction to Distributed System
 
Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computing
 
Introduction to Parallel and Distributed Computing
Introduction to Parallel and Distributed ComputingIntroduction to Parallel and Distributed Computing
Introduction to Parallel and Distributed Computing
 
Dependencies
DependenciesDependencies
Dependencies
 
software engineering
software engineeringsoftware engineering
software engineering
 
Naming in Distributed System
Naming in Distributed SystemNaming in Distributed System
Naming in Distributed System
 
data replication
data replicationdata replication
data replication
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
 
Distributed transaction
Distributed transactionDistributed transaction
Distributed transaction
 
Scheduling in Cloud Computing
Scheduling in Cloud ComputingScheduling in Cloud Computing
Scheduling in Cloud Computing
 
Reader/writer problem
Reader/writer problemReader/writer problem
Reader/writer problem
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
Types of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed SystemTypes of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed System
 
Congestion avoidance in TCP
Congestion avoidance in TCPCongestion avoidance in TCP
Congestion avoidance in TCP
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 
Importance & Principles of Modeling from UML Designing
Importance & Principles of Modeling from UML DesigningImportance & Principles of Modeling from UML Designing
Importance & Principles of Modeling from UML Designing
 

Similar to Synchronous vs Asynchronous Programming

AsyncIO in Python (Guide and Example).pdf
AsyncIO in Python (Guide and Example).pdfAsyncIO in Python (Guide and Example).pdf
AsyncIO in Python (Guide and Example).pdfPreetAujla6
 
Report hospital
Report hospitalReport hospital
Report hospitalRachit Gaur
 
Interactive Applications in .NET
Interactive Applications in .NETInteractive Applications in .NET
Interactive Applications in .NETAndrei Fangli
 
Concurrency and Parallelism, Asynchronous Programming, Network Programming
Concurrency and Parallelism, Asynchronous Programming, Network ProgrammingConcurrency and Parallelism, Asynchronous Programming, Network Programming
Concurrency and Parallelism, Asynchronous Programming, Network ProgrammingPrabu U
 
5.7 Parallel Processing - Reactive Programming.pdf.pptx
5.7 Parallel Processing - Reactive Programming.pdf.pptx5.7 Parallel Processing - Reactive Programming.pdf.pptx
5.7 Parallel Processing - Reactive Programming.pdf.pptxMohamedBilal73
 
Event oriented programming
Event oriented programmingEvent oriented programming
Event oriented programmingAshwini Awatare
 
os ass.pptx
os ass.pptxos ass.pptx
os ass.pptxkavinaya9
 
Types or evolution of operating system
Types or evolution of operating systemTypes or evolution of operating system
Types or evolution of operating systemEkta Bafna
 
Understanding concurrency
Understanding concurrencyUnderstanding concurrency
Understanding concurrencyAnshul Sharma
 
Internet applications unit1
Internet applications unit1Internet applications unit1
Internet applications unit1MSc CST
 
Operating systems
Operating systemsOperating systems
Operating systemsoswaldm80
 
Distributed Software Engineering with Client-Server Computing
Distributed Software Engineering with Client-Server ComputingDistributed Software Engineering with Client-Server Computing
Distributed Software Engineering with Client-Server ComputingHaseeb Rehman
 
C# Async Await
C# Async AwaitC# Async Await
C# Async AwaitSimplilearn
 
Advanced computer architecture unit 5
Advanced computer architecture  unit 5Advanced computer architecture  unit 5
Advanced computer architecture unit 5Kunal Bangar
 
Concurrency in c#
Concurrency in c#Concurrency in c#
Concurrency in c#RezaHamidpour
 
Web services-synchronous-or-asynchronous
Web services-synchronous-or-asynchronousWeb services-synchronous-or-asynchronous
Web services-synchronous-or-asynchronousAravindharamanan S
 

Similar to Synchronous vs Asynchronous Programming (20)

AsyncIO in Python (Guide and Example).pdf
AsyncIO in Python (Guide and Example).pdfAsyncIO in Python (Guide and Example).pdf
AsyncIO in Python (Guide and Example).pdf
 
Asynchronyin net
Asynchronyin netAsynchronyin net
Asynchronyin net
 
Report hospital
Report hospitalReport hospital
Report hospital
 
Interactive Applications in .NET
Interactive Applications in .NETInteractive Applications in .NET
Interactive Applications in .NET
 
Concurrency and Parallelism, Asynchronous Programming, Network Programming
Concurrency and Parallelism, Asynchronous Programming, Network ProgrammingConcurrency and Parallelism, Asynchronous Programming, Network Programming
Concurrency and Parallelism, Asynchronous Programming, Network Programming
 
Lec2.pptx
Lec2.pptxLec2.pptx
Lec2.pptx
 
5.7 Parallel Processing - Reactive Programming.pdf.pptx
5.7 Parallel Processing - Reactive Programming.pdf.pptx5.7 Parallel Processing - Reactive Programming.pdf.pptx
5.7 Parallel Processing - Reactive Programming.pdf.pptx
 
Event oriented programming
Event oriented programmingEvent oriented programming
Event oriented programming
 
os ass.pptx
os ass.pptxos ass.pptx
os ass.pptx
 
Types or evolution of operating system
Types or evolution of operating systemTypes or evolution of operating system
Types or evolution of operating system
 
Understanding concurrency
Understanding concurrencyUnderstanding concurrency
Understanding concurrency
 
Internet applications unit1
Internet applications unit1Internet applications unit1
Internet applications unit1
 
Operating systems
Operating systemsOperating systems
Operating systems
 
Distributed Software Engineering with Client-Server Computing
Distributed Software Engineering with Client-Server ComputingDistributed Software Engineering with Client-Server Computing
Distributed Software Engineering with Client-Server Computing
 
C# Async Await
C# Async AwaitC# Async Await
C# Async Await
 
Advanced computer architecture unit 5
Advanced computer architecture  unit 5Advanced computer architecture  unit 5
Advanced computer architecture unit 5
 
Concurrency in c#
Concurrency in c#Concurrency in c#
Concurrency in c#
 
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
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 

More from jeetendra mandal

What is AWS Cloud Watch
What is AWS Cloud WatchWhat is AWS Cloud Watch
What is AWS Cloud Watchjeetendra mandal
 
Eventual consistency vs Strong consistency what is the difference
Eventual consistency vs Strong consistency what is the differenceEventual consistency vs Strong consistency what is the difference
Eventual consistency vs Strong consistency what is the differencejeetendra mandal
 
Batch Processing vs Stream Processing Difference
Batch Processing vs Stream Processing DifferenceBatch Processing vs Stream Processing Difference
Batch Processing vs Stream Processing Differencejeetendra mandal
 
Difference between Database vs Data Warehouse vs Data Lake
Difference between Database vs Data Warehouse vs Data LakeDifference between Database vs Data Warehouse vs Data Lake
Difference between Database vs Data Warehouse vs Data Lakejeetendra mandal
 
Difference between Client Polling vs Server Push vs Websocket vs Long Polling
Difference between Client Polling vs Server Push vs Websocket vs Long PollingDifference between Client Polling vs Server Push vs Websocket vs Long Polling
Difference between Client Polling vs Server Push vs Websocket vs Long Pollingjeetendra mandal
 
Difference between TLS 1.2 vs TLS 1.3 and tutorial of TLS2 and TLS2 version c...
Difference between TLS 1.2 vs TLS 1.3 and tutorial of TLS2 and TLS2 version c...Difference between TLS 1.2 vs TLS 1.3 and tutorial of TLS2 and TLS2 version c...
Difference between TLS 1.2 vs TLS 1.3 and tutorial of TLS2 and TLS2 version c...jeetendra mandal
 
Difference Program vs Process vs Thread
Difference Program vs Process vs ThreadDifference Program vs Process vs Thread
Difference Program vs Process vs Threadjeetendra mandal
 
Carrier Advice for a JAVA Developer How to Become a Java Programmer
Carrier Advice for a JAVA Developer How to Become a Java ProgrammerCarrier Advice for a JAVA Developer How to Become a Java Programmer
Carrier Advice for a JAVA Developer How to Become a Java Programmerjeetendra mandal
 
How to become a Software Tester Carrier Path for Software Quality Tester
How to become a Software Tester Carrier Path for Software Quality TesterHow to become a Software Tester Carrier Path for Software Quality Tester
How to become a Software Tester Carrier Path for Software Quality Testerjeetendra mandal
 
How to become a Software Engineer Carrier Path for Software Developer
How to become a Software Engineer Carrier Path for Software DeveloperHow to become a Software Engineer Carrier Path for Software Developer
How to become a Software Engineer Carrier Path for Software Developerjeetendra mandal
 
Events vs Notifications
Events vs NotificationsEvents vs Notifications
Events vs Notificationsjeetendra mandal
 
Microservice Architecture Software Architecture Microservice Design Pattern
Microservice Architecture Software Architecture Microservice Design PatternMicroservice Architecture Software Architecture Microservice Design Pattern
Microservice Architecture Software Architecture Microservice Design Patternjeetendra mandal
 
Event Driven Software Architecture Pattern
Event Driven Software Architecture PatternEvent Driven Software Architecture Pattern
Event Driven Software Architecture Patternjeetendra mandal
 
Top 5 Software Architecture Pattern Event Driven SOA Microservice Serverless ...
Top 5 Software Architecture Pattern Event Driven SOA Microservice Serverless ...Top 5 Software Architecture Pattern Event Driven SOA Microservice Serverless ...
Top 5 Software Architecture Pattern Event Driven SOA Microservice Serverless ...jeetendra mandal
 
Observability vs APM vs Monitoring Comparison
Observability vs APM vs  Monitoring ComparisonObservability vs APM vs  Monitoring Comparison
Observability vs APM vs Monitoring Comparisonjeetendra mandal
 
Disaster Recovery vs Data Backup what is the difference
Disaster Recovery vs Data Backup what is the differenceDisaster Recovery vs Data Backup what is the difference
Disaster Recovery vs Data Backup what is the differencejeetendra mandal
 
What is Spinnaker? Spinnaker tutorial
What is Spinnaker? Spinnaker tutorialWhat is Spinnaker? Spinnaker tutorial
What is Spinnaker? Spinnaker tutorialjeetendra mandal
 
Difference between Github vs Gitlab vs Bitbucket
Difference between Github vs Gitlab vs BitbucketDifference between Github vs Gitlab vs Bitbucket
Difference between Github vs Gitlab vs Bitbucketjeetendra mandal
 

More from jeetendra mandal (20)

what is OSI model
what is OSI modelwhat is OSI model
what is OSI model
 
What is AWS Cloud Watch
What is AWS Cloud WatchWhat is AWS Cloud Watch
What is AWS Cloud Watch
 
What is AWS Fargate
What is AWS FargateWhat is AWS Fargate
What is AWS Fargate
 
Eventual consistency vs Strong consistency what is the difference
Eventual consistency vs Strong consistency what is the differenceEventual consistency vs Strong consistency what is the difference
Eventual consistency vs Strong consistency what is the difference
 
Batch Processing vs Stream Processing Difference
Batch Processing vs Stream Processing DifferenceBatch Processing vs Stream Processing Difference
Batch Processing vs Stream Processing Difference
 
Difference between Database vs Data Warehouse vs Data Lake
Difference between Database vs Data Warehouse vs Data LakeDifference between Database vs Data Warehouse vs Data Lake
Difference between Database vs Data Warehouse vs Data Lake
 
Difference between Client Polling vs Server Push vs Websocket vs Long Polling
Difference between Client Polling vs Server Push vs Websocket vs Long PollingDifference between Client Polling vs Server Push vs Websocket vs Long Polling
Difference between Client Polling vs Server Push vs Websocket vs Long Polling
 
Difference between TLS 1.2 vs TLS 1.3 and tutorial of TLS2 and TLS2 version c...
Difference between TLS 1.2 vs TLS 1.3 and tutorial of TLS2 and TLS2 version c...Difference between TLS 1.2 vs TLS 1.3 and tutorial of TLS2 and TLS2 version c...
Difference between TLS 1.2 vs TLS 1.3 and tutorial of TLS2 and TLS2 version c...
 
Difference Program vs Process vs Thread
Difference Program vs Process vs ThreadDifference Program vs Process vs Thread
Difference Program vs Process vs Thread
 
Carrier Advice for a JAVA Developer How to Become a Java Programmer
Carrier Advice for a JAVA Developer How to Become a Java ProgrammerCarrier Advice for a JAVA Developer How to Become a Java Programmer
Carrier Advice for a JAVA Developer How to Become a Java Programmer
 
How to become a Software Tester Carrier Path for Software Quality Tester
How to become a Software Tester Carrier Path for Software Quality TesterHow to become a Software Tester Carrier Path for Software Quality Tester
How to become a Software Tester Carrier Path for Software Quality Tester
 
How to become a Software Engineer Carrier Path for Software Developer
How to become a Software Engineer Carrier Path for Software DeveloperHow to become a Software Engineer Carrier Path for Software Developer
How to become a Software Engineer Carrier Path for Software Developer
 
Events vs Notifications
Events vs NotificationsEvents vs Notifications
Events vs Notifications
 
Microservice Architecture Software Architecture Microservice Design Pattern
Microservice Architecture Software Architecture Microservice Design PatternMicroservice Architecture Software Architecture Microservice Design Pattern
Microservice Architecture Software Architecture Microservice Design Pattern
 
Event Driven Software Architecture Pattern
Event Driven Software Architecture PatternEvent Driven Software Architecture Pattern
Event Driven Software Architecture Pattern
 
Top 5 Software Architecture Pattern Event Driven SOA Microservice Serverless ...
Top 5 Software Architecture Pattern Event Driven SOA Microservice Serverless ...Top 5 Software Architecture Pattern Event Driven SOA Microservice Serverless ...
Top 5 Software Architecture Pattern Event Driven SOA Microservice Serverless ...
 
Observability vs APM vs Monitoring Comparison
Observability vs APM vs  Monitoring ComparisonObservability vs APM vs  Monitoring Comparison
Observability vs APM vs Monitoring Comparison
 
Disaster Recovery vs Data Backup what is the difference
Disaster Recovery vs Data Backup what is the differenceDisaster Recovery vs Data Backup what is the difference
Disaster Recovery vs Data Backup what is the difference
 
What is Spinnaker? Spinnaker tutorial
What is Spinnaker? Spinnaker tutorialWhat is Spinnaker? Spinnaker tutorial
What is Spinnaker? Spinnaker tutorial
 
Difference between Github vs Gitlab vs Bitbucket
Difference between Github vs Gitlab vs BitbucketDifference between Github vs Gitlab vs Bitbucket
Difference between Github vs Gitlab vs Bitbucket
 

Recently uploaded

Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?Watsoo Telematics
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutionsmonugehlot87
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 

Recently uploaded (20)

Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutions
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 

Synchronous vs Asynchronous Programming

  • 1.
  • 2.
  • 3. What is Synchronous programming? In programming, synchronous programs allocate a single thread to handle a request or complete a task. Since synchronous operations happen one at a time, a painstakingly long task like a database query will block all other threads in the meantime. While asynchronous operations can run multiple tasks concurrently on a single thread, synchronous programs have a task queue where every other task remains idle while the first is completed. By definition, synchronous means ‘connected’ or ‘dependent’. In essence, synchronous communication is tightly coupled. For reactive systems, when programs work best when they react to environmental input, synchronous programs can be useful
  • 4. What is Synchronous programming? Synchronous programs use blocking I/O operations in which each operation has to run before the next is executed. Generally, computers are fast, so synchronous communication isn’t necessarily disadvantageous. However, in a real-life, non-technical application, this would be the equivalent of your waiter refusing to bring out any of the dishes you ordered until each and every dish were fully prepared.
  • 5. Benefits of Synchronous programming? Synchronous programming is well-supported amongst all programming languages. Developers do not have to worry about whether it is possible to code asynchronous applications as this is the default. Plus, writing synchronous programs is objectively easier than writing asynchronous programs. In utilizing a blocking I/O architecture you can save time in the software development process and run tests with fewer complications.
  • 6. Benefits of Synchronous programming? Search engines find it easier to crawl for web pages that make use of traditional synchronous architecture. For marketers who depend on search engine optimization (SEO) to build their reputation and brand awareness, this is an appreciable advantage.
  • 7. What is Asynchronous programming? Asynchronous programming relies on a non-blocking input and output (I/O) protocol. This signifies that an asynchronous program does not execute operations in a hierarchical or sequential order. The resulting parallelization means an asynchronous program can take on multiple requests simultaneously and independently. When one request fails, it has no effect on another request. And the program can move to another task before finishing the last. In software development, an advantage of this kind is called loose coupling. Loosely coupled communication and/or programming allows for decentralized processes.
  • 8. What is Asynchronous programming? Fewer dependencies lead to higher fault tolerance and increased flexibility. For businesses that prioritize getting things done, asynchronous programming can be a fundamental building block in meeting project requirements. Imagine a non-technical example of how asynchronous communication would look like in a real-world scenario. As an illustration, envision you’re at a restaurant. Your waiter has just taken multiple orders at your table and brings out your appetizer as soon as it’s ready, instead of waiting for your main entree to be prepared as well. Not only is this simply efficient service, but it’s an exemplary demonstration of a non- blocking I/O or asynchronous architecture.
  • 9. Benefits of Asynchronous programming? In comparing asynchronous and synchronous programming, asynchronous programs improve user experience in a variety of ways. First, all the scripts of a program or web page can load at one time, resulting in better responsiveness and decreased page load delays. And the failure of a thread has no consequence on the ability of other threads to run or render. Therefore, there is more availability overall with asynchronous applications.
  • 10. Benefits of Asynchronous programming? In practice, asynchronous programming requires writing callback functions in line with errors that may occur and disrupt a program. These callbacks instruct the machine to move past the error and run the next task. This also gives programmers the opportunity to write a personalized error message. As a result, errors do not mean that your program altogether fails to run. Users get a nice note while all the other features of the program work just fine.
  • 11.
  • 12. Use case of Synchronous vs Asynchronous For example if you want to download a file from the internet you might use a synchronous function to do that but it will block your thread until the file finished downloading. This can make your application unresponsive to any user input. Instead you could download the file in the background using asynchronous method. In this case the download function returns immediately and program execution continues normally. All the download operations are done in the background and your program will be notified when it's finished.
  • 13. Use case of Synchronous vs Asynchronous When you execute something synchronously, you wait for it to finish before moving on to another task. When you execute something asynchronously, you can move on to another task before it finishes. Synchronous execution means the execution happens in a series a->b->c->d. If you are calling methods ‘a ‘will run first and then when ‘a’ finish then ‘b’ will start. With Asynchronous execution , you can start with ‘a’, and then ‘a’ can go in background and we don’t need to wait for ‘a’ to finish, ‘b’ can start parallely.
  • 14. Use case of Synchronous vs Asynchronous The biggest contribution that asynchronous programming provides is enhanced throughput. Throughput refers to the deliverables a product or company can produce within a specified time. As established, computers are fast. Thus, synchronous programming is not as time-consuming as you might imagine. If you merely wish to develop a front-end application or execute a basic central process unit (CPU) function, then asynchronous programming is way out of bounds.
  • 15.
  • 16. Use case of Synchronous User Interfaces: User interface (UI) designs are typically synchronous. Since UIs are spaces where humans and computers interact, it is ideal for them to replicate the communication standards and practices humans are familiar with. Humans expect an immediate response when they interact with a computer! •HTTP APIs: HTTP APIs pass requests and responses in a synchronous fashion. Client programs sending HTTP requests usually expect a fast answer from the web server. Use case of Asynchronous •Batch-processing: is a data-processing method to handle large amounts of data asynchronously. With asynchronous batch-processing, large batches of data are processed at scheduled times to avoid blocking computing resources. •Long-running tasks: such as fulfilling an order placed on an e-commerce site are best handled asynchronously. There is no need to block resources while this task is executed.
  • 17. Summary Synchronous and asynchronous, also known as sync and async, are two types of programming models. At an abstract level, programming models define how software is designed and executed. The basic programming models are synchronous, but asynchronous models are critical for performance reasons and to more efficiently use computing resources. Programming languages usually have built-in primitives to deal with asynchronous programming. Asynchronous programming is a style of programming in which the execution of a task is not guaranteed to occur in a specific order. This contrasts with synchronous programming, where all code execution is guaranteed to happen in a specific order.
  • 18. THANK YOU Like the Video and Subscribe the Channel