Pinterest Open-Sources Big Data Analytics Tool Querybook

Recently, Pinterest open-sourced its big data analytics instrument Querybook that began its life as an intern undertaking in 2017. Querybook auto analyses executed queries to offer information lineage, instance queries, frequent consumer info, and search/auto-completion rating. In 2018, the large information instrument was launched internally and shortly grew to become the official answer to question massive information at Pinterest.

According to its developers, Querybook is constructed to offer a easy net UI for big data evaluation to find the correct information, compose queries, and share findings. 

Behind Querybook

Querybook is a Big Data IDE that enables customers to create, uncover, and share information analyses, queries, and tables. The instrument contains Database, Redis, ElasticSearch and distant storage. The Database is used to retailer the DataDocs, and MySQL is really helpful. Redis is required to ship async duties to staff, keep multi-server WebSocket connections, and caching dwell information for collaborative enhancing. ElasticSearch offers search performance for database paperwork similar to DataDocs and tables. Lastly, the distant storage shops the question outcomes.

Querybook has three key components-

  • Web Server: The Web Server is used to deal with HTTP requests, ship/obtain Websocket messages, and supply the static property for the online.
  • Worker: This element is principally used to execute long-running queries and scheduled DataDocs. It may also be used for auxiliary duties similar to updating ElasticSearch docs or analysing question lineage. 
  • Scheduler: Scheduler reads the duty schedule from the database and sends it to the Celery staff.


  • Querybook compose queries with autocompletion and hovering tooltip.
  • The instrument makes use of each scheduling and charting in DataDocs to construct dashboards.
  • Querybook has built-in rich-text assist for customers. 
  • The instrument permits dwell question collaborations. 
  • Users can add extra documentation to the tables.
  • Using this instrument, one can get lineage, pattern queries, frequent consumer, search rating based mostly on previous question runs.

How To Use It

According to its builders, there are two fundamental methods to arrange the big data analytics instrument.

Single-Machine Instant Setup (domestically or on a server): 

The single machine methodology is a fast technique to check out Querybook for lower than 5 customers. This methodology makes use of docker-compose to carry up all the mandatory infrastructure, which is why Docker must be put in for fast setup.

For set up, open terminal and run the next: 

git clone

cd querybook

Now run the next: 


Multi-Machine Setup

The multi-machine setup is required when somebody desires to scale Querybook for 1000’s of customers. The multi-machine arrange runs Querybook containers on completely different machines/pods. This methodology is extra difficult than the one machine on the spot arrange and requires exterior infrastructure. The arrange contains the next steps-

See Also

Step-1: Requirements

  • A MySQL/PostgresSQL[^1] database with model >=5.7. It is really helpful to have greater than 5GB of house.
  • An Elasticsearch server with model 6.6.1.
  • A 2GB Redis occasion, Querybook mustn’t use greater than 1GB of reminiscence.
  • If OAuth shall be used for authentication, bear in mind to get the OAuth shopper info (secrets and techniques, token url, and so on).
  • For notifications, you would want both a Slack API Token or an electronic mail tackle and the e-mail server working on port 25 of the online server. 

Step-2: Choose the cases

  • In this step, customers might want to deploy three completely different providers for Querybook. The net servers deal with the HTTP/WebSocket visitors, the employees deal with the async duties similar to working the question, and the scheduler sends scheduled duties to the employees. Also, you will need to ensure to solely have one occasion of scheduler working to forestall duplication in scheduled duties and have a minimum of two staff for rolling restart deployments.

Step-3: Update your surroundings variables configuration 

Step-4: Start every service

You can begin every service by the next instructions:

  • Webserver: make net
  • Celery employee: make employee
  • Scheduler: make scheduler

Wrapping Up

To make it generic whereas preserving a number of the Pinterest-specific integrations, the builders determined to have a two-layer organisation by way of a plugin system and add an Admin UI. The Admin UI permits organisations to configure the question engines, desk metadata ingestion, and entry permissions from a single pleasant interface. The plugin system integrates Querybook with the inner programs at Pinterest by utilising Python’s importlib.

Subscribe to our Newsletter

Get the newest updates and related presents by sharing your electronic mail.

Join Our Telegram Group. Be a part of an enticing on-line neighborhood. Join Here.
Ambika Choudhury

Ambika Choudhury

A Technical Journalist who loves writing about Machine Learning and Artificial Intelligence. A lover of music, writing and studying one thing out of the field. Contact: [email protected]

Related Posts