Heroku Postgres

  • Published on
    10-May-2015

  • View
    2.066

  • Download
    7

Embed Size (px)

DESCRIPTION

2012126 Cloudforce Japan Developer Zone

Transcript

<ul><li>1.http://postgres.heroku.com @leinweber Heroku,Inc.</li></ul> <p>2. ArchitectureForce.comHeroku Others Heroku RuntimeDatabase.comHeroku Postgres 3. Database.comSocial Enterprise DBaaSHeroku Postgres SQL Database-as-a-Service 4. Lets Provision a Database 5. heroku addons:add heroku-postgres:dev -a will 6. Value-Added FeaturesHeroku PostgresPostgres Management Services 7. Value-Added FeaturesHeroku PostgresPostgres Management Services 8. Managed Services 9. DB DBA TasksSetup Manage Security BackupScale/ Query 10. DB DBA TasksSetup Manage Security BackupScale/ Query 11. 24x365 24x365 Monitoring Health Checks Continuous Protection 12. Value-Added FeaturesHeroku PostgresPostgres Management Services 13. Postgres 14. 100% 100% Compatibility 15. Postgres?Why Postgres? 16. Users PurchasesProducts 17. CREATE TABLE products (id integer NOT NULL,title character varying(255),description text,price numeric(10,2)); 18. CREATE TABLE users (id integer NOT NULL,rst_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); 19. CREATE TABLE purchases ( id integer NOT NULL, user_id integer, items decimal(10,2) [][], occurred_at timestamp); items[x][0] = item_id items [x][1] = qty items [x][2] = price 20. Data typesINSERT INTO purchases VALUES (2, 2, {{11.0, 1.0, 4.99}}, now()); 21. Other languadgesbigint polygon moneytimestamp date booleaninterval tz smallintarray integer UUID serialbyteachar linenumeric inet cidrpointcircletime textoatmacaddr timetzenumvarchar tsquery XMLpath tsvector timestamp box 22. Other languadgesCREATE 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 LOOPs := s + (x[2] * x[3]); END LOOP; RETURN s;END;$$ LANGUAGE plpgsql; 23. Other languadgesFOREACH x SLICE 1 IN ARRAY $1 LOOPs := s + (x[2] * x[3]); END LOOP; RETURN s; 24. Other languadgespython pgsql ruby jlolcodeluaV8 R schemetcl SQL psmJavash phpjavascript 25. ExtentionCREATE EXTENSION hstore;CREATE TABLE users ( id integer NOT NULL, rst_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); 26. ExtentionINSERT INTO usersVALUES ( 1, Craig, Kerstiens, craig.kerstiens@gmail.com, sex =&gt; "M", state =&gt; "CA", now(), now()); 27. Extentiondblink hstore uuid-ossp trigrampgstattuplecitext pgcrypto pgrowlocksisn ltreeearthdistancecubedict_int tablefuncfuzzystrmatch unaccent dict_xsynbtree_gist 28. Value-Added FeaturesHeroku PostgresPostgres Management Services 29. Value-Added Features 30. Data ClipsThe easiest way to share your data 31. + SELECT *FROM salesLive Production Data WHERE amount &gt; 1 32. https://postgres.heroku.com/dataclips/{unique &amp; secure hash} 33. Fork A perfect, byte-for-byte clone of your database 34. ForkProduction App 35. ForkProduction App 36. ForkProduction App Investigate data safty 37. FollowRead replicas with a single click 38. FollowMasterDatabaseWrite Transactions Follower 1 Follower 2 Read Transactions 39. MasterDatabaseWrite Transactions Follower 1 Follower 2 Read Transactions 40. MasterDatabaseWrite TransactionsNew Master Follower 2 Read Transactions 41. Heroku Postgres Workbokhttp://developerforcejp.s3.amazonaws.com/developer/docs/workbook_heroku/workbook_heroku_postgres.pdfhttp://postgres.heroku.com </p>