Caching Strategies Explained: Cache-Aside, Write-Through and Write-Back
Caching strategies and their trade-offs: cache-aside, read-through, write-through, write-back and write-around, plus eviction policies, TTLs and invalidation.
REST vs gRPC vs GraphQL compared: how each works, performance, contracts, caching, streaming, tooling and browser support, and when each API style fits best.

REST, gRPC and GraphQL are three ways to design APIs, and each fits a different job. REST models resources over plain HTTP and is the easiest to adopt, cache and consume; it’s the default for public APIs. gRPC is a remote procedure call framework using HTTP/2 and Protocol Buffers, ideal for fast, strongly typed calls between internal services. GraphQL exposes a typed schema that clients query for exactly the data they need, which suits front ends with many different screens. Many systems use more than one.
REST (representational state transfer) organises an API around resources, identified by URLs, and manipulated with standard HTTP methods: GET /orders/42, POST /orders, PATCH /orders/42. Responses are usually JSON, and HTTP status codes signal outcomes.
Strengths
Weaknesses
gRPC is an open-source RPC framework originally developed at Google. You define services and messages in a .proto file; tooling generates client and server code in many languages. Calls travel over HTTP/2 as compact binary Protocol Buffers.
Strengths
Weaknesses
GraphQL, developed at Facebook and open-sourced in 2015, is a query language plus a typed schema. Clients send a query describing exactly the fields they want, usually to a single endpoint, and get back JSON in the same shape.
query {
order(id: 42) {
status
total
customer { name }
items { name quantity }
}
}
Strengths
Weaknesses
| REST | gRPC | GraphQL | |
|---|---|---|---|
| Transport | HTTP/1.1 or HTTP/2 | HTTP/2 | Usually HTTP |
| Payload | Usually JSON | Protocol Buffers (binary) | JSON |
| Contract | Optional (OpenAPI) | Required (.proto) | Required (schema) |
| Browser support | Native | Needs gRPC-Web and a proxy | Native |
| HTTP caching | Excellent | Limited | Limited without persisted queries |
| Streaming | Via other protocols | Built in | Subscriptions |
| Best fit | Public APIs, simple services | Internal microservices | Rich client apps |
Whatever you choose, the same problems need solving:
A common architecture uses gRPC between internal services, with a REST or GraphQL layer at the edge for clients. How many services you have matters too; our microservices vs monolith framework helps decide whether you need internal APIs at all.
Usually, for service-to-service calls: binary payloads and HTTP/2 multiplexing reduce overhead. For many public APIs, network latency and database work dominate, so the difference matters less.
No. It solves a different problem, flexible client queries, and it often sits in front of existing REST or gRPC services.
Yes, and many companies do: gRPC internally, REST for public APIs and GraphQL for their own front ends.
Every article is edited by a human and checked against our editorial policy. Spotted a mistake? Tell us.
Caching strategies and their trade-offs: cache-aside, read-through, write-through, write-back and write-around, plus eviction policies, TTLs and invalidation.
Rate limiting algorithms compared: fixed window, sliding log, sliding window counter, token bucket and leaky bucket, with code and distributed design tips.
Kafka, RabbitMQ and Amazon SQS compared: log vs queue models, ordering, replay, throughput, delivery guarantees and operations, and when to use each.