You are building an API that will be used by Android and iOS apps. The API must:
* Support HTTPs
* Minimize bandwidth cost
* Integrate easily with mobile apps
Which API architecture should you use?
You are building an API that will be used by Android and iOS apps. The API must:
* Support HTTPs
* Minimize bandwidth cost
* Integrate easily with mobile apps
Which API architecture should you use?
For building an API that will be used by Android and iOS apps, which must support HTTPS, minimize bandwidth costs, and integrate easily with mobile apps, a gRPC-based API is the most suitable choice. gRPC supports HTTP/2, which is more efficient in terms of bandwidth and performance compared to HTTP/1.1 used by REST. It uses Protocol Buffers (protobuf) for encoding data, which is a compact binary format that further reduces bandwidth usage. Also, gRPC provides easy integration with mobile applications by generating client libraries for multiple programming languages, including those used in Android (Java/Kotlin) and iOS (Objective-C/Swift). This makes it a robust and efficient solution for mobile APIs.
In't C (gRPC) better because of the lower bandwidth (binary format)? It can be used in mobile apps and supports HTTP(s)
Probably A is the best solution for "Integrate easily with mobile apps" requirement
To support HTTPS, minimize bandwidth cost, and integrate easily with mobile apps, you should use gRPC-based APIs (C). gRPC (gRPC Remote Procedure Calls) is a modern, high-performance, open-source remote procedure call (RPC) framework that can be used to build APIs. It uses HTTP/2 as the underlying transport protocol and Protocol Buffers as the encoding format. gRPC is designed to be low-bandwidth, low-latency, and easily integrable with mobile apps. It also supports HTTPs out of the box. RESTful APIs (A) are a popular choice for building APIs, but they may not be as efficient as gRPC in terms of bandwidth usage, especially for APIs that transfer large amounts of data. MQTT (B) is a lightweight messaging protocol that is often used in IoT applications, but it may not be as well-suited for building APIs as gRPC. SOAP-based APIs (D) are an older style of API that has largely been replaced by more modern alternatives like gRPC.
Agreed Option A is correct
A is correct
REST APIs are not bound to client-side technology. This allows you to access these APIs from a client-side web project, iOS app, IoT device, or Windows phone. In the problem statement, they mentioned iOS and Android. It is not officially supported by gRPC So that points to option A, otherwise, C is nearest.
I think that the best answer is C: - gRPC supports HTTPS; - minimize bandwidth because use a binary payload; - It is easy to integrate because it generate stubs and skeletons that hide the connection details. https://cloud.google.com/blog/products/api-management/understanding-grpc-openapi-and-rest-and-when-to-use-them
https://www.imaginarycloud.com/blog/grpc-vs-rest/ gRPC architectural style has promising features that can (and should) be explored. It is an excellent option for working with multi-language systems, real-time streaming, and for instance, when operating an IoT system that requires light-weight message transmission such as the serialized Protobuf messages allow. Moreover, gRPC should also be considered for mobile applications since they do not need a browser and can benefit from smaller messages, preserving mobiles' processors' speed.
The correct is C
gRPC supports ios and andriod also.
gRPC-based APIs
https://www.exam-answer.com/api-architecture-for-android-ios-apps#:~:text=The%20most%20suitable%20API%20architecture,used%20for%20building%20web%20APIs.
Answer is C: gRPC is a high-performance, open-source universal RPC framework which supports IOS and Android as well.
C is correct as it supports IOS and Android with low latency.
A, according to https://www.exam-answer.com/api-architecture-for-android-ios-apps
I'm going with gRPC was it is a Google Product, and we're talking about a GCP exam, so... REST APIs would still serve the purpose though.
C. gRPC-based APIs are designed to minimize bandwidth by using Protocol Buffers, a method of serializing structured data in an efficient and extensible format. gRPC is modern, fast, and supports HTTPS by default. It also provides features like streaming and efficient connection management, which can be advantageous for mobile apps that require efficient use of bandwidth and battery life.
For an API designed for mobile apps with the requirements you've outlined, a RESTful API architecture is the most suitable choice. Here's why: RESTful API Advantages: HTTPs Support: REST APIs are built on top of HTTP, making HTTPS integration seamless. Bandwidth Minimization: REST APIs are designed for efficient data transfer. They use standard HTTP methods (GET, POST, PUT, DELETE) for CRUD operations, minimizing the amount of data sent over the network. Easy Mobile Integration: REST APIs are widely understood and supported by mobile development frameworks (like Android's Retrofit and iOS's Alamofire). They use JSON as a standard data format, which is easily parsed by mobile apps.
Why Other Architectures Might Not Be Ideal: SOAP: While SOAP supports HTTPS, it's more complex and verbose, leading to higher bandwidth usage and potentially more difficult integration with mobile apps. GraphQL: GraphQL is excellent for flexible data fetching, but it can be more complex to implement and might not be as widely supported by mobile development frameworks as REST. Additional Tips for Bandwidth Optimization: Data Compression: Use gzip compression to reduce the size of data transferred. Caching: Implement caching mechanisms on both the server and client sides to reduce redundant data requests. API Versioning: Use versioning to avoid breaking changes and allow for gradual updates. Pagination: For large datasets, implement pagination to fetch data in smaller chunks.