crackyourinterview.com


To improves our performance please Like Share Subscribe(Will boost us)

Write down main difference between REST and WebSocket
Question Posted on 16 Jun 2022Home >> REST >> REST Questions >> Write down main difference between REST and WebSocket

Write down main difference between REST and WebSocket
Below are main difference in between REST and WebSocket:-
0
0

Base of DifferenceRESTWebSocket
Based onREST is mainly based on CRUD operation.WebSocket is low-level protocol which is based on concept of socket and port which are underlying transport mechanism.
HTTPHTTP is one of the common protocol in RESTful web services.Here use of HTTP occurs in initial connection.
DirectionREST is Uni-directional in nature.Where as WebSocket is Bi-directional in nature.
StateAs we knows REST is based on HTTP which is stateless protocol.WebSocket is stateful protocol.
NatureREST is mainly based on resource rather than commands.This have Socket-based concept.
CostWhen we say about COST REST based communication is comparatively higher in cost.WebSocket communication cost is lower.
Client Server approachWhen we say about REST base approach either client is talking to client or server is talking to the client at any given time.In WebSocket communication allows the client and server to talk independently of each other.
PerformanceGreat for occasional communication or we can say for an HTTP request, a new TCP connection is initiated.WebSocket works better, where the client-server communicates over the same TCP connection for the life of web socket connection or we can say better with high loads.
Live ExampleREST is better fitted for occasional communication in a typical GET request scenario to call RESTful APIs.As we knows that it is ideal for scenrio where we have high loads just like real-time scalable chat application is an example.
ScaleREST is HTTP based which can scale horizontally.WebSocket connection can scale vertically on single server.
Best forREST is better suited for the scenario with lots of getting request.WebSocket approach is always ideal for real-time scalable application.
Use ofRESTful application needs to design operation based on verbs and HTTP based. WebSocket requires the use of IP address and Port details, which are lower-level details for any application.



.


Most Visited Questions:-

Deep Learning Questions Answers
Below are the different Deep Leaning Questions and answer a More...

What is Gulpjs and some multiple choice questions on Gulp
Gulpjs is an open source whihc helps in building Javascript More...

Continuous Integration Questions Answers
Below are the 20 odd questions for CI or Continuous Integra More...

Derived relationships in Association Rule Mining are represented in the form of __________.
Derived relationships in Association Rule Mining are repres More...

Microservices Architecture Questions Answers
Below are the different questions on Microservices Architec More...




Other Important Questions

Can you mention the disadvantages of RESTful web services?

Can we send payload in the GET and DELETE methods?

Define main difference in between REST and RESTful?

Write down main difference between REST and WebSocket

Why we used REST APIs and some example?






@2014-2022 Crackyourinterview (All rights reserved)
Privacy Policy - Disclaimer - Sitemap