What is Facebook Lite?

Facebook rolled a new version of the Facebook App for Android specifically designed for emerging markets in June 2015. The App became a fastest growing version of Facebook and crossed 100 million users in less than nine months. The App is extremely lite, and the APK download is a task of few seconds on a slow connection. It is available in more than 56 languages and most popular in developing Nations. The target is to reach two billion users!

Why Facebook developed the Lite version?

To reach out to the unexplored markets of slow internet connectivity and old Android devices, Facebook launched this App. The fact is 95% of the World population is still using the 2G internet connection, and the potential clients for this type of App are very high. Even if the data access is difficult in multiple developing countries due to slow speed or stability of connection, Facebook wanted to make their App available to these people.

Another important factor was while reaching to these users, the cost of data and overall data usage was a prime factor. Research showed that people wanted to access Facebook but not by paying high data charges. The idea was to deliver a light, fast and native Facebook to these Android phone users in emerging markets. The innovative ways should also help the growth of Startup markets and freelance jobs.

Facebook Lite Architecture

With a lot of constraints for design, Facebook selected a proxy server Architecture with a very thin client on Android. The Android Application Package (APK) size was important. The package size decides the time required to download an App and the target was set to have it around 1 MB. Facebook Lite’s product manager Vijay Shankar has himself explained this architecture.

Small APK Size

The Facebook Lite used an innovative approach to cut down the size of APK. The Lite APK is different from all other Android Apps and doesn’t have the product code. The client is just a VM interacting with the Operating System with Android App User Interface. The product code lies on the server and is sending specific resources to the client App as needed. The downloaded resources get cached in the device.

The design elements that tend to bloat APKs, like translations and images are sent down from the server on demand and cached. In various places, to save data and size, Facebook used Unicode symbols instead of image resources to represent icons.

The Architecture is very robust and can scale up quickly. Facebook can go on adding multiple other features on the server side and can also develop new products with the same architecture. While expanding on features and capabilities, the APK is not going to grow! A cool architecture which can be a trend setter for all those who want the market share of large unexplored emerging markets. Use of more Apps in emerging market will also give rise to more freelance work.

The Facebook Lite architecture design expects the server side to do the heavy lifting of code and resources for the App to work on very low powered devices. It is not only about the internet speed and bandwidth, but the App was supposed to work on old Android devices with old OS as well as very less RAM.

The server fetches data from the backend services and sends the screens to the client in the compressed form. As the client interacts with a single server, the server can take a call on the data to be pushed to the client along with the requested data to optimise the user experience.

Secured and Light Protocol

Instead of using HTTPS, Facebook Lite uses a custom protocol over TLS (directly over TCP). The Transport Layer Security (TLS) protocol provides privacy and data integrity between two communicating applications. The compressed message exchange takes place over the TLS connection the client establishes to the server for the duration of the session.

This design opens the door for a lot of optimisations that help with reducing data usage and performing on 2G networks. Using this protocol ensures data integrity as each message includes a message integrity check. The Lite has a set of image servers that talk to the Content Delivery Network (CDN) and other image stores to enable the Lite server to serve exact-size images to the client.

App Optimisation

Lite’s network stack optimises for working on slow 2G networks and reducing data usage. A pain point in a 2G network is that establishing a connection is very slow. As most Lite traffic flows over a single connection to the backend, this pain point is taken care in this App.

As the client repeatedly talks to the same server, it uses dynamic shared dictionary compression to messages across a session. They have used LZMA2 data compression for server-to-client messages. Use of tools like Augmented Traffic Control and the Internet.org Innovation Lab were critical to simulate 2G networks for testing in realistic conditions for Facebook.

The Lite server knows exactly the screen width, height, and screen density of the client. Instead of talking to the Client Data Networks, the Lite client receives exact-size images over the same TCP connection from the Lite server. The server can adjust the image quality and format images exactly at the size needed, rather than use the standard supported sizes in the CDN.

Summary

Lite Client app has the basic stuff needed to render layouts. It doesn’t have a large number of assets or animations. The result is the small app size of 1.5 MB.

TCP/TLS Protocol: They have created a lightweight custom TLS protocol, which is very effective and efficient compared to usual HTTPS protocol. It works decently on 2G networks

Lite Server: This plays the major role in the success of this App. It fetches the data required for the user from the FB backend and respective images from CDN. It also caches the required views.

Overall Facebook has developed a great App with a fantastic Architecture and no doubt the App will reach its target population goals.