![]() We regularly see files that are tens of megabytes as a compressed binary and hundred of megabytes when loaded in memory. It turns out that our users can and do create very large documents. We refer to it as the scenegraph and it is our central data structure. In Figma, documents are represented as a tree of layers (nodes). Unfortunately, in the context of a cloud-based application, this approach isn’t practical both from a technical and product standpoint. There’s not much room for things to go wrong in this approach. Restoring lost changes is as simple as opening the backup. The most intuitive way to save a document is how it has always been done: serialize the in-memory representation of the document as a backup file and write it to disk. Now, in the process of examining autosave, we’ll see how how supporting multiplayer adds a lot of complexity to other features too. We’ve written about how we handle conflict resolution in multiplayer before. Figma’s central paradigm is being a browser-based, cloud-based, and realtime application. But as it often happens, interesting challenges lie not in individual features, but the interaction between them. When the user next reloads this document in a new tab, the changes will be restored and uploaded to the server.īut why does such a feature warrant a blog post? “Saving the file to disk periodically” isn’t exactly a groundbreaking innovation. With our newly expanded autosave system, edits now save to disk when a document becomes disconnected from the server so changes to the document persist-even if the tab with Figma closes. Until recently, users ran the risk of losing data should something happen to their computer or browser while offline. In online applications like Figma, we flush changes to the server as soon as they’re made offline changes can’t sync with the server until you reconnect to the internet. After all, we’ve all had an unlucky circumstance in which we closed the application accidentally, it crashed, or we lost power-and hours of work. ![]() It wasn’t so long ago that software made you hit the save key obsessively. Engineer Rudi Chen takes us behind the scenes of building this update: how we made product decisions, managed large merge conflicts, and navigated the complexities of Figma’s multiplayer technology. We recently expanded autosave in Figma so you can work offline without worrying about losing changes.
0 Comments
Leave a Reply. |