38
Heroku Postgres Webinar Craig Kerstiens Matt Soldo

Heroku Postgres Cloud Database Webinar

Embed Size (px)

DESCRIPTION

This webinar took place on August 23, 2012. Never worry about servers. Never worry about config files. Never worry about patches. Simply focus on your data with Heroku Postgres. PostgreSQL is a powerful, reliable, and durable open-source SQL-compliant database. Now available as a fully-managed cloud database from salesforce.com, Heroku Postgres reduces the costs and administrative overhead compared to operating your own database. You can even create a database instance within seconds with a single click. Watch this webinar to learn about: :: When to use Heroku Postgres versus Database.com :: What data you can and should store in Heroku Postgres :: Architecting your application with Heroku Postgres :: How to efficiently share data in your organization with Dataclips :: How to take advantage of features such as Fork and Follow to scale

Citation preview

Page 1: Heroku Postgres Cloud Database Webinar

Heroku  Postgres  Webinar

Craig  Kerstiens

Matt  Soldo

Page 2: Heroku Postgres Cloud Database Webinar

Architecture

Heroku Runtime

Database.com Heroku Postgres

Force.comOther

Platforms

Page 3: Heroku Postgres Cloud Database Webinar

Heroku  Postgres

Social  Enterprise  DBaaS

SQL  Database-­‐as-­‐a-­‐Service

Database.com

Page 4: Heroku Postgres Cloud Database Webinar

Let’s  Provision  a  Database

Page 5: Heroku Postgres Cloud Database Webinar

Heroku Postgres

Management Services

Postgres

Value-Added Features

Page 6: Heroku Postgres Cloud Database Webinar

Heroku Postgres

Management Services

Postgres

Value-Added Features

Page 7: Heroku Postgres Cloud Database Webinar

Management  Services

Page 8: Heroku Postgres Cloud Database Webinar

Setup

Manage

Security

Backup

Scale

Query

DBA  Tasks

Page 9: Heroku Postgres Cloud Database Webinar

Setup

Manage

Security

Backup

Scale

Query

DBA  Tasks

Page 10: Heroku Postgres Cloud Database Webinar

We  hold  the  pager

Health  Checks

Continuous  Protection

Page 11: Heroku Postgres Cloud Database Webinar

Heroku Postgres

Management Services

Postgres

Value-Added Features

Page 12: Heroku Postgres Cloud Database Webinar

Heroku Postgres

Management Services

Postgres

Value-Added Features

Page 13: Heroku Postgres Cloud Database Webinar

100%  Compatible

Page 14: Heroku Postgres Cloud Database Webinar

Why  Postgres?

Page 15: Heroku Postgres Cloud Database Webinar

Users Purchases

Products

Page 16: Heroku Postgres Cloud Database Webinar

CREATE  TABLE  products  (        id  integer  NOT  NULL,        title  character  varying(255),        description  text,        price  numeric(10,2));

Page 17: Heroku Postgres Cloud Database Webinar

CREATE  TABLE  users  (        id  integer  NOT  NULL,        first_name  character  varying(50),        last_name  character  varying(50),        email  character  varying(255),        data  hstore,        created_at  timestamp  without  time  zone,        updated_at  timestamp  without  time  zone,        last_login  timestamp  with  time  zone);

Page 18: Heroku Postgres Cloud Database Webinar

CREATE  TABLE  purchases  (        id  integer  NOT  NULL,        user_id  integer,        items  decimal(10,2)  [][],        occurred_at  timestamp);

Page 19: Heroku Postgres Cloud Database Webinar

CREATE  TABLE  purchases  (        id  integer  NOT  NULL,        user_id  integer,        items  decimal(10,2)  [][],        occurred_at  timestamp);

Page 20: Heroku Postgres Cloud Database Webinar

CREATE  TABLE  purchases  (        id  integer  NOT  NULL,        user_id  integer,        items  decimal(10,2)  [][],        occurred_at  timestamp);

items[x][0] = item_iditems [x][1] = qtyitems [x][2] = price

