---
title: "What is incremental computation?"
description: "What is IC and how does Fold make use of it?"
image: "https://docs.flowercomputer.com/og/base.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.flowercomputer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# What is incremental computation?

## Incremental computation

Fold is a datastream oriented approach to incremental computation (IC). Incremental computation roughly means doing as little work as possible to resolve an output when an input to a program changes. It's a well established research domain in computer science that is used in many different domains [from spreadsheets](https://lord.io/spreadsheets/), [to compilers](https://rustc-dev-guide.rust-lang.org/queries/incremental-compilation.html), to various [web rendering frameworks](https://blog.janestreet.com/incrementality-and-the-web/).

In the database field, IC is generally referred to as Incremental View Maintenance (IVM), and is less well established. The academic activity around IVM is rich, but has only started to permeate the database project and product world in the past few years. Even then, it's really only been leveraged in systems oriented for big data workflows ([Materialize](https://materialize.com/guides/incremental-computation/)) or caching portions of query sets ([ReadySet](https://readyset.io/)). Generally this seems to be a result of the research being fairly complex and existing database runtimes using architectures that make integrating IVM concepts difficult (although some IVM postgres plugins are [gaining traction](https://github.com/sraoss/pg_ivm)).

However, we think it's worth the effort to build IC and IVM theory into a more easy to use library, as databases are the perfect use case for these concepts. If you've ever worked on a relational database, you've probably already implemented some IVM concepts manually without realizing it (e.g. a trigger incrementing a `Posts.comment_count` column instead of joining to the `Comments` table). Imagine a world where any desired query has been eagerly computed far before any client asks for it! This world is possible.

Fold is our basic building block for this new architecture — we built it with simplicity and speed in mind. As you use Fold and learn more about it, you'll see that its interfaces look and act fuzzily like functional programming style iterators you've seen before.

Source: https://docs.flowercomputer.com/appendix/incremental/index.md
