API Flashcards

1
Q

RPC

A
  • Utilizes a method invocation paradigm
  • client calls a specific procedure or function on a remote server.
  • synchronous communication.
  • gRPC Is a specific implementation of RPC developed by Google.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Use cases of 4 RestFul, 2 RPC, 2 Graphql

A

RPC:
* in microservices architectures
* communication between services is frequent and performance is critical.

Restful:
* Ideal for systems with a large number of clients requiring standard CRUD operations on resources.
* client-server communication
* scalability is important.
* cacheability is important.

Graphql
* complex data-fetching scenarios
* client’s requirements are constantly evolving.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Tradeoffs of RestFul, RPC, Graphql in terms of Perfomance, Compexity

A

Performance:
* RPC tends to be more efficient for simple, synchronous communication
* GraphQL may be more efficient for complex queries due to its ability to fetch only the required data.
* RESTful APIs fall somewhere in between.
*
Complexity:
* RPC can become complex as the system grows due to tight coupling between client and server.
* RESTful APIs offer simplicity in terms of uniform interfaces but may suffer from over-fetching or under-fetching.
* * GraphQL can be complex to set up initially but offers simplicity for clients and avoids over-fetching/under-fetching.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Long polling vs websocket vs SSE

A

Long Polling:
Pros: Simple to implement, works on most web servers.
Cons: Increased latency, higher server load.
Use Cases: Legacy systems, simple applications with low traffic.

WebSockets:
Pros: Low latency, bidirectional communication.
Cons: Requires server-side support, may be blocked by some proxies/firewalls.
Use Cases: Real-time applications like chat, gaming, collaborative editing.

Server-Sent Events (SSE):
Pros: Simple implementation, built-in reconnection mechanisms.
Cons: Unidirectional (server to client) communication only.
Use Cases: News feeds, real-time notifications, server-initiated updates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Http2 vs Http3

A

HTTP/2:
Pros: Multiplexing, header compression, server push, binary format.
Cons: Head-of-Line Blocking, complexity.
usecase: Faster loading of web pages with multiple resources.

HTTP/3:
Pros: QUIC protocol, multiplexing, improved security, faster recovery.
Cons: Limited browser/server support, potential overhead.
usecase:Real-time applications online gaming, Streaming video with reduced latency and improved reliability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly