NextJS + Socket.io Tutorial
Session backends are great for document-editing apps, which often load the entire document into memory and apply changes to the in-memory document. (Here, a document may be a text document, spreadsheet, vector graphic, image, or video, etc). For these kinds of applications, the session backend acts as a stateful layer between your client and storage (i.e. a database or blob store). The session backend is a place to…
- quickly handle edits to the in-memory document
- persist changes to your storage of choice in the background
This makes it easier to support collaborative editing features and synchronize your document state between several users and a backing store. Using a session backend to update an in-memory document during the user session also lets you use inexpensive blob storage (like S3) when the document is not being edited. (Read more about session backends in our blogpost about them.)
Let’s see how this can work by building a whiteboard app with multiplayer editing and presence features. Here’s a little preview of what we’re building in this tutorial: