Urgent.News

What's breaking now, across thousands of outlets.

Tech

REST vs SOAP vs GraphQL vs gRPC — Interview Notes for Backend Engineers

I have shipped REST APIs for four years (Flask, AWS Lambda + API Gateway, FastAPI). This is the reference I use in design reviews and phone screens — focused on when to pick each style, not memorising definitions. Companion on Medium: REST vs SOAP vs GraphQL vs gRPC: How I Actually Choose — decision framework with trade-offs. 1. REST in 60 seconds REST models resources (nouns) and uses HTTP…

In this account, I will discuss the differences between REST, SOAP, GraphQL, and gRPC, as well as the key factors interviewers look for when choosing an API style. REST APIs are based on resources (nouns) and HTTP methods (verbs). They use a stateless approach with safe and idempotent requests, and provide representations usually in JSON format.

When choosing an API style, consider if the API is public or mobile, if there is a need for different client slices, if over-fetching is a concern, or if the API will be used internally for service-to-service communication.

REST APIs are the most common choice for public or mobile APIs due to their browser-friendly nature and natural caching with GET requests. They work well for public or mobile APIs and are easy to implement with JSON payloads. However, for internal service-to-service communication, gRPC may be more suitable due to its low latency and typed generated clients.

SOAP APIs are best for enterprise partner contracts or when one side requires a contract, such as in finance or government integrations. GraphQL APIs are an option when different clients require varying slices of data, as they allow clients to request only the necessary fields. Lastly, WebSockets can be used for live updates after the initial load, but are better suited for private APIs rather than public mobile APIs.

In summary, when deciding between REST, SOAP, GraphQL, and gRPC, consider the API's intended use, the need for different client requirements, and the level of internal service-to-service communication. For public or mobile APIs, REST is often the best choice, while SOAP is more appropriate for enterprise partnerships. GraphQL is useful for clients needing specific data fields, and gRPC shines for internal, high-performance service-to-service communication.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Idempotency Keys for Python Payment APIs

A user double-taps Pay. The network retries. Your API creates two orders for one charge. POST is not idempotent. If you handle payments without an idempotency strategy, you will eventually ship a bug…

  • Idempotency keys prevent duplicate charges in Python payment APIs.
  • Client generates unique key for each user action, included in retry requests.
  • Server processes first request with key, stores response for duplicates.

Your Compute-Usage Receipt Can Be Cryptographically Signed and Still Be Forged. Here's the One Field That Actually Prevents It, From the Command Line.

Co-authored by Rudrendu Paul and Sourav Nandy . Repo: github.com/RudrenduPaul/ComputeLedger , Apache-2.0. npm install -g computeledger-cli (Node.js 18+) or pip install computeledger-cli (Python…

  • Cryptographic signatures alone cannot guarantee receipt authenticity
  • Public key should be included in signed payload, not separately
  • Hashing entire payload with public key prevents forgery

“We’re not doing 30 bets a year”: Vijay Pande on betting small after running $4 billion at a16z

Vijay Pande — who left a16z's roughly $4 billion biotech practice last year to start the much smaller, AI-native VZVC — talks about why biology is finally shifting from a "discovery" science to an…

  • Vijay Pande shifted from $4B at a16z to founding VZVC
  • AI advances enable more accurate drug development and treatment
  • Low 20% success rate due to animal model inaccuracies

More from Saturday 29 August →