How to Troubleshoot Apps for the Modern Connected Worker
Why use PostgreSQL?
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. 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
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
7. 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!
9. PostgreSQL Database Management System
(formerly known as Postgres, then as Postgres95)
Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without a written agreement
is hereby granted, provided that the above copyright notice and this
paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
10. 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
11. You may allow your end users to permit third parties to use the
Programs on such end user's 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, the
XXXXXXX 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 considered
License 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 RIGHTS
Selecting 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 are
of 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, and
term, 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 'restricted
control 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 the
Korea, 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 the
prohibited 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, 500
Programs, 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 Agreement
lists 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 the
Terrorists, 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 the
you 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 this
of 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 end
You 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 Parties
Programs, 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 Agreement
to 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 party's right to independently
including, 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 the
manufacture or production of nuclear, chemical or biological operations only. backup purposes.
other party's products, so long as proprietary information of the
weapons 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 Source
EXPORT 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 for
You 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 terms
export 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 user's modifications to the
including 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 'combines'
XXXXXXX®'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 code
www.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 the
You 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 any
thereof 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 intellectual
laws, or will be used for any purpose prohibited by these laws for use in the third party's business operations (unless such access
property or proprietary rights in the XXXXXXX Programs. For
including, 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 an
weapons 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 (including
XXXXXXX Employees: Under no circumstances are XXXXXXX interoperability), disassembly or decompilation of the Programs XXXXXXX's Global Trade Compliance web site located at http://
without limitation libraries) if the Open Source program is
Employees 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 made
distributing it to customers. XXXXXXX products are available to number of copies of each Program for the end user's licensed use neither the Programs nor any direct product thereof will be
freely available.You also may not combine the XXXXXXX
employees 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 Public
keeping with XXXXXXX's 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 be
U.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 any
policy 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 the
Note: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 of
terms 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, the
Track 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/08
The 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 user's use of the Programs or to assign your right to audit the end INCIDENTAL, SPECIAL, PUNITIVE OR CONSEQUENTIAL
and previous OTN License terms (including the XXXXXXX user's 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 License
Program 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 any
Certificate). 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 94065
License 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.
13. Prospect of costs of a database solution
over a period of 3 years for 1 server
License Support
300.000
270.000
240.000
210.000 64.000
180.000
Cost in Euro
150.000
140.000
120.000
32.000
90.000
70.000
60.000
16.000
30.000 35.000
0 7.500
1 CPU Socket 2 CPU Socket 4 CPU Socket PostgreSQL*
* PostgreSQL with 24/7 production support from 2ndQuadrant
14. 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!
17. 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
20. 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
23. Unintentional human error
postgres@pg $> psql
psql (9.2.2)
Type "help" for help.
postgres=# UPDATE t SET colour = ‘red’;
UPDATE 4815162342
postgres=# ^C
^C
^C
^Z
24. 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)
28. 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)
29. Login First Last Email DOB PWD
Users table
name name
Read/Write role (Insert/Update/Delete/Select)
30. First Login
Last Email
PWD DOB
Users table
name name
Authenticator role (Select on two columns)
33. 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
34.
35. 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
42. 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
44. NoSQL with Postgres 9.2
HTML 5
Apps Javascript
CSS 3
“NoSQL”
PL/Proxy
... Postgres Postgres Postgres Postgres ...
45. Foreign data wrappers
...
CREATE FOREIGN TABLE oracle_table (
id integer NOT NULL,
...
) SERVER oradb OPTIONS
(schema 'ORAUSER', table 'ORATAB');
...
-- push down of the WHERE clause
SELECT * FROM oracle_table WHERE id=10;
46. 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
47. 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)
48. Is PostgreSQL missing a feature?
Think about developing it yourself or sponsor the
development.
It might be cost effective in the medium term!
49.
50. PostgreSQL Australia
This is the first meeting of our community in Australia.
You can all be part of this community!