liveBook · Manning

Remote data

As explained in React in Depth

Remote data is application data retrieved from an external service or system rather than stored solely within the application.

Remote data is application data retrieved through communication with an external service rather than stored only in the browser. It lets users and devices work with shared data, unlike local storage, but introduces network latency and backend concerns. section 9.0 section 9.1

Treat remote data as an architectural boundary with several practical consequences:

  • Requests send data to a server and responses return data to the application, so operations may take seconds rather than milliseconds. section 9.1
  • Shared data requires concerns beyond React, including authentication, authorization, password recovery, two-factor authentication, database efficiency, and concurrent updates. section 9.1
  • A local mock server can reproduce the application-facing behavior of a remote service without exposing a backend or requiring a database and security system. section 9.1

A local application behaving like a remote client

An MSW intercept backend can make React believe it is communicating with a live web server while keeping the underlying data local. This supports realistic remote-data development without building the production backend first. section 9.1

Figure 9.2 With our fake MSW (Mock Service Worker) intercept backend, React (or any other web application) will think that it’s interacting with a real, live, web server when it’s interacting with our middleware. We can create a React application as though we have a real backend without building said backend; we don’t have to worry about databases, security, or anything like that.
figure

Shows how an MSW middleware layer gives a web application the interface of a real server while avoiding databases and security infrastructure. section 9.1

How React in Depth covers it

How deep it goes
Explains requests, responses, latency, security, and mocked-server behavior, but defers implementing production backend frameworks and databases.
Examples
Uses shared social posts, a local-versus-remote request flow, and an MSW intercept backend as concrete examples.
What it assumes
Assumes React fundamentals and local browser storage, while treating backend implementation, databases, and security as deferred concerns.
What you can do after
Apply it via MSW to build a React client against a realistic server boundary before implementing the production backend.
How it connects
Connects remote data with local storage, server communication, network latency, authentication, databases, and reactive caching.

Also explained in

Compare how 2 books explain remote data →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of React in Depth. The section links point to the parts of the book it draws on.