Skip to main content

Database Driven UI - Meet Facebooks Messenger Re-Implementation: Project LightSpeed

Database-Drive UI - Database-driven Logic

Rather than managing dozens of independent features and having each pull information and build its own cache on the app, we leveraged the SQLite database as a universal system to support all the features.

Compared with the previous iOS version, this new Messenger is twice as fast to start and is one-fourth the size. We reduced core Messenger code by 84 percent, from more than 1.7M lines to 360,000.

We accomplished this by using the native OS wherever possible, reusing the UI with dynamic templates powered by SQLite, using SQLite as a universal system, and building a server broker to operate as a universal gateway between Messenger and its server features.


Native Code

When building a new feature, it’s often tempting to build abstractions on top of the OS to plug a functionality gap, add engineering flexibility, or create cross-platform user experiences. But the existing OS often does much of what’s needed. Actions like rendering, transcoding, threading, and logging can all be handled by the OS. Even when there is a custom solution that might be faster for local metrics, we use the OS to optimize for global metrics.

While UI frameworks can be powerful and increase developer productivity, they require constant upkeep and maintenance to keep up with the ever-changing mobile OS landscape. Rather than reinventing the wheel, we used the UI framework available on the device’s native OS to support a wider variety of application feature needs.


Push Logic to the Server

For anything that doesn’t fit into one of the categories above, we push it to the server instead.
In today’s Messenger, we have a universal flexible sync system that allows the server to define and implement business and sync logic and ensures that all interactions between the client and the server are uniform.

https://engineering.fb.com/data-infrastructure/messenger/

Comments

Most Favorite Posts

Judo App - Server Driven UI out of the box

Judo App Judo brings server-driven UI to your iOS and Android apps. Build user interfaces visually in a fraction of time and publish them instantly without submitting to the app store. Build Experiences - With No Code The Judo app for macOS, available through the App Store, is built for design professionals with common keyboard shortcuts and familiar concepts like canvas, layers and inspector panel. Workflow is streamlined with the ability to drag and drop media files directly into your experiences and manage your own Judo files in Finder. Manage Creative Execution A Judo experience is interactive and can include text, images, video and buttons. An experience may be part of a screen, a single screen, or more typically multiple linked screens. Judo supports screen transitions, carousels, horizontal scrolling and modals. Clients can add custom fonts and define global colors and these are updates applied universally. Effortlessly Deploy Judo Cloud syncs your experiences with your iOS and ...

TestFlight

iOS beta testing on the fly Free over-the-air beta distribution TestFlight

Bending Test: iPhone 6, HTC One, Moto X and more

Apple Engineers in 'War Room' Tracking Down iOS 8 Issues on Social Media

nice approach for early field failure analysis Quality Assurance: Feedback Analysis Social Media Tracking Following the launch of iOS 8 to the public yesterday, Apple employees in Cupertino are working to locate and remedy iOS 8 bugs that are popping up. As described by one Reddit user, the company has a "War Room" at Apple where employees are tracking down issues on social media. MacRumors
LazyPages is a highly customizable library that helps you to show a scrollable list of view controllers synchronized with an index. It is written in Swift 2.2 for iOS 8+. Like Scrollable Tabs in Android. GitHub