Download - CartoDB Inside Out

Transcript
Page 1: CartoDB Inside Out

CartoDBInside Out

Jorge Sanz · [email protected] · @xurxosanzSASIG · OSGeo.pt · Lisbon · 2015

A technical overview of a web mapping platform

Page 2: CartoDB Inside Out

Agenda● Why

● CartoDB nowadays

● Architecture of the platform

○ Components

○ Setup

● How to serve dynamic data at scale

No maps in this talk sorry

Page 5: CartoDB Inside Out

Why● @jatorre and @saleiva start Vizzuality in April 2008

● Company focused on visualization projects

● Every geospatial project had the same stack:

○ Database + Map Server + APIs + client code

● CartoDB: internal product to deploy faster this geo-stack

Page 6: CartoDB Inside Out

Mission

With CartoDB everybody can analyse,visualise and share insights on location data.We are democratising location intelligence

Page 7: CartoDB Inside Out

CartoDB nowadays● A VC founded company of ~70 people (NY + Madrid)

● A leading mapping service with +130.000 users

● An Open Source product that can be deployed

on the cloud or on just one server (on-premises)

● Full stack solution from storage to client side libraries

● It’s a mapping editor supported by a platform (APIs)

Page 8: CartoDB Inside Out

CartoDB architecture

Page 11: CartoDB Inside Out

The CartoDB platform● Spatial database for users● NoSQL database for

configurations and cache● Rendering, imports,

database and other services● Cache and Content

Delivery Network● JavaScript Library● Map Editor

Platform

On-premisesor in the Cloud

Data servicesYour data

Editor

Page 12: CartoDB Inside Out

The CartoDB platform

CartoDB.js Odyssey.jsTorque.js Leaflet /Gmaps

PostgreSQL

PostGIS

SQL API

Redis

Maps API

TorqueMapnik

Varnish Caching

Fastly CDN

Car

toD

B o

n A

maz

on

el

asti

c R

ecip

es

Car

toD

B o

n

Am

azo

n e

last

ic

Rec

ipes

PostgreSQL

PostGIS

CartoDB Server API

Rest API Imports API

CartoDB Editor

Browser

Page 13: CartoDB Inside Out

Cloud setup● 1 - load balancer (nginx)

● 1 - caching (varnish)

● N - UI servers (CartoDB UI)

● N - database servers (user data)

● 1 - Metadata server (CartoDB metadata)

● 1 - redis server (+slave)

● N - Maps API + API SQL servers

Page 14: CartoDB Inside Out
Page 15: CartoDB Inside Out

Postgres + Postgis● Geodata, users and editor metadata storage

● Tiny Well Known Binary

● CartoDB - Postgres extension

Redis● key-value highly performant storage

● configuration for APIs

● cache

Page 16: CartoDB Inside Out

Backend services● Ruby on Rails

● Import API (ogr2ogr)

● Background management tasks

Invalidation service● Node.js + HA Proxy + Consul

● Invalidates caches by request

● Multi-agent, replicated

Page 17: CartoDB Inside Out

SQL API● node.js

● Exposes an entry point for running queries

● Acts as an export API

Maps API · Windshaft● node.js + mapnik

● renders tiles from CartoCSS + SQL

● SQL API client

Page 18: CartoDB Inside Out

nginx● web server

● load balancer

Varnish + Fastly/GCP● web cache

● Content Delivery Network

Page 19: CartoDB Inside Out

CartoDBMap Editor

the easiest web mapping tool

ever

Page 20: CartoDB Inside Out

Map Editor● Ruby on Rails + JavaScript

● Consumes the Imports, Maps, SQL API and its own API

● Highly focused on UX-UI

● Manage datasets (schema, privacy, etc)

● Manage maps (basemap, infowindows,

other visual elements, privacy, etc)

● Define layer data source with filters and SQL editor

● Define symbology through wizards and CartoCSS editor

● Publish maps as embeds, links or with CartoDB.js

Page 21: CartoDB Inside Out

CartoDB.js● Based on jQuery + Backbone + Underscore

● Leverages Leaflet or Google Maps API

● Easy interaction with the SQL and Maps API

● Manages transparently utf-grids for interactivity

● Allows easy customizations on infowindows,

layer SQL and CartoCSS definitions, etc

Page 22: CartoDB Inside Out

Serving data at scale

Page 24: CartoDB Inside Out

http://mappingkat.github.io/indian-removal/

Page 25: CartoDB Inside Out

Story of a tile: first request

Page 26: CartoDB Inside Out

Story of a tile: next request

Page 27: CartoDB Inside Out

Story of a tile: insert & next request

Page 28: CartoDB Inside Out

Cache invalidation

Write queries fire a trigger that updates

cdb_tablemetadata and starts the invalidation

process for the tiles that use that table

Page 29: CartoDB Inside Out

Summary● CartoDB is an Open Source, full stack mapping product

● Runs on a single server or distributed

● Delivers to thousands of users the superpowers of Postgis

and Mapnik, not just pretty maps but also new insights

● Provides tools for users and developers

● It’s designed to scale, but we are always improving it

Page 30: CartoDB Inside Out

We are hiring!!

http://cartodb.com/jobs

Page 31: CartoDB Inside Out

CartoDBInside Out

Jorge Sanz · [email protected] · @xurxosanzSASIG · OSGeo.pt · Lisbon · 2015http://bit.ly/cartodb-sasig2015

Muito obrigado! · Questions?


Top Related