Latest / The CTO Podcast with Fexingo: Technical Leadership, Architecture, and Engineering Org / How Figma Rebuilt Its Architecture for Enterprise Security
Transcript
- Lucas: So it is episode one hundred of this show, which is a nice round number. And I wanted to talk about something that a lot of our listeners are probably wrestling with right now: how do you take a product that was built for consumer-grade, real-time collaboration and retrofit it for enterprise security without breaking the thing that made it great in the first place? Luna: And you have a specific case study in mind, I assume. The company that basically defined multiplayer design tools. Lucas: Figma. Yeah. And I think it's a perfect example because Figma's core architecture — multiplayer collaboration on a single file — was designed for speed and simplicity. But when you start selling to enterprises, you need role-based access controls, audit logs, data residency, SOC 2, FedRAMP. And those things are fundamentally at odds with a flat, open permission model. Luna: Right, because the original model was essentially 'anyone with the link can view or edit.' That's great for a startup where you just share a file with a team. But for a Fortune 500 company managing 10,000 designers and stakeholders, that's a nightmare. Lucas: Exactly. And Figma's engineering team had to make a really hard choice. They had about 350 engineers at the time they started this push, and they were serving roughly 150 million files. But the enterprise part of the business was growing fast — by 2023 they had over 500,000 enterprise seats. So they couldn't just bolt on a permission layer. They had to rethink how the entire multiplayer engine handles state changes when permissions are enforced. Luna: Walk me through the architecture problem. What's the specific technical challenge? Lucas: So Figma's multiplayer engine uses a crdt based approach — conflict-free replicated data types. Every change to a file is a small operation that gets propagated to all connected clients. The key insight is that CRDTs assume a certain level of trust: if you have the file open, you can apply changes. There's no built-in gatekeeping per object. Luna: So when you want to say 'this user can edit only the text in this frame, but not move the frame itself,' you can't just add a check on the client side. You have to enforce it server-side, in the middle of real-time sync. Lucas: Exactly. And that changes the latency profile. Because now every operation has to be validated against a permission model before it's broadcast to other clients. The naive approach would add tens of milliseconds per operation, which breaks the illusion of real-time. So Figma had to build a permission cache that lives close to the sync server, and they had to design a system where permissions changes are themselves treated as CRDT operations, so they propagate in the same order as edits. Luna: That's clever. Because if you change a permission and someone edits the same object simultaneously, you need a deterministic resolution. Otherwise, you could get into a state where an edit is rejected but already applied on some clients. Lucas: Right. And that's exactly the kind of edge case that haunts retrofits. Figma ended up implementing what they call 'permission as a layer of the document' — so every object has an access control list that's part of the document state. It gets replicated and merged using the same CRDT logic as the design data itself. That means permissions are always consistent, even in offline or partitioned scenarios. Luna: But that also means file size grows. Every object now carries ACL metadata. Did they hit scalability issues? Lucas: They did. They published a blog post about this — I think around mid-2023 — where they said the ACL data could add up to 30 percent overhead on complex files. So they had to optimize the encoding. Instead of storing full user IDs per object, they store a compact bitmask of roles and then map roles to users in a central registry. That brought the overhead down to about 5 percent. Luna: I want to stay on the scaling numbers for a second. Five hundred thousand enterprise seats is a lot, but it's not just seat count. It's the complexity of org structures. Figma had to support nested teams, guest access, external collaborators, and viewer-only roles. Each of those has different implications for the sync engine. Lucas: And that's where the compliance requirements come in. For SOC 2 and FedRAMP, you need audit logs that record every read and write with timestamps and user IDs. But in a multiplayer environment, a 'read' is not a single event — it's a stream of updates. So Figma had to define what constitutes an audit-worthy read. They settled on 'any time a user opens a file or explicitly reloads it,' not every incremental update. That gives them a manageable log volume. Luna: Yeah, if they logged every operation, they'd be generating terabytes of logs per day. So they had to be pragmatic. And then there's data residency — enterprises want their data stored in specific regions. Figma had to build a multi-region deployment where files are pinned to a region at creation time, and the multiplayer traffic stays within that region. Lucas: That's a big infrastructure lift. Because originally Figma ran on a single AWS region in the US. To support EU data residency, they had to spin up a full stack in Frankfurt — compute, storage, sync servers — and then build a routing layer that directs users to the correct region based on their org's policy. And it all has to work under the same CRDT protocol, but with region-local state. Luna: And I imagine that complicates their disaster recovery, because now you have to plan for region failures without losing data locality. Lucas: Absolutely. They use cross-region replication for backups but keep the active-passive model simple. The key is that permissions and data residency are enforced at the application layer, not just at the storage layer. That gives them the flexibility to add new regions without re-architecting the storage engine. Luna: So what's the takeaway for CTOs who are building a similar product today? Should you build enterprise features from day one, or is it okay to retrofit like Figma did? Lucas: I think the honest answer is: it depends on your go to market. Figma's product-led growth was incredibly successful — they got millions of users before they ever sold to enterprises. If they'd built all this security infrastructure from day one, they would have moved slower and maybe never achieved that viral growth. But the cost of retrofitting is real. They spent probably two years on this architecture overhaul, and that's with a 350-person engineering team. Luna: And if these conversations are useful for what you're building or running, listener support is what keeps this show ad-free. If you find value in episodes like these, you can support us at buy me a coffee dot com slash fexingo. It genuinely helps us keep going. Lucas: Yeah, and we really appreciate those who do. So, back to the architecture: one more thing I want to highlight is how Figma handled the transition. They didn't flip a switch. They introduced the new permission model as an optional feature for enterprise orgs, while the old model still worked for free users. That meant they had to maintain two permission paths in the sync engine for over a year. Luna: That's a classic strangler fig pattern. You build the new system alongside the old one, route traffic gradually, and eventually deprecate the old one. But in a real-time system, that means both permission models have to coexist in the same file at the same time. Lucas: Exactly. And they did it by tagging each operation with a permission schema version. The sync engine checks the version and applies the appropriate rules. It's a lot of conditional logic, but it allowed them to migrate enterprise customers without disrupting the millions of free users who didn't need RBAC. Eventually, they'll deprecate the old model, but they haven't yet. Luna: So the lesson is: if you're going to retrofit, design the new system to run in parallel for as long as it takes. Don't try to cut over in one big bang. Lucas: Right. And measure everything. Figma published that they saw a latency increase of about 8 milliseconds for operations that required permission checks, but that was acceptable because they cached results aggressively. They also moved to a WebSocket-based push for permission changes, so when an admin updates a role, the client gets the new permissions within 200 milliseconds. Luna: That's impressive. And it brings us back to the central tension: enterprise security and real-time collaboration are not natural friends. But with careful architecture, you can have both. Lucas: Yeah, and I think Figma's story is a good blueprint for any company that starts in the consumer or prosumer space and then moves upmarket. The key is to understand that security isn't a feature you add — it's a constraint that reshapes your core architecture. And the sooner you treat it that way, the less painful the retrofit will be. Luna: Well said. And with that, we close out episode one hundred. Thanks for listening.