SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML DiagramsManish Kumar
 
Garbage collection
Garbage collectionGarbage collection
Garbage collectionMudit Gupta
 
Transactions and Concurrency Control
Transactions and Concurrency ControlTransactions and Concurrency Control
Transactions and Concurrency ControlDilum Bandara
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingMoutaz Haddara
 
Use case Diagram
Use case Diagram Use case Diagram
Use case Diagram Rahul Pola
 
Software Engineering :UML class diagrams
Software Engineering :UML class diagramsSoftware Engineering :UML class diagrams
Software Engineering :UML class diagramsAjit Nayak
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)swapnac12
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemorySHIKHA GAUTAM
 
Query Decomposition and data localization
Query Decomposition and data localization Query Decomposition and data localization
Query Decomposition and data localization Hafiz faiz
 
Unified process model
Unified process modelUnified process model
Unified process modelRyndaMaala
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops conceptsNilesh Dalvi
 
Join ordering in fragment queries
Join ordering in fragment queriesJoin ordering in fragment queries
Join ordering in fragment queriesIfzalhussainkhan
 

Mais procurados (20)

An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML Diagrams
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
 
Garbage collection
Garbage collectionGarbage collection
Garbage collection
 
Transactions and Concurrency Control
Transactions and Concurrency ControlTransactions and Concurrency Control
Transactions and Concurrency Control
 
Class diagrams
Class diagramsClass diagrams
Class diagrams
 
Oops ppt
Oops pptOops ppt
Oops ppt
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
 
Use case Diagram
Use case Diagram Use case Diagram
Use case Diagram
 
Software Engineering :UML class diagrams
Software Engineering :UML class diagramsSoftware Engineering :UML class diagrams
Software Engineering :UML class diagrams
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared Memory
 
chapter 2 architecture
chapter 2 architecturechapter 2 architecture
chapter 2 architecture
 
Query Decomposition and data localization
Query Decomposition and data localization Query Decomposition and data localization
Query Decomposition and data localization
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Types of Compilers
Types of CompilersTypes of Compilers
Types of Compilers
 
Model View Controller (MVC)
Model View Controller (MVC)Model View Controller (MVC)
Model View Controller (MVC)
 
Unified process model
Unified process modelUnified process model
Unified process model
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops concepts
 
Join ordering in fragment queries
Join ordering in fragment queriesJoin ordering in fragment queries
Join ordering in fragment queries
 

Semelhante a 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
 
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
 
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
 
Advanced computer architecture unit 5
Advanced computer architecture  unit 5Advanced computer architecture  unit 5
Advanced computer architecture unit 5Kunal Bangar
 
Web services-synchronous-or-asynchronous
Web services-synchronous-or-asynchronousWeb services-synchronous-or-asynchronous
Web services-synchronous-or-asynchronousAravindharamanan S
 

Semelhante a 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
 

Mais de jeetendra 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
 
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
 

Mais de 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
 

Último

CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfFurqanuddin10
 
APVP,apvp apvp High quality supplier safe spot transport, 98% purity
APVP,apvp apvp High quality supplier safe spot transport, 98% purityAPVP,apvp apvp High quality supplier safe spot transport, 98% purity
APVP,apvp apvp High quality supplier safe spot transport, 98% purityamy56318795
 
The Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionThe Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionWave PLM
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabbereGrabber
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Krakówbim.edu.pl
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024Shane Coughlan
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1KnowledgeSeed
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Andrea Goulet
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfMehmet Akar
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Soroosh Khodami
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAlluxio, Inc.
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfVictor Lopez
 
Workforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdfWorkforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdfDeskTrack
 
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfStrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfsteffenkarlsson2
 
How to pick right visual testing tool.pdf
How to pick right visual testing tool.pdfHow to pick right visual testing tool.pdf
How to pick right visual testing tool.pdfTestgrid.io
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersEmilyJiang23
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfmbmh111980
 
IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024vaibhav130304
 

Último (20)

CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdf
 
APVP,apvp apvp High quality supplier safe spot transport, 98% purity
APVP,apvp apvp High quality supplier safe spot transport, 98% purityAPVP,apvp apvp High quality supplier safe spot transport, 98% purity
APVP,apvp apvp High quality supplier safe spot transport, 98% purity
 
The Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionThe Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion Production
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabber
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Kraków
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdf
 
AI Hackathon.pptx
AI                        Hackathon.pptxAI                        Hackathon.pptx
AI Hackathon.pptx
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
 
Workforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdfWorkforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdf
 
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfStrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
 
How to pick right visual testing tool.pdf
How to pick right visual testing tool.pdfHow to pick right visual testing tool.pdf
How to pick right visual testing tool.pdf
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java Developers
 
Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
 
IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024
 

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