explaingit

netflix/falcor

10,566JavaScriptAudience · developerComplexity · 3/5Setup · moderate

TLDR

Falcor is a JavaScript library from Netflix that lets your web app request data from a single virtual JSON document instead of many API endpoints, automatically caching results and fetching only what is missing.

Mindmap

mindmap
  root((falcor))
    What it does
      Unified data layer
      Virtual JSON doc
      Auto-caching
    How it works
      Server Router
      Client Model
      Path requests
    Use Cases
      Reduce API calls
      Cache responses
      Data-heavy apps
    Setup
      Node.js server
      Browser client
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Replace multiple REST API calls in a single-page app with one unified data model that caches responses automatically

USE CASE 2

Build a Node.js server Router that maps virtual JSON paths to real database queries for a web application

USE CASE 3

Reduce bandwidth in a data-heavy dashboard by letting Falcor request only the specific data fields the UI needs

Tech stack

JavaScriptNode.js

Getting it running

Difficulty · moderate Time to first run · 1h+

Requires familiarity with Node.js and understanding of server-side routing concepts.

In plain English

Falcor is a JavaScript library built by Netflix that gives your web application a single, unified place to ask for data. Instead of making many separate requests to different server endpoints, your app talks to one virtual JSON document and asks for exactly the pieces it needs. Falcor figures out how to fetch only what is missing, caches what it already has, and returns everything as if it all came from one clean object. On the server side, you define a Router that maps paths in that virtual JSON document to real data sources, whether those are databases, other APIs, or anything else. The Router responds to requests by filling in the requested paths with actual values. Falcor ships with middleware for popular Node.js web frameworks so you can serve this virtual document at a URL like /model.json without writing a lot of boilerplate. On the client side, your JavaScript code creates a Model object that points to the server URL. You then call get with a list of paths you want, and the Model returns a plain JavaScript object with those values filled in. It handles caching automatically, so if your app asks for the same data twice, the second request never leaves the browser. The current stable release is version 2.0, with migration guides available for anyone upgrading from older versions. The project is maintained by Netflix and accepts community contributions through pull requests, with a public roadmap tracked through labeled GitHub issues covering enhancements, stability, performance, tooling, infrastructure, and documentation. Falcor is best suited for JavaScript developers building data-heavy applications who want to reduce the number of round trips between client and server. It requires familiarity with Node.js and a basic understanding of how web servers and APIs work, though the getting-started tutorial walks through setting up a minimal working example from scratch.

Copy-paste prompts

Prompt 1
Show me how to set up a Falcor Router on a Node.js Express server that maps paths to a database and returns data to a client Model.
Prompt 2
Write a client-side Falcor Model that fetches a list of items from /model.json and caches results between requests.
Prompt 3
How do I migrate a REST API to Falcor so my React app can request exactly the data fields it needs?
Prompt 4
Create a Falcor route that retrieves user profile data from a database and returns it as a virtual JSON path.
Open on GitHub → Explain another repo

← netflix on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.