Page 21: Heroku Postgres Cloud Database Webinar

Data  Types

INSERT  INTO  purchases  VALUES  (    2,  2,  '{{11.0,  1.0,  4.99}}',  now());

Page 22: Heroku Postgres Cloud Database Webinar

Data  Types

smallint

bigint

integernumeric

float

serial

money

char

varchar

text

bytea

timestamp

timestamptz date

time timetz

intervalboolean

enum

pointline

polygon

box

circle

path

inet cidrmacaddr

tsvectortsquery

array

XML

UUID

Page 23: Heroku Postgres Cloud Database Webinar

Other  Languages

CREATE  OR  REPLACE  FUNCTION  total(decimal(10,2)[][])  RETURNS  decimal(10,2)  AS  $$DECLARE    s  decimal(10,2)  :=  0;    x  decimal[];BEGIN    FOREACH  x  SLICE  1  IN  ARRAY  $1    LOOP        s  :=  s  +  (x[2]  *  x[3]);    END  LOOP;    RETURN  s;END;$$  LANGUAGE  plpgsql;

Page 24: Heroku Postgres Cloud Database Webinar

Other  Languages

FOREACH  x  SLICE  1  IN  ARRAY  $1    LOOP        s  :=  s  +  (x[2]  *  x[3]);    END  LOOP;    RETURN  s;

Page 25: Heroku Postgres Cloud Database Webinar

Other  Languages

pythonrubypgsql

SQLtcl

sh

RV8Java

javascript

lolcode

scheme

php

j

luapsm

Page 26: Heroku Postgres Cloud Database Webinar

ExtensionsCREATE  EXTENSION  hstore;CREATE  TABLE  users  (        id  integer  NOT  NULL,        first_name  character  varying(50),        last_name  character  varying(50),        email  character  varying(255),        data  hstore,        created_at  timestamp  without  time  zone,        last_login  timestamp  without  time  zone);

Page 27: Heroku Postgres Cloud Database Webinar

ExtensionsINSERT  INTO  users  VALUES  (1,  'Craig',  'Kerstiens',  '[email protected]',  'sex  =>  "M",  state  =>  "CA"',  now(),  now()

);

Page 28: Heroku Postgres Cloud Database Webinar

Extensions

dblink hstorecitext

ltreeisncube

pgcrypto

tablefunc

uuid-ossp

earthdistance

trigram

fuzzystrmatch

pgrowlockspgstattuple

btree_gist

dict_intdict_xsynunaccent

Page 29: Heroku Postgres Cloud Database Webinar

Heroku Postgres

Management Services

Postgres

Value-Added Features

Page 30: Heroku Postgres Cloud Database Webinar

Heroku Postgres

Management Services

Postgres

Value-Added Features

Page 31: Heroku Postgres Cloud Database Webinar

Data  ClipsThe  easiest  way  to  share  your  data

Page 32: Heroku Postgres Cloud Database Webinar

SELECT * FROM salesWHERE amount > 1

+Your Live Production Data

Page 33: Heroku Postgres Cloud Database Webinar

https://postgres.heroku.com/dataclips/{unique  &  secure  hash}

Page 34: Heroku Postgres Cloud Database Webinar

FollowersMasterDatabase

Follower  1

Follower  2

Write  Transactions

Read  Transactions

Page 35: Heroku Postgres Cloud Database Webinar

FollowersMasterDatabase

Follower  1

Follower  2

Write  Transactions

Read  Transactions

Page 36: Heroku Postgres Cloud Database Webinar

FollowersMasterDatabase

New  Master

Follower  2

Write  Transactions

Read  Transactions

Page 37: Heroku Postgres Cloud Database Webinar

Pricing  and  Availability

Page 38: Heroku Postgres Cloud Database Webinar

Learn  More

Try  It  free:      https://postgres.heroku.com

Code:                        https://github.com/craigkerstiens/postgres-­‐demo

Survey:                http://bit.ly/herokupostgressurvey

[email protected]    |    [email protected]