APIs Flashcards

1
Q

What are the similarities and differences between REST and gRPC?

A

gRPC is an implementation of the RPC model that uses protocol buffers and HTTP 2 for binary data transmission.

REST is an architectural style composed of a set of constraints that define how distributed systems should communicate.

Similarities:
1. Both use HTTP as their communication protocol
2. Both are stateless

Differences:
1. REST uses HTTP 1 and gRCP uses HTTP 2
2. REST supports JSON, HTML, and XML and gRPC supports Protocol Buffers and JSON
3. REST is loosely coupled and gRPC is tightly coupled since both client and server must have access to the same proto file
4. REST can be used for both public and internal systems and gRPC is normally used for internal systems

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

What is gRPC and how does it work?

A

gRPC is an implementation of the RPC model that uses Protocol Buffers and HTTP 2 for data transmission.

At the heart of gRPC is a proto file that contains service and message definitions that make up your API. Once the proto file is created, you use the protoc compiler to generate client and server libraries. You can then use these libraries to implement communication between your applications.

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

How does API Gateway work?

A

Essentially, you define an API using the OpenAPI 2.0 specification and then use it to create an API Config. Once the API Config is created, you can use it to deploy an API on API Gateway.

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

Does API Gateway support gRPC?

A

API Gateway currently supports gRPC for backend applications that use gRPC and are deployed on Cloud Run. This requires additional configuration but it can be done.

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

Are API Configs mutable or immutable?

A

API Configs are immutable. This means whenever an update to an API is needed, a new API Config needs to be created.

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

What are the 3 API management services that GCP offers?

A
  1. Apigee
  2. API Gateway
  3. Cloud Endpoints

Apigee is fully managed, can run on any environment, and has the most features.

API Gateway is fully managed, runs only on GCP, and has less features than Apigee.

Cloud Endpoints is user-managed, can run on multiple environments, and has less features than Apigee. You must provision your own deployment environment to host your API (ESP2).

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

Does Cloud Endpoints support gRPC?

A

Yes

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

What are the 2 different API models that most GCP services support?

A
  1. HTTP REST
  2. gRPC
How well did you know this?
1
Not at all
2
3
4
5
Perfectly