Why use PostgreSQL?


Published on

10 reasons for using PostgreSQL

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Why use PostgreSQL?

  1. 1. Why use PostgreSQL? 10 reasons for using PostgreSQL PGDay Australia 2013 Melbourne, 4 February 2013 Gabriele Bartolini 2ndQuadrant gabriele.bartolini@2ndQuadrant.it @_GBartolini_
  2. 2. Gabriele Bartolini• Co-founder and Manager of 2ndQuadrant Italia • Data Architect in business critical environments • Data warehousing• Member of the PostgreSQL community • Co-founder of Italian PostgreSQL Users Group • Co-founder of PostgreSQL Europe
  3. 3. Is it PostgreSQL or Postgres? It’s both
  4. 4. 10 reasons for using Postgres• Open Source Community • Business Continuity• License • Security and data protection• Total Cost of Ownership • PostgreSQL Eco-system• Development life cycle • Performance and scalability• Quality of code and • Works the way you do documentation
  5. 5. #1Open Source Community
  6. 6. Open Source community• Sense of Community • Developers, users and advocates• Volunteers and professionals• Hundreds of members from all over the world • sensitive to i18n and l10n issues!
  7. 7. #2License
  8. 8. PostgreSQL Database Management System(formerly known as Postgres, then as Postgres95)Portions Copyright (c) 1996-2012, PostgreSQL Global Development GroupPortions Copyright (c) 1994, The Regents of the University of CaliforniaPermission to use, copy, modify, and distribute this software and itsdocumentation for any purpose, without fee, and without a written agreementis hereby granted, provided that the above copyright notice and thisparagraph and the following two paragraphs appear in all copies.IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FORDIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDINGLOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITSDOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THEPOSSIBILITY OF SUCH DAMAGE.THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITYAND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER ISON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TOPROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  9. 9. License• Applies to every part (module, product, option) of Postgres • server, client, libraries, additional modules • 100% open source• Highly Permissive • Not subject to monopoly nor acquisitions• No need to hire a lawyer to understand it
  10. 10. You may allow your end users to permit third parties to use the Programs on such end users behalf for the purposes set forth in the end user license agreement, subject to the terms of such Restricted Rights agreement.You shall be financially responsible for all claims and If you distribute a license to the United States government, theXXXXXXX Technology Network Development and Distribution "We," "us," and "our" refers to XXXXXXX America, Inc. "You" damages to us caused by your failure to include the required Programs, including documentation, shall be consideredLicense Terms for Instant Client and "your" refers to the individual or entity that wishes to use the contractual terms set forth above in each end user license commercial computer software and you will place a legend, in Programs from XXXXXXX under this Agreement. "Programs" agreement between you and an end user. We are a third party addition to applicable copyright notices, on the documentation, refers to the Software Products referenced below that you wish beneficiary of any end user license agreement between you and and on the media label, substantially similar to the following:Export Controls on the Programs to download and use and Program documentation. "License" the end user, but do not assume any of your obligations NOTICE OF RESTRICTED RIGHTSSelecting the "Accept License Agreement" button is a confirmation refers to your right to use the Programs and Program thereunder, and you agree that you will not enter into any end "Programs delivered subject to the DOD FAR Supplement areof your agreement that you comply, now and during the trial documentation under the terms of this Agreement. The user license agreement that excludes us as a third party commercial computer software and use, duplication, andterm, with each of the following statements: substantive and procedural laws of California govern this beneficiary and will inform your end users of our rights. disclosure of the programs, including documentation, shall be Agreement.You and XXXXXXX agree to submit to the exclusive subject to the licensing restrictions set forth in the applicable jurisdiction of, and venue in, the courts of San Francisco, San If you want to use the Programs for any purpose other than as XXXXXXX license agreement. Otherwise, programs delivered-You are not a citizen, national, or resident of, and are not under Mateo, or Santa Clara counties in California in any dispute arising expressly permitted under this Agreement you must contact us to subject to the Federal Acquisition Regulations are restrictedcontrol of, the government of Cuba, Iran, Sudan, Libya, North out of or relating to this Agreement. obtain the appropriate license. We may audit your use of the computer software and use, duplication, and disclosure of theKorea, Syria, nor any country to which the United States has Programs. Program documentation is either shipped with the programs, including documentation, shall be subject to theprohibited export. We are willing to license the Programs to you only upon the Programs, or documentation may be accessed online at http:// restrictions in FAR 52.227-19, Commercial Computer Software--You will not download or otherwise export or re-export the condition that you accept all of the terms contained in this www.XXXXXXX.com/technetwork/indexes/documentation/ Restricted Rights (June 1987). XXXXXXX Corporation, 500Programs, directly or indirectly, to the above mentioned countries Agreement. Read the terms carefully and select the "Accept" index.html. XXXXXXX Parkway, Redwood City, CA 94065."nor to citizens, nationals or residents of those countries. button at the bottom of the page to confirm your acceptance. If-You are not listed on the United States Department of Treasury you are not willing to be bound by these terms, select the "Do You agree to: (a) defend and indemnify us against all claims and End of Agreementlists of Specially Designated Nationals, Specially Designated Not Accept" button and the registration process will not damages caused by your distribution of the Programs in breach of You may terminate this Agreement by destroying all copies of theTerrorists, and Specially Designated Narcotic Traffickers, nor are continue. this Agreement and/or failure to include the required contractual Programs. We have the right to terminate your right to use theyou listed on the United States Department of Commerce Table provisions in your end user agreement as stated above; (b) keep Programs if you fail to comply with any of the terms of thisof Denial Orders. Software Product executed end user agreements and records of end user Agreement, in which case you shall destroy all copies of the - Instant Client information including name, address, date of distribution and Programs. identity of Programs distributed; (c) allow us to inspect your endYou will not download or otherwise export or re-export the License Rights user agreements and records upon request; and, (d) enforce the Relationship Between the PartiesPrograms, directly or indirectly, to persons on the above terms of your end user agreements so as to effect a timely cure of The relationship between you and us is that of licensee/licensor.mentioned lists. License. any end user breach, and to notify us of any breach of the terms. Neither party will represent that it has any authority to assume or We grant you a non-exclusive right and license to use the create any obligation, express or implied, on behalf of the other Programs solely for your business purposes and development and Ownership and Restrictions party, nor to represent the other party as agent, employee,You will not use the Programs for, and will not allow the Programs testing purposes, subject to the terms of this Agreement.You may We retain all ownership and intellectual property rights in the franchisee, or in any other capacity. Nothing in this Agreementto be used for, any purposes prohibited by United States law, allow third parties to use the Programs, subject to the terms of Programs.You may make a sufficient number of copies of the shall be construed to limit either partys right to independentlyincluding, without limitation, for the development, design, this Agreement, provided such third party use is for your business Programs for the licensed use and one copy of the Programs for develop or distribute software that is functionally similar to themanufacture or production of nuclear, chemical or biological operations only. backup purposes. other partys products, so long as proprietary information of theweapons of mass destruction. other party is not included in such software. Distribution License You may not: We grant you a non-exclusive right and license to distribute the -use the Programs for any purpose other than as provided above; Open SourceEXPORT RESTRICTIONS Programs, provided that you do not charge your end users for use -charge your end users for use of the Programs; "Open Source" software - software available without charge forYou agree that U.S. export control laws and other applicable of the Programs.Your distribution of such Programs shall at a -remove or modify any Program markings or any notice of our use, modification and distribution - is often licensed under termsexport and import laws govern your use of the programs, minimum include the following terms in an executed license proprietary rights; that require the user to make the users modifications to theincluding technical data; additional information can be found on agreement between you and the end user that: (1) restrict the use -assign this agreement or give the Programs, Program access or an Open Source software or any software that the user combinesXXXXXXX®s Global Trade Compliance web site (http:// of the Programs to the business operations of the end user; (2) interest in the Programs to any individual or entity except as with the Open Source software freely available in source codewww.XXXXXXX.com/products/export). prohibit (a) the end user from assigning, giving, or transferring the provided under this agreement; form. If you use Open Source software in conjunction with the Programs or an interest in them to another individual or entity -cause or permit reverse engineering (unless required by law for Programs, you must ensure that your use does not: (i) create, or (and if your end user grants a security interest in the Programs, interoperability), disassembly or decompilation of the Programs; purport to create, obligations of us with respect to theYou agree that neither the programs nor any direct product the secured party has no right to use or transfer the Programs); -disclose results of any Program benchmark tests without our XXXXXXX Programs; or (ii) grant, or purport to grant, to anythereof will be exported, directly, or indirectly, in violation of these (b) make the Programs available in any manner to any third party prior consent. third party any rights to or immunities under our intellectuallaws, or will be used for any purpose prohibited by these laws for use in the third partys business operations (unless such access property or proprietary rights in the XXXXXXX Programs. Forincluding, without limitation, nuclear, chemical, or biological is expressly permitted for the specific program license or Export example, you may not develop a software program using anweapons proliferation. materials from the services you have acquired); and (c) title to the You agree that U.S. export control laws and other applicable XXXXXXX Program and an Open Source program where such Programs from passing to the end user or any other party; (3) export and import laws govern your use of the Programs, use results in a program file(s) that contains code from both the prohibit the reverse engineering (unless required by law for including technical data; additional information can be found on XXXXXXX Program and the Open Source program (includingXXXXXXX Employees: Under no circumstances are XXXXXXX interoperability), disassembly or decompilation of the Programs XXXXXXXs Global Trade Compliance web site located at http:// without limitation libraries) if the Open Source program isEmployees authorized to download software for the purpose of and prohibit duplication of the Programs except for a sufficient www.XXXXXXX.com/products/export/index.html.You agree that licensed under a license that requires any "modifications" be madedistributing it to customers. XXXXXXX products are available to number of copies of each Program for the end users licensed use neither the Programs nor any direct product thereof will be freely available.You also may not combine the XXXXXXXemployees for internal use or demonstration purposes only. In and one copy of each Program media; (4) disclaim, to the extent exported, directly, or indirectly, in violation of these laws, or will be Program with programs licensed under the GNU General Publickeeping with XXXXXXXs trade compliance obligations under permitted by applicable law, our liability for any damages, whether used for any purpose prohibited by these laws including, without License ("GPL") in any manner that could cause, or could beU.S. and applicable multilateral law, failure to comply with this direct, indirect, incidental, or consequential, arising from the use of limitation, nuclear, chemical, or biological weapons proliferation. interpreted or asserted to cause, the XXXXXXX Program or anypolicy could result in disciplinary action up to and including the Programs; (5) require the end user at the termination of the modifications thereto to become subject to the terms of the GPL.termination. Agreement, to discontinue use and destroy or return to you all Disclaimer of Warranty and Exclusive Remedies copies of the Programs and documentation; (6) prohibit Entire Agreement publication of any results of benchmark tests run on the THE PROGRAMS ARE PROVIDED "AS IS" WITHOUT You agree that this Agreement is the complete agreement for theNote:You are bound by the XXXXXXX Technology Network Programs; (7) require the end user to comply fully with all relevant WARRANTY OF ANY KIND. WE FURTHER DISCLAIM ALL Programs and licenses, and this Agreement supersedes all prior or("OTN") License Agreement terms. The OTN License Agreement export laws and regulations of the United States and other WARRANTIES, EXPRESS AND IMPLIED, INCLUDING contemporaneous Agreements or representations. If any term ofterms also apply to all updates you receive under your Technology applicable export and import laws to assure that neither the WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF this Agreement is found to be invalid or unenforceable, theTrack subscription. Programs, nor any direct product thereof, are exported, directly MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE remaining provisions will remain effective. or indirectly, in violation of applicable laws; (8) do not require us OR NONINFRINGEMENT. to perform any obligations or incur any liability not previously Last updated: 01/24/08The OTN License Agreement terms below supercede any agreed to between you and us; (9) permit you to audit your end IN NO EVENT SHALL WE BE LIABLE FOR ANY INDIRECT,shrinkwrap license on the OTN Technology Track software CDs users use of the Programs or to assign your right to audit the end INCIDENTAL, SPECIAL, PUNITIVE OR CONSEQUENTIALand previous OTN License terms (including the XXXXXXX users use of the Programs to us; (10) designate us as a third party DAMAGES, OR DAMAGES FOR LOSS OF PROFITS, REVENUE, Should you have any questions concerning this LicenseProgram License as modified by the OTN Program Use beneficiary of the end user license agreement; (11) include terms DATA OR DATA USE, INCURRED BY YOU OR ANY THIRD Agreement, or if you desire to contact XXXXXXX for anyCertificate). consistent with those contained in the sections of this Agreement PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT, reason, please write: entitled "Disclaimer of Warranties and Exclusive Remedies," "No EVEN IF WE HAVE BEEN ADVISED OF THE POSSIBILITY OF XXXXXXX America, Inc. Technical Support," "End of Agreement," "Relationship Between SUCH DAMAGES. OUR ENTIRE LIABILITY FOR DAMAGES 500 XXXXXXX Partykway,XXXXXXX Technology Network Development and Distribution the Parties," and "Open Source"; and (11) exclude the application HEREUNDER SHALL IN NO EVENT EXCEED ONE Redwood City, CA 94065License Agreement for Instant Client of the Uniform Computer Information Transactions Act. THOUSAND DOLLARS (U.S. $1,000). No Technical Support XXXXXXX may contact you to ask if you had a satisfactory Our technical support organization will not provide technical experience installing and using this OTN software download. support, phone support, or updates to you or end users for the Programs licensed under this agreement.
  11. 11. #3Total Cost of Ownership
  12. 12. Prospect of costs of a database solution over a period of 3 years for 1 server License Support 300.000270.000240.000210.000 64.000180.000 Cost in Euro150.000 140.000120.000 32.00090.000 70.00060.000 16.00030.000 35.000 0 7.500 1 CPU Socket 2 CPU Socket 4 CPU Socket PostgreSQL* * PostgreSQL with 24/7 production support from 2ndQuadrant
  13. 13. Total cost of ownership• Direct and indirect costs of a database solution: • total costs of acquisition • including license fees, migration costs, training costs, ... • operating costs • including ICT personnel, support, testing, business continuity, ... • in the long term, do not forget upgrades!
  14. 14. #4Development life cycle
  15. 15. Major releases from 1995 Postgres 95 1.0 6.0 6.1 6.2 6.3 6.4 6.5 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 9.0 9.1 9.221181512963 2006 2007 2008 2009 2010 2011 2012 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005
  16. 16. Development life cycle• 21 releases from 1995 • Last pattern: release happens in 3rd quarter• 5 releases in the last 5 years • Stakeholders: sponsors,• 4 milestones, called professionals, researchers “commit fests” • Mailing list: pgsql-• 1+ alpha release, 1+ beta hackers@postgresql.org release, release candidate • PostgreSQL releases are• Spread over ~1 year of maintained by the activities community for 5 years
  17. 17. #5Quality of code and documentation
  18. 18. Quality• Code: • Documentation: • written in C (multi-platform) • part of the code • solid foundations • PostgreSQL PDF manual: • collaborative development • > 2500 pages • 0 known bugs releases • regression tests, buildfarm and continuous integration
  19. 19. #6Business Continuity
  20. 20. Downtime ... € $ £ € $ £ € ...1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
  21. 21. Unintentional human errorpostgres@pg $> psqlpsql (9.2.2)Type "help" for help.postgres=# UPDATE t SET colour = ‘red’;UPDATE 4815162342postgres=# ^C^C^C^Z
  22. 22. Business continuity• Disaster recovery (data loss) • Recovery Point Objective• High Availability (down time) • RPO = 0 with SyncRep • RPO ~0 with StreamRep• Reliability and data integrity • tunable with log shipping• Integration with common • Recovery Time Objective monitoring tools • 99.99% uptime a year is common (1hr downtime)
  23. 23. Simple business continuity stack App repmgr Master Standby server A Barman server B DR server C
  24. 24. #7Security and data protection
  25. 25. Security and data protection• Full disclosure: • Integration with Enterprise www.postgresql.org/ security infrastructures (e.g. support/security/ LDAP or GSSAPI)• Secure TCP/IP Connections • Group and user permissions using SSL • Multi-layer security model • including support for certificates • from server to column level• Cryptographic functions • Security-Enhanced Linux (pgcrypto extension) (SELinux)
  26. 26. Login First Last Email DOB PWDUsers table name name Read/Write role (Insert/Update/Delete/Select)
  27. 27. First Login Last Email PWD DOBUsers table name name Authenticator role (Select on two columns)
  28. 28. #8PostgreSQL Eco-system
  29. 29. PostgreSQL Eco-System• PostgreSQL community• Organisations using PostgreSQL (stakeholders): • HP, Nasa, CME, Instagram, Skype, VMWare, NTT, Heroku, ...• PostgreSQL sponsors and professionals: • offering world-wide 24/7 support services (SLA)• You are not alone, even in business critical environments
  30. 30. External tools and libraries• Satellite projects: • Third party tools: • GIS: PostGIS, pgrouting • open source • Admin: pgAdmin • commercial • Continuity & Scalability: PL/ • include frameworks, Proxy, pgPool, pgBouncer, products, libraries, ... Skytools, repmgr, Barman, pgmemcache ... • at any stage of data management: operations, • ... ETL, analysis
  31. 31. #9Performance and scalability
  32. 32. Performance and scalability• Big Data, Fast Data • Hot Standby• Linear scalability (64 core) • Data/query distribution, aka Sharding (e.g. PL/Proxy)• I/O access • Memcache• Indexes • PgQ• Partitioning• Tablespaces
  33. 33. Hot StandbyPostgreSQL 9.2 M App backup S BI App S S S Data Centre 1 Data Centre 2
  34. 34. #10Works the way you do
  35. 35. Galileo Galilei 1564-1642
  36. 36. Works the way you do• Invest in your personnel’s • Several procedural knowledge languages• Standard compliant (e.g. • Versatile and extensible SQL, XML, UTF8, ...) • custom data types• Client interfaces: C/C++, JDBC, ODBC, .Net, Python, • intelligence in the database Perl, Ruby, PHP, ... • extensions (from 9.1)• Vast gamma of ORMs • Database Unit testing
  37. 37. PostgreSQL 9.2 Webapp HTML 5 Apps Javascript CSS 3 JSON Postgres
  38. 38. NoSQL with Postgres 9.2 HTML 5 Apps Javascript CSS 3 “NoSQL” PL/Proxy ... Postgres Postgres Postgres Postgres ...
  39. 39. Foreign data wrappers...CREATE FOREIGN TABLE oracle_table ( id integer NOT NULL, ...) SERVER oradb OPTIONS (schema ORAUSER, table ORATAB);...-- push down of the WHERE clauseSELECT * FROM oracle_table WHERE id=10;
  40. 40. Recap• Open Source Community • Business Continuity• License • Security and data protection• Total Cost of Ownership • PostgreSQL Eco-system• Development life cycle • Performance and scalability• Quality of code and • Works the way you do documentation
  41. 41. Conclusions• 100% open source, no license fees, no legal complications• High standard quality, security and reliability• Established yet versatile and dynamic project• Successfully operating in many business/mission critical environments around the globe• Knowledge transfer (e.g. Oracle, Greenplum)
  42. 42. Is PostgreSQL missing a feature? Think about developing it yourself or sponsor the development. It might be cost effective in the medium term!
  43. 43. PostgreSQL AustraliaThis is the first meeting of our community in Australia. You can all be part of this community!
  44. 44. QuestionsE-mail: gabriele.bartolini@2ndQuadrant.it Twitter: @_GBartolini_ Website: www.2ndQuadrant.com
  45. 45. Thank you! Copyright (c) 2013 2ndQuadrant Italia License: Creative Commons BY-NC-SA 3.0http://creativecommons.org/licenses/by-nc-sa/3.0/it/deed.en