Mozilla Raindrop

From Bauman National Library
This page was last modified on 19 June 2016, at 21:53.
Mozilla Raindrop
Developer(s) Mozilla Corporation
Repository {{#property:P1324}}
Operating system Cross Platform
Type Mozilla Public License 1.1
Website Official Raindrop

Raindrop is a messaging application building on Apache's CouchDB[1] which is used through a web interface. Raindrop works by collecting messages (currently emails and tweets, but more will be available through addons) and storing them as JSON optionally with attachments in CouchDB. They are then served to users with CouchDB's web-server so users can view them in their web browsers. By December 2009 there was a prototype for testers but no official stable release.

Basic Idea

Raindrop basic idea is in maintain links from interested you page, but save content located on it too. That is, if you read the article, it will save its text with illustrations, photo galleries on the page will save the corresponding picture, and from YouTube -is will save the video. And all of this happens automatically, since the service is able to independently identify the main content of the page. For example, some letters can be very important, and some of them are the usual spam. Raindrop should determine this automatically, primarily to inform about really important events.



Raindrop stores the content depending on the page type. A also provides the following features:

  • Subscriptions - You can subscribe to public collections
  • Search - Ability to search context by title, description, tags, site or bookmark type
  • Import and export bookmarks - You can Import and export it from any browser, or some services


The back-end consists of a few main components. Before reading this, you should familiarize yourself with the Software Architecture description and the Raindrop Document Model for some key concepts.


The server/python/ script always performs a 'bootstrap' process as it starts up. It creates the database if necessary, then creates certain couch documents necessary for raindrop to operate - these files include all of the user-interface, front and back-end extensions, "sample" documents, account information and so forth.

While the raindrop runtime loads all its content from the database, this bootstrap process always compares the files in the raindrop source tree with the version in the couch and updates the couch documents as required. This is done primarily to make it simple for the raindrop developers to maintain this initial content in source-control. So although the content is loaded from the database, the file-system implicitly 'overrides' changes made to the document the next time the bootstrap process is run (ie, the next time is executed.) In the future, and particularly as we get better support for editing this content directly in raindrop, we expect this bootstrap behaviour to change such that changes made to these items directly in the database are able to override the defaults on the file-system.

The work queue

The work queue describes how raindrop runs extensions over documents. The term "work queue" is actually a misnomer - the queue is a logical queue - and there are actually 2 different "queues" implemented even though they share the same underlying principles - both leverage couchdb's ability to report the changes made to the database in the order they happened, or are happening.

Incoming Queue

The 'incoming queue processor' is code which asks couchdb for database changes as they are happening. Each time a new change is seen, raindrop determines the schema-id for the item, determines which extensions need to run over the items and executes those extensions. These extensions will generally create new documents, which are written as normal - but this writing of the new documents then triggers couch to report these as database changes, and the process repeats.

Backlog Queue

While the 'incoming queue' works fine in the perfect world, the reality is that in some cases we need to execute extensions over items which previously existed in the database. In this model, all extensions are executed independently from each other over these old documents in the order they were created in the database. The "state" (ie, exactly where in this changelist the extension is currently at) is maintained independently for each extension, so when raindrop restarts the extension can be continued where it left off. As a result, extensions which are slower may take longer to get through the backlog than others - in other words, each extension has a completely independent position in the changelist than others. Individual extensions, or all extensions, can be processed in this way.


The Front End of Raindrop is the part that constructs the user interface. It calls APIs on the back end to populate the UI with data. The user interface is plain HTML, JavaScript and CSS. It is served as static files from CouchDB.

Code Layers

The Front End has the following logical sections:

  1. JavaScript Data API files that wrap the sometimes-complex chain of CouchDB calls (in raindrop/client/lib/rd/api)
  2. UI Widgets that use the JavaScript API (in raindrop/client/lib/rdw)
  3. Web Applications that use the UI Widgets (in raindrop/client, the directories that are not "lib", "dojo" or "bespin".

JavaScript Data API

  ids: []
.ok(function(json) {

.error(function(err) {


UI Widgets

The UI widgets use the JS Data API to display some aspect of the back-end data. They are located in raindrop /client/lib/rdw/ directory. Most widgets derive from the rdw._Base base "class". Dojo's Dijit widget system is used for the basis of the widgets. rdw._Base uses dijit._Widget and dijit._Templated. It also loads a default i18n bundle and creates some utility methods for dealing with child widgets.

Web Applications

The highest level of the code structure is applications. They are HTML, JavaScript and CSS files that reside in the rdw/client folder. Right now, the following apps have been started:

  • raindrop/rdw/client/extender/ - The UI for a user to create simple extensions and try them while they edit.
  • raindrop/rdw/client/inflow/ - The main application for raindrop -- shows your messages with a focus on conversations and person-to-person interaction.
  • raindrop/rdw/client/inflowgrid/ - An experiment that explores an alternate presentation of the inflow app using a strict grid layout.
  • raindrop/rdw/client/rd_list/ - A listing of installed applications. Not very interesting at the moment, but may gain more importance as other apps are written for the raindrop platform.
  • raindrop/rdw/client/settings/ - Shows the user's accounts, allows them to enter credentials for each account.


Cite error: Invalid <references> tag; parameter "group" is allowed only.

Use <references />, or <references group="..." />


  • Apache CouchDB™ is a database that uses JSON for documents, JavaScript for MapReduce indexes, and regular HTTP for its API.