Design an AR Lens Creator and Publishing Platform
Let creators upload AR camera lens projects, build them into small phone-ready packages in the background, publish them, and let camera users find and download them quickly.
Problem statement
Design the cloud side of a creator tool that people use to build augmented reality (AR) camera lenses, such as face effects, and publish them to a camera app.
For this exercise, assume creators build lenses in a desktop editor app. The editor itself (drawing, previewing, and editing) runs on the creator's computer and is out of scope; you design the backend that the editor and the camera app talk to.
A signed-in creator submits a lens project as a new version: a manifest plus files of the accepted types, which are 3D models, images and textures, audio clips, and scripts.
The platform checks these inputs, builds each version into a compact lens package for phones in the background, runs automated checks on it, and shows the creator the result. The creator then publishes a version that passed.
Camera-app users browse published lenses by tag, open a lens's details, and download its package when they try it.
For this exercise, also assume a submitted version never changes; an edit creates a new version. A lens has at most one published version at a time, and a camera user must never download a half-built package.
Start with a simple end-to-end design. Then be ready to discuss how the backend splits into services, how load is spread, when to use bigger machines versus more machines, what happens when parts fail, and how the catalog database should be indexed and whether it should be partitioned.
Human content review, free-text search, payments to creators, and analytics dashboards are out of scope.
What to build
- A signed-in creator submits a lens project as a new version: a manifest plus files of the accepted types (3D models, images and textures, audio clips, scripts), up to 100 MB in total. Missing files, unsupported types, and oversize projects are rejected with a clear reason.
- Each submitted version is built in the background into a phone-ready package of at most 8 MB and checked automatically; the creator sees its status (queued, building, failed with reasons, or ready) in the editor.
- The creator publishes a ready version. The lens keeps a stable ID, new downloads get the new version, and the previously published version keeps serving until the switch.
- Camera-app users browse published lenses by tag, open a lens's details, and download its package.
At scale
- For this exercise, assume about 200,000 active creators submit about 50,000 new versions a day, about 3 per second at peak. A project is at most 100 MB and about 20 MB on average, and a build takes 1 to 5 minutes of computer time.
- For this exercise, assume 95% of builds report a result within 10 minutes of the upload finishing, and a version the platform has accepted is never lost.
- For this exercise, assume camera users make about 10,000 catalog reads per second at peak, with lens details and tag pages returned within 200 ms at p95, and about 20,000 package downloads per second; a package is at most 8 MB and about 2 MB on average.
- For this exercise, assume the catalog holds about 5 million published lenses and 50 million versions; their records, not the files, come to roughly 60 GB including indexes.