Lessons from Evernote Usage of Apache Thrift Framework

This article throws light on underlying technology used by Evernote to meet the primary requirement of having client applications on different OS platforms connect to server application for accessing/updating the notes.


What is Evernote?


As per Wikipedia…Evernote is a suite of software and services designed for notetaking and archiving. A “note” can be a piece of formatted text, a full webpage or webpage excerpt, a photograph, a voice memo, or a handwritten “ink” note….

Evernote supports a number of operating system platforms (including OS X, iOS, Chrome OS, Android, Microsoft Windows, Windows Phone, BlackBerry, and webOS) and also offers online synchronisation and backup services. The diagram below illustrates Evernote support for multiple devices:


Look at this scenario. I, being an active user of Evernote, access and update same set of notes from desktop (client, Chrome browser), and mobile devices (my phone and iPad) as I access internet from one of these devices at different time of the day.  And, this is, primarily, why I love using Evernote is the flexibility that it provides to the users like me to work on my same set of notes using different devices anytime, anywhere.

The important point to note is the support for both “thin” clients (like web browsers) and “thick” synchronizing clients like the ones you need to install on your desktop. With such support, the end users are empowered to install & configure Evernote client applications on different devices and manage their notes efficiently. Following are some of the key characteristics of Evernote client application:

  • Cross-platform: Service interfaces are defined using Thrift Interface Definition Language (IDL) and Apache Thrift is used to generate client and server stubs to work with different programming languages.
  • Forward/backward compatibility: Thrift provides flexibility in modifying/adding structures, fields, service methods, and function parameters without breaking existing clients. This is one of the most powerful features of Thrift.
  • Binary-efficient: Binary data representing many embedded images in the notes (resulting as an outcome of synchronizing between different clients) needed to be passed in equivalent size across the wire.
  • Native bindings: With thrift, one is not required to take care of parsing/marshaling code on every different client.

The question, thus, arises is how does Evernote manage to support so many client applications on different OS platforms? What is the underlying integration technology? 


Apache Thrift Makes it All Possible!

As per Apache thrift website, The Apache Thrift software framework, for scalable cross-language services development, combines a software stack with a code generation engine to build services that work efficiently and seamlessly between C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, OCaml and Delphi and other languages. Simply speaking, Thrift is an interface definition language, a code generation tool and a set of libraries that take care of serialization and implement the transport protocol. 

With Apache thrift, Evernote was able to fulfill following key application requirements:

  1. Server-to-server communications in the backend
  2. Client-server synchronization over the Internet
    • Handle heterogeneous data with big binary blobs in a smooth manner
    • Reliably support backward/forward compatibility
    • Support the application on multiple platforms

At a very high level, different Evernote client applications invokes Evernote Service API for managing notes on the server. To achieve something similar like Evernote, all that one needs is a set of API and client and server side components generated using Thrift in following manner:

  • Define service definition file using Thrift IDL
  • Use Thrift compiler to achieve following:
    • Generate service interface code (for the server) in appropriate programming language. In case of Evernote, it is Java that runs on server.
    • Generate stubs (for the client) in different programming languages for different OS platform.


Who all uses Apache Thrift?

Apart from Evernote, following are some of the companies/projects that uses Thrift framework for different purposes:


Lessons Learnt…When to use Apache Thrift?

So, when would one want to use framework like Apache thrift?

  • If the requirements look similar to Evernote where there are multiple different client applications to be written using different programming languages, Thrift may be one of the prominent options to evaluate.
  • If there are complex data model with big binary attachments to be transported to the server, Thrift may prove to be a good choice.
  • If you got server side applications written using different programming languages which need to talk internally with each other, Thrift may be a good choice for evaluation.
  • If, however, the application that has few APIs and, need to exchange small/fewer messages may just live with REST based integration.




Ajitesh Kumar
Follow me

Ajitesh Kumar

I have been recently working in the area of Data analytics including Data Science and Machine Learning / Deep Learning. I am also passionate about different technologies including programming languages such as Java/JEE, Javascript, Python, R, Julia, etc, and technologies such as Blockchain, mobile computing, cloud-native technologies, application security, cloud computing platforms, big data, etc. For latest updates and blogs, follow us on Twitter. I would love to connect with you on Linkedin. Check out my latest book titled as First Principles Thinking: Building winning products using first principles thinking. Check out my other blog, Revive-n-Thrive.com
Posted in Integration, SOA. Tagged with , , .

Leave a Reply

Your email address will not be published. Required fields are marked *