BlogsMetaPhoto Storage and Serving Infrastructure

Photo Storage and Serving Infrastructure

Photo Storage and Serving Infrastructure

55
posts
2008–2026

Meta's infrastructure for storing and serving user content has evolved significantly, starting with photos and expanding to encompass immersive media like 360 video and VR. This evolution includes developing dedicated mobile applications, enhancing user experience for capturing and sharing, and tackling complex technical challenges in processing and delivering new media formats. Key developments include the creation of custom video filters for transforming equirectangular layouts to cube maps, and the development of the Data Transfer Project to enable secure, service-to-service data portability for photos and videos.

2026

FFmpeg at Meta: Media Processing at Scale

3/2/2026

This post details Meta's extensive use and significant contributions to FFmpeg for media processing at scale. It highlights how Meta moved from an internal fork to upstreaming critical features like threaded multi-lane transcoding and real-time quality metrics, enabling more efficient video encoding for VOD and livestreaming. It also discusses the integration of custom hardware like the Meta Scalable Video Processor (MSVP) through standardized FFmpeg APIs, demonstrating a commitment to both open-source collaboration and internal innovation for media handling.

2025

Enhancing HDR on Instagram for iOS With Dolby Vision

11/17/2025

This post details the technical implementation of Dolby Vision and ambient viewing environment (amve) metadata support for HDR videos on Instagram for iOS. It describes the challenges of preserving and processing this metadata through client and server stages, including modifications to FFmpeg and Shaka packager to support Dolby Vision Profiles 8 and 10. The post also covers the implementation of manual Dolby Vision metadata extraction for AVSampleBufferDisplayLayer and the iterative A/B testing process to optimize for performance, including the adoption of compressed metadata formats and client-side decompression to reduce load times and improve user engagement.

Video Invisible Watermarking at Scale

11/4/2025

This post introduces the implementation of invisible watermarking at scale for video content. It details the challenges and solutions for embedding imperceptible signals for content provenance, including detecting AI-generated videos, verifying upload order, and identifying creation tools. A key contribution is the development of a CPU-based watermarking solution that achieves comparable performance to GPUs with improved operational efficiency, by optimizing threading and addressing data transfer, inference latency, and model loading bottlenecks. The post also highlights the importance of managing BD-Rate impact and addressing visual quality regressions through custom post-processing and manual inspections, noting the insufficiency of traditional quality metrics.

Video Streaming With the AV1 Video Codec in Mobile Devices

9/24/2025

This post details Meta's collaboration with Vodafone and Google to promote the adoption of the AV1 video codec for mobile devices. It highlights AV1's superior compression capabilities (up to 30% better than H.264 and VP9) and its importance for improving video streaming quality and reducing network load, especially on lower-end devices. The post advocates for hardware and software AV1 decoding solutions and emphasizes the benefits for mobile operators and end-users.

2024

Inside Facebook’s video delivery system

12/10/2024

This post details Meta's extensive two-year effort to unify its video delivery systems, consolidating the previously separate Watch and Reels products and their underlying infrastructure. It outlines the three core systems involved (ranking, server, and mobile), the strategic reasons for unification (fragmented user/developer experience, creator overhead), and the complex technical challenges overcome in merging client and server data models, architectures, and ranking layers. The post also describes the lifecycle of a video feed network request and highlights key principles guiding their video delivery system.

Bringing HDR photo support to Instagram and Threads

3/26/2024

This post details the technical implementation of bringing High Dynamic Range (HDR) photo support to Instagram and Threads. It highlights the work of the Media Platform Team in optimizing the image serving pipeline from CDN to device display to ensure true-to-life color and range. The post also mentions collaboration with major phone manufacturers (Google and Samsung) for a successful rollout.

2023

Bringing HDR video to Reels

7/17/2023

This post details the technical challenges and solutions for enabling High Dynamic Range (HDR) video uploads and playback in Meta's Reels feature. It describes the implementation of client-side tone mapping on iOS using native APIs and custom shaders on Android to convert HDR to SDR for compatibility. It also outlines the development of server-side tone mapping to generate both HDR and SDR representations, ensuring optimal playback across devices with and without HDR display support. The post highlights the need to manage brightness levels for consistent UI elements over HDR video and the use of the Meta Scalable Video Processor (MSVP) for efficient HDR processing.

Why xHE-AAC is being embraced at Meta

4/11/2023

This post details the adoption and implementation of the xHE-AAC audio codec across Meta's platforms, specifically Facebook and Instagram, for features like Reels and Stories. It highlights the benefits of xHE-AAC, including integrated loudness management and adaptive bit rate audio, and explains the deployment process using encoder SDKs and shaka-packager. This contributes to the broader theme of enhancing media delivery and user experience by focusing on audio quality and adaptability.

2022

Reducing Instagram’s basic video compute time by 94 percent

11/4/2022

This post details a significant optimization in Instagram's video processing pipeline, reducing the compute time for basic video encodings by 94 percent. The core innovation involves repurposing progressive encodings to serve as basic ABR encodings by repackaging video frames, thereby eliminating the redundant workload of generating separate basic ABR encodings. This optimization frees up compute resources, enabling a 33 percent increase in advanced encoding watch time and improving overall video playback quality and smoothness, especially for users in regions with slower internet connections. A testing framework was developed to validate the theory that increased advanced encoding watch time would outweigh the reduced compression efficiency of the new basic ABR encodings.

Building text animations for Instagram Stories

7/18/2022

This post details the technical implementation of new text animations and font styles for Instagram Stories and Reels. It addresses challenges related to font packaging and APK size on Android, leading to the development of a custom solution using Everstore. It also describes the engineering approaches for dynamically evolving text designs, including drawing arcs and creating Bezier paths, and the linguistic processing required for word-by-word reveal animations. Finally, it covers debugging native Android crashes related to font caching and the complexities of rendering various text features like ligatures, RTL text, emojis, and custom spans.

2021

How Facebook encodes your videos

4/5/2021

This post details the evolution of Facebook's video encoding system, moving from a rule-based prioritization to a benefit-cost model integrated with machine learning. The new model prioritizes advanced codecs (like VP9) for videos predicted to be highly watched, balancing compression efficiency, predicted watch time, and compute cost. It introduces the MVHQ metric for comparing compression efficiency and explains how ML models predict watch time based on various video and uploader attributes, addressing challenges like high variance and long-tail distribution of watch time.

2019

Data Transfer Project: Enabling portability of photos and videos between services

12/2/2019

This post details Meta's participation in and implementation of the Data Transfer Project, an open-source framework for service-to-service data portability. It describes the project's architecture (shared data models, adapters, task management framework), deployment considerations (security, reliability, rate limiting, retries), and Meta's custom extensions integrating with internal systems like TAO, Scribe, Tupperware, and Configerator to enable direct photo and video transfers from Facebook to Google Photos.

Video @Scale 2019 recap

10/17/2019

This post summarizes the Video @Scale 2019 conference, highlighting discussions on video streaming, encoding (AVC, VP9, AV1), contextual ads, HDR video, live streaming (Twitch), video client bugs, video integrity, and the use of machine learning with large video corpuses. It showcases the ongoing engineering challenges and collaborative efforts in delivering video at scale across various companies.

Facebook open-sources Spectrum 1.0.0 for better mobile image production

1/17/2019

Introduced Spectrum, an open-source image processing library for Android and iOS, to improve mobile image upload efficiency and reliability. Spectrum's declarative API and C++ core enable consistent, high-quality image transcoding by optimizing operations like cropping, rotating, and resizing, and integrating with advanced compression libraries like MozJpeg for significant file size reduction.

2018

React 360 replaces React VR for streamlined development focus

5/2/2018

This post announces the rebranding of React VR to React 360, reflecting its broader use cases beyond VR headsets to include non-VR users and a wider range of immersive content. It highlights improvements in 2D UI integration, enhanced media support (including 180° video), and better performance, particularly on mobile devices. This signifies an evolution in Meta's approach to immersive content development, making it more accessible and versatile.

Facebook video adds AV1 support

4/24/2018

This post details the implementation of trial support for the AV1 video format on Facebook video. It describes the benefits of AV1 (improved compression efficiency, reduced buffering) and the challenges (slower encoding times). The implementation strategy involved a segment-based encoding approach to parallelize encoding tasks across a cluster, followed by stitching and muxing. The post also outlines steps for users to view AV1 content using Chrome Canary and mentions the ongoing development of browser support and the eventual switch to the official AV1 release version.

AV1 beats x264 and libvpx-vp9 in practical use case

4/10/2018

This post details Meta's practical evaluation of the AV1 video compression codec, demonstrating its superior compression efficiency (30-50% better than VP9 and x264) compared to existing open-source encoders like x264 and libvpx-vp9. It highlights AV1's potential for significant gains in delivering digital video more quickly, with higher quality, and reduced bandwidth/storage, especially for common Facebook video formats (SD/HD) and with promise for higher resolutions. The post also acknowledges AV1's longer encoding times due to increased complexity, a key consideration for production deployment.

Quality assessment of 360 video view sessions

3/9/2018

Introduced SSIM360 and 360QVM, novel quality assessment standards for 360 video streaming. SSIM360 addresses the warping problem by weighting per-sample SSIM scores based on sample stretching in the equirectangular representation. 360QVM tackles the field-of-view problem by mapping view direction to pixel density and using this to scale SSIM360 scores, accounting for view-dependent optimizations and resolution changes within the viewer's field of view.

2017

Optimizing 360 photos at scale

8/31/2017

This post details the reengineering of Facebook's photo infrastructure to support "tiled" storage and serving of 360 photo content. It describes converting 360 photos to cube maps, storing them at multiple resolutions, and splitting each resolution into 512x512 tiles. The system dynamically calculates and serves necessary tiles for rendering based on the user's view, falling back to lower resolutions when high-res content is unavailable. It also introduces the use of deep neural networks (modified AlexNet) for automatically correcting the tilt and roll of 360 photos, trained on equirectangular projections and cast as a regression problem to estimate rotation parameters, achieving an average accuracy within 0.1 degrees.

Under the hood: Photo Search

5/22/2017

This post details the application of machine learning, specifically deep neural networks and image understanding engines, to enhance Facebook's Photo Search functionality. It describes the use of Unicorn, an in-memory and flash storage indexing system, to index and search trillions of photo-related entities. The post explains how high-dimensional feature vectors from deep residual networks are compressed using iterative quantization and locality-sensitive hashing to create compact embeddings for efficient retrieval and ranking. It also covers query understanding techniques, including intent recognition, syntactic analysis, entity linking, and query embedding, and outlines the two-stage ranking process (first-stage ranking and second-stage re-ranking) that leverages these signals and embeddings to deliver relevant photo search results.

Surround 360: Beyond Stereo 360 Cameras

4/20/2017

This post introduces the Surround 360 camera system, a significant advancement in capturing high-quality immersive content beyond stereo 360. It details the hardware and software innovations, including the camera's design, stitching, and rendering capabilities, which directly contribute to Meta's efforts in handling and serving new media formats like VR video.

Announcing 360 Capture SDK

4/19/2017

This post introduces the 360 Capture SDK, a new tool that simplifies the creation and sharing of 360 photos and videos from PC VR experiences. It achieves this by adopting cube mapping instead of traditional stitching, which significantly improves accessibility (less computing power needed), quality (no stitching distortion), and speed (near real-time capture). The SDK is compatible with major game engines and GPUs, and can output content in various formats, including a shader-converted equirectangular format for broader compatibility.

Enhancing high-resolution 360 streaming with view prediction

4/19/2017

Introduced a gravitational view-prediction model using physics and heatmaps to improve resolution on VR devices by up to 39 percent. Developed an AI model to generate saliency maps for videos, enabling prediction even without heatmap data. Introduced content-dependent streaming, a new encoding technique that improves 360 video resolution on non-VR devices by up to 51 percent, even in low bandwidth, by transforming frames based on saliency data into a single stream.

Video @Scale 2017 recap

3/22/2017

This post recaps the @Scale 2017 conference, highlighting discussions on delivering video at scale. It covers innovations in live streaming, VR video, spatial audio, cloud-native Video APIs, new codec profiles, and efficient encoding for mobile video. Specific contributions include details on Facebook's work in streaming 360 video, developing spatial audio for large-scale consumption, and scaling low-latency live streams. It also touches on AI research for video understanding and the evolution of video delivery APIs.

End-to-end optimizations for dynamic streaming

2/22/2017

This post details significant optimizations to Meta's dynamic streaming technology for 360 video. It introduces variable offset cubemaps for encoding, which allows for more efficient pixel allocation towards the viewport, reducing overall resolution by up to 92% while maintaining viewport quality. It also describes improvements in stream selection by considering six factors instead of four, leading to an 80% reduction in interruptions. Further enhancements include optimizing bandwidth estimation, chunk handling, prefetching initialization and index chunks, and boosting player performance.

Spatial audio — bringing realistic sound to 360 video

2/22/2017

Introduced new 360 audio encoding and rendering technology, including a hybrid higher-order ambisonics system (8-channel) with rendering optimizations for large-scale consumption. Developed the Spatial Workstation tool for creators to design spatial audio for 360 video and VR, and the FB360 Encoder tool for exporting to multiple platforms. The rendering SDK is integrated into Facebook and Oculus Video. The system supports simultaneous spatial and head-locked audio with sub-millisecond latency. The audio engine (Audio360) is cross-platform, written in C++ with asm.js for web, and is lightweight (approx. 100KB binary). Encoding uses MP4 with H.264 video and AAC audio, employing a three-track configuration for spatial and head-locked audio, with metadata stored in an XML box within the MP4 file.

2016

Keyframes: Delivering scalable, high-quality animations to mobile clients

11/22/2016

Introduced Keyframes, a new library for exporting and playing back After Effects animations on mobile clients. Keyframes addresses challenges with resizability, quality, and file size by extracting minimal, necessary vector and transformation data from After Effects compositions. It renders animations using Core Animation on iOS and Paths/Matrices on Android, enabling real-time playback at any size with fine control over animation progression and speed. The library was initially developed for the Reactions product and has since been open-sourced.

Lessons from building social experiences in VR

10/6/2016

This post details Meta's early explorations into building social experiences within Virtual Reality. It highlights the development of more expressive avatars, the ability to share and experience 2D and 360 photos, videos, and Facebook posts together in VR, and the seamless integration of VR experiences with non-VR users through features like Messenger video calling. The post emphasizes the importance of social presence and the potential of VR as a people-first platform for connection.

360 video stabilization: A new algorithm for smoother 360 video viewing

8/31/2016

Introduced a new stabilization algorithm for 360 video using a hybrid 3D-2D approach with a novel 'deformed-rotation' motion model. Developed a 360-hyperlapse algorithm as an extension. Optimized the stabilization algorithm for CPU-only execution, achieving sub-frame stabilization times and improving bit rate efficiency. The algorithm uses KLT tracking on cube map representations and a robust least-squares solver (Ceres) for optimization.

Surround 360 is now open source

7/26/2016

This post details the open-sourcing of Meta's Surround 360 system, including its hardware camera design and software stitching code. It explains the technical challenges of rendering stereo 360 video, such as handling large data volumes and ensuring near-perfect stitching for comfortable stereo viewing. The post elaborates on methods for constructing stereo panoramas, including view interpolation and the use of optical flow. It describes the rendering pipeline, which involves converting RAW sensor data, applying lens distortion and misalignment corrections, computing optical flow for view interpolation, and compositing images from multiple cameras (including top and bottom cameras to remove the tripod pole) to achieve full 360x180 degree coverage and comfortable stereo.

Introducing Facebook Surround 360: An open, high-quality 3D-360 video capture system

4/12/2016

Introduced the Facebook Surround 360, an open, high-quality 3D-360 video capture system. This system includes hardware design and stitching code, made available on GitHub. The stitching code leverages an optical flow algorithm for superior stereoscopic 360 panorama generation, reducing post-production time from weeks to overnight. The system exports 4K, 6K, and 8K video, with 8K output doubling industry standard and playable on Gear VR with custom Dynamic Streaming technology. The system addresses challenges of overheating, rig sturdiness, and stitching time found in existing 3D-360 cameras.

Gear VR to get Dynamic Streaming for 360 video

2/21/2016

This post announces the integration of dynamic streaming technology for 360 video into Gear VR, aiming to deliver clearer and faster playback of immersive content. It highlights the growth of Gear VR and the increasing consumption of 360 videos on Facebook, underscoring the need for efficient delivery mechanisms for VR experiences.

Under the hood: Shipping #friendsday videos

2/9/2016

This post details the engineering challenges and solutions for generating and shipping hundreds of millions of personalized #friendsday videos. Key contributions include: load testing and optimization of the video generation pipeline (achieving a 69% reduction in processing time via multithreading), capacity planning considering CPU, memory, storage IOPS, network bandwidth, and power availability, implementing an automated system for safe infrastructure utilization by dynamically allocating machines and blocklisting problematic ones, developing a ranking system for photo selection using signals like break-up checkup, blocks, and user interactions, and leveraging AI image understanding to assess photo quality and relevance. It also describes a staggered rollout plan to manage CDN load across different continents and time zones, and highlights the rapid development of Android and iOS UIs using React Native.

Next-generation video encoding techniques for 360 video and VR

1/21/2016

Introduced techniques for optimizing 360 video and VR content delivery. This includes transforming equirectangular layouts to cube maps, reducing file size by 25% and improving encoding efficiency. Further optimized for VR with pyramid encoding, achieving an 80% file size reduction. Implemented view-dependent adaptive bit rate streaming for VR to dynamically adjust content based on field of vision and network conditions, and explored pre-generating multiple resolutions for viewports to manage latency and server-side setup.

2015

Why we chose to move to HTML5 video

12/18/2015

This post details the migration of Facebook's video player from Flash to HTML5. Key technical contributions include: implementing a test suite to validate log equivalence between Flash and HTML5 players, mitigating Chrome SPDY protocol bugs by reducing concurrent video loading and canceling unnecessary loads, addressing performance regressions in older browsers by phased rollout and continuous improvement, and optimizing page load times through micro-optimizations to counteract initial regressions. The post also highlights the benefits of HTML5 for development velocity and accessibility.

Under the hood: Building 360 video

10/15/2015

This post details the technical challenges and solutions for building 360 video support on Facebook. It describes the problem with equirectangular layouts and the solution of remapping them to cube maps for improved encoding efficiency and reduced distortion. It also covers the backend challenges of handling large file sizes and bit rates, and the use of distributed encoding and custom video filters to process these videos at scale.

Under the hood: Place Tips at Lollapalooza

8/18/2015

This post details the development of a server-controlled client rendering framework for dynamic content display, specifically for Place Tips. The framework uses 'styles' as contracts between client and server to map arbitrary data to pre-existing templates on clients, enabling flexible and consistent rendering across different app versions. This allowed for rapid iteration and deployment of features like Lollapalooza-specific Place Tips, leveraging existing client templates and server-side logic.

The technology behind preview photos

8/6/2015

Introduced a technology to deliver low-resolution image previews within 200 bytes by embedding a compressed JPEG payload with a custom header. This involved creating a fixed JPEG header (version, width, height) and a Huffman table optimized for the target byte count, allowing clients to reconstruct a blurred image preview. This reduced profile and page load times by 30% on slow connections and ensured immediate preview display on all connections.

Improving Facebook’s performance on Android with FlatBuffers

7/31/2015

Introduced FlatBuffers as a replacement for JSON for storing and serving data on Facebook's Android app. This change significantly improved performance by reducing story load time from disk cache (35ms to 4ms), decreasing transient memory allocations by 75%, improving cold start time by 10-15%, and reducing storage size by 15%. Developed mutation extensions for FlatBuffers to handle local state and server data updates efficiently, leading to a 'Flat Models' architecture that simplifies data flow between UI and storage.

Under the hood: Building Moments

6/15/2015

Introduced the 'Moments' app, focusing on private photo sharing among friends. Leveraged Facebook's facial recognition technology for suggesting photos. Implemented a client-driven development model with server storing generic data and client holding typed objects, enabling optimistic UI updates and rapid iteration. Utilized shared C++ business logic for both iOS and Android apps, with Djinni for Android bindings and direct Objective-C interaction for iOS, to accelerate cross-platform development and reduce bugs. Employed a Flux-like architecture for data flow and delta-syncing protocol (GraphQL) for efficient data fetching.

Under the hood: Facebook’s cold storage system

5/4/2015

This post details the development of Meta's cold storage system, a new capability focused on efficiently and durably storing less frequently accessed photos. It describes the full-stack approach, including custom data center design, low-power servers based on Open Vault specifications with modified drive power management, and optimized rack configurations. The software design emphasizes durability, with principles like eliminating single points of failure and self-describing data. Key technical innovations include the use of Reed-Solomon erasure coding for data redundancy and an 'anti-entropy' background process for detecting and correcting 'bit rot'. The system is designed to scale and improve with capacity additions through data rebalancing.

Introducing Fresco: A new image library for Android

3/26/2015

Introduced Fresco, a new image library for Android, to address memory management issues and improve image display performance. Fresco leverages native memory (ashmem) and a reference-counted system with `CloseableReference` to prevent memory leaks and avoid UI thread stalls during image decoding. It implements a pipeline architecture inspired by ReactiveX, using a Producer/Consumer model for flexible image processing and streaming, including support for animated images (GIF, WebP) with optimized memory usage.

Shimmer for Android

3/5/2015

This post introduces Shimmer for Android, a new component that provides a shimmering loading effect for Android views. It is implemented as a layout (`ShimmerFrameLayout`) that can wrap complex views and animate an alpha mask across them to create the effect. The implementation details include rendering the view twice with an alpha mask translation and allowing configuration via XML or programmatically. Shimmer is used in several Facebook applications for loading status indicators.

Faster Photos in Facebook for iOS

1/28/2015

Introduced Progressive JPEG (PJPEG) rendering for photos in Facebook for iOS. This involved building custom progressive rendering support as iOS lacked native out-of-the-box functionality. The implementation reduced data consumption by ~10% and improved perceived image loading speed by 15% by allowing the rendering of an image as soon as the first scan is available, with subsequent scans increasing detail. This also reduced the number of network connections per image and decreased disk storage by eliminating the need to download multiple image sizes.

2014

The art and science behind auto-enhance for iOS

12/17/2014

Introduced an auto-enhance filter for iOS that leverages computational imaging techniques: Global Tone Mapping (GTM) to adjust overall image tone and dynamic range, Local Tone Mapping (LTM) with edge-aware masks to adapt local contrast and prevent haloing, and Noise Suppression (NS) to reduce noise in flat regions. These algorithms are designed to mimic human visual perception and historical darkroom techniques to improve image vibrancy and detail.

Looking back on “Look Back” videos

3/13/2014

This post details the engineering challenges and solutions for building the 'Look Back' video feature within a month. It highlights the rapid scaling of infrastructure, including estimating and provisioning 25 petabytes of storage and planning for 187 Gbps of outgoing bandwidth. The post describes the division of the pipeline into parallelizable tasks, the decision to isolate video storage and reduce replication factors, and the provisioning of additional hardware to handle the compute and network load. It also touches on managing data center power efficiency and the collaborative, cross-team effort required to meet the tight deadline.

An analysis of Facebook photo caching

2/27/2014

This post details an analysis of Facebook's multi-layered photo-serving caching stack, including browser caches, edge caches, and origin caches. It quantifies the effectiveness of each layer, analyzes the shifting popularity distribution of photos across these layers, and evaluates the impact of increasing cache sizes and advanced caching algorithms (FIFO, LRU, LFU, S4LRU, Clairvoyant) on hit ratios. The findings highlight opportunities for performance improvements through optimized caching strategies.

An analysis of Facebook photo caching

2/20/2014

This post details an analysis of Facebook's photo caching stack, including its effectiveness, photo popularity distribution across cache layers, the impact of increasing cache sizes, and the effect of more advanced caching algorithms. It references an academic study published in SOSP and highlights the use of Haystack machines for photo storage.

2013

McDipper: A key-value cache for Flash storage

3/5/2013

Introduced McDipper, a Memcache protocol-compatible key-value cache server optimized for flash storage. McDipper offers improved capacity and performance over RAM-based Memcached for large working sets with moderate to low request rates. Key features include checksums, configurable replacement policies (FIFO, LRU), optional bloom filters, compression, encryption, and arenas. Addressed race conditions in Memcached operations with delete hold-off and read-modify-write primitives. Deployed McDipper in Facebook's photo infrastructure, reducing server counts by up to 90% and serving over 150 Gb/s from CDN forward caches.

2012

Optimizing for the MacBook Pro with Retina display

9/18/2012

Introduced a server-side and client-side cookie-based mechanism to dynamically serve images optimized for device pixel ratio, specifically addressing the challenges presented by the MacBook Pro with Retina display. This involved making an educated guess about the device pixel ratio, allowing for self-correction via refresh, maintaining consistency within a window, and minimizing unnecessary data transfer.

Under the Hood: Building Facebook Camera

8/29/2012

This post details the development process of Facebook Camera for iPhone, focusing on the UI/UX decisions and the iterative prototyping that led to the final design. It highlights the challenges of balancing photo capture and consumption, the impact of iOS lock screen camera changes, and the successful hackathon-style prototype that merged camera roll and feed. It also touches on the broader effort to improve photo performance and viewing experience across Facebook.

Under the Hood: Improving Facebook Photos

3/22/2012

Introduced TINYsRGB, a significantly smaller sRGB color profile (524 bytes) by removing redundant data and optimizing the tone response curve sampling from 1024 points to 26. This optimization allows color profiles to be attached to thumbnails without significantly impacting page load times, improving color accuracy for all photos on Facebook.

2011

Hackathon 22: Redesigning Pixelcloud

2/15/2011

Redesigned the internal Pixelcloud tool from scratch, improving image uploads by over 20% and comments by over 40%. Migrated backend storage from NFS to DFS3 and restructured database queries for efficiency. Leveraged XHP for the frontend. Introduced new features like tag/user search, trending posts, and view counts to enhance designer feedback and content discovery.

Developing Facebook’s New Photo Viewer

2/11/2011

This post details the redesign of Facebook's Photo Viewer, addressing issues of reliability, user experience in News Feed, and cumbersome comment interaction. The engineering effort focused on a CSS-driven lightbox overlay to improve photo loading speed, increase photo viewing engagement, and simplify interaction with captions and comments. Key technical decisions included leveraging CSS for layout to minimize JavaScript, optimizing AJAX calls by separating image and data fetches, and prefetching images to ensure near-instantaneous display.

2009

Building a Better Photo Uploader

11/19/2009

Introduced a new, modern photo uploader that replaces the legacy ActiveX control and Java applet. This new uploader is asynchronous, allowing users to browse Facebook while uploads are in progress. It integrates seamlessly with Facebook's UI and allows for easy UI iteration. The core of the new uploader is a custom-built headless browser plugin that provides JavaScript APIs for filesystem browsing, background uploading threads, and thumbnailing. Security measures include binding the local web server to 127.0.0.1, using secure URIs with hashing, restricting the plugin to Facebook domains, implementing strong mechanisms against unauthorized access, securely signing and verifying all code downloads, and a remote "kill switch" for deactivation.

Needle in a haystack: efficient storage of billions of photos

4/30/2009

This post details the transition from an NFS-based photo storage infrastructure to a new system called Haystack. The primary technical contribution is the design and implementation of Haystack, an object store that addresses the metadata overhead of traditional file systems. Haystack uses an append-only log structure with a separate index file to store photos, minimizing I/O operations per read. It also introduces a Photo Store Server that maintains an in-memory index for fast lookups and handles photo uploads, modifications, and deletions by interacting with Haystack. The post also discusses the underlying storage (commodity blades with RAID-6) and filesystem (XFS) choices, and the strategies for handling deleted needles and compaction to reclaim space.

Behind the scenes with the new Facebook features in Apple’s iPhoto ’09

1/30/2009

This post details the integration of Facebook features into Apple's iPhoto '09, specifically focusing on the bi-directional syncing of photo name tags and privacy controls. It highlights the enhancement of Facebook's photo APIs to support this integration, demonstrating an expansion of how user photos can be shared and managed across platforms.

2008

10 billion photos

10/15/2008

This post marks a significant milestone in Meta's photo infrastructure, announcing the upload of over 10 billion photos, resulting in over 40 billion stored image files across four sizes. It highlights the scale of operations with daily uploads of 2-3 Terabytes, a total storage of over one petabyte, and serving over 15 billion photo images daily, peaking at over 300,000 images per second.