Never miss the cache again.

Cache every single thing your app could ever do ahead of time, so your code never even has to run at all.

cache-advance.config.js
package.json
export default {
strategy: 'predictive',
engine: {
cpus: 12,
backups: ['./storage/cache.wtf'],
},
}

Fluid Framework Documentation

Build powerful collaborative applications with Microsoft Fluid Framework. Create real-time experiences where multiple users can work together seamlessly.

Getting Started

Install Fluid Framework and build your first collaborative app in minutes.

Examples

Explore working examples from simple counters to complex collaborative editors.

User Guides

Learn collaboration patterns, data structures, and performance optimization.

API Reference

Complete API documentation for all Fluid Framework packages and interfaces.

Fluid Framework enables real-time collaboration by providing distributed data structures that automatically synchronize changes across multiple clients, handle conflicts intelligently, and work offline with seamless reconnection.


Quick Start

Get up and running with Fluid Framework in under 10 minutes. Install the packages, start the local service, and create your first collaborative application.

Installation

Install the core Fluid Framework packages for your project:

# Core packages for building Fluid apps
npm install @fluidframework/azure-client @fluidframework/map

# For local development
npm install -g @fluidframework/tinylicious

Start the local Fluid service for development:

npx tinylicious

Local Development

Tinylicious provides a minimal Fluid service perfect for development. For production, you'll use Azure Fluid Relay or host your own service.

Your First Collaborative App

Create a simple collaborative counter that syncs across multiple browser windows:

import { TinyliciousClient } from "@fluidframework/tinylicious-client";
import { SharedMap } from "@fluidframework/map";

// Define your app's data structure
const containerSchema = {
    initialObjects: {
        counterMap: SharedMap,
    },
};

// Create a Fluid client
const client = new TinyliciousClient();

async function start() {
    // Create or get existing container
    const { container } = await client.createContainer(containerSchema);
    const counterMap = container.initialObjects.counterMap;

    // Initialize counter if it doesn't exist
    if (!counterMap.has("count")) {
        counterMap.set("count", 0);
    }

    // Listen for changes from other clients
    counterMap.on("valueChanged", () => {
        document.getElementById("counter").textContent = counterMap.get("count");
    });

    // Update the display
    document.getElementById("counter").textContent = counterMap.get("count");

    // Add click handler
    document.getElementById("increment").onclick = () => {
        const current = counterMap.get("count") || 0;
        counterMap.set("count", current + 1);
    };
}

start();

Real-time Collaboration

Open the same app in multiple browser windows and click the increment button. Watch the counter update in real-time across all windows!


Core Concepts

Fluid Framework is built around a few key concepts that make real-time collaboration simple and reliable.

Distributed Data Structures (DDS)

Fluid's distributed data structures automatically synchronize state across all connected clients. Think of them as "shared variables" that multiple users can modify simultaneously.

// SharedMap - like a JavaScript Map but collaborative
const myMap = container.initialObjects.myMap;
myMap.set("userName", "Alice");
myMap.set("status", "online");

// SharedString - collaborative text editing
const textEditor = container.initialObjects.textEditor;
textEditor.insertText(0, "Hello, ");
textEditor.insertText(7, "world!");

// SharedSequence - collaborative arrays
const taskList = container.initialObjects.taskList;
taskList.insert(0, [{ id: 1, text: "Buy groceries", done: false }]);

Containers

Containers encapsulate your collaborative data and provide a boundary for sharing. Each container has a unique ID that clients use to connect to the same shared state.

// Create a new container
const { container } = await client.createContainer(schema);

// Or join an existing container
const { container } = await client.getContainer(containerId, schema);

Event-Driven Updates

Listen for changes made by other users and update your UI accordingly:

sharedMap.on("valueChanged", (changed, local) => {
    if (!local) {
        console.log(`${changed.key} was changed by another user`);
        updateUI();
    }
});

What's Next?

Ready to build your own collaborative application? Here are the best next steps:

Learn by Example

Start with working code examples that demonstrate key concepts:

Dive Deeper

Explore advanced topics and patterns:

Get Help

Join the Fluid Framework community:

  • GitHub: microsoft/FluidFramework - Source code, issues, and discussions
  • Documentation: fluidframework.com - Official documentation site
  • Stack Overflow: Tag questions with fluid-framework
  • Discord: Join our community chat for real-time help

Deploy to Production

When you're ready to go live: