Upload
others
View
13
Download
0
Embed Size (px)
Citation preview
POSTGRES IS DIFFERENT FROM(BETTER THAN)
YOUR RDBMS
Gurjeet Singh
gurjeet.singh.im
EDB - EnterpriseDB.com
FROM THE PERSPECTIVE OF ADeveloperManager
DEVELOPER'S PERSPECTIVELicenseReliabilitySecurityFeaturesExtensibilityPerformanceDiagnosability
DEVELOPER : LICENSEBSD-like License
Liberal than/Very different from GPL.PostgreSQL License gives you
Freedom to read, patch/improve the code.An opportunity to understand the database internalsInstall, use/develop and deploy full feature-set without alicenseUpgrade hardware without paying for license costUnlike commercial RDBMSs where licenses come in theway of development, QA, and hardware upgrades.
DEVELOPER : RELIABILITYACID compliantConstraints (Primary Key, Foreign Key, CHECK)Data-page checksums to detect corruption
DEVELOPER : SECURITYPer-object GRANT/REVOKE permissionsPer-column GRANT/REVOKE permissionsSSL connectionsLDAP and RADIUS authentication
DEVELOPER : FEATURESPostgres is a PlatformVast feature set... and ever-expanding
Postgres Feature Matrix
http://www.postgresql.org/about/featurematrix/
DEVELOPER : FEATURESCommon Table Expressions (CTEs)
Similar to Macro in programming languagesSupports recursive evaluation (alternative to Oracle'sCONNECT BY)
DEVELOPER : FEATURES : DATA TYPESMany advanced data types come builtin
Full List of Builtin Data Types
http://www.postgresql.org/docs/9.3/static/datatype.html
DEVELOPER : FEATURES : DATA TYPESDoes not have/need NVARCHAR data type
The CHAR/VARCHAR/TEXT types are capable of storingUnicode data
DEVELOPER : FEATURES : DATA TYPESBoolean (a first-class data type)Bit (and Bit strings)MoneyBytea (binary data)Interval (difference between TIMESTAMPs)Enumerated TypesGeometry Types (Point, Line Segment, Polygon, ...)Network Address (inet, cidr, macaddr)
DEVELOPER : FEATURES : DATA TYPESRange Types (tsrange, daterange, int4range, ...)Composite typesBuiltin multi-dimensional arrays
Automatically defines array type of builtin and user-defineddata types
DEVELOPER : FEATURES : DATA TYPEShstoreJSONXML
DEVELOPER : FEATURESStreaming ReplicationHot StandbyPer-transaction synchronous replicationTrue serializable transactionsLISTEN/NOTIFYTriggersExclusion constraintsWindow FunctionsFunction overloadingOperator overloadingFull-text searchLarge Objects up to 4TBMaterialized views
DEVELOPER : FEATURESCreate procedures in various programming languages
PL/pgsqlPL/perlPL/tclPL/javaPL/v8 - JavaScript
DEVELOPER : FEATURE/PERFORMANCETOAST
The Oversized Attribute Storage Technique
Automatic out-of-line storage and automatic compression
DEVELOPER : PERFORMANCECost-based optimizerIndex-only scansSynchronized seq-scansTable partitioningUnlogged tables
DEVELOPER : PERFORMANCEPartial indexesMany types of indexes
BTreeHashGinGistKNNSP-Gist
DEVELOPER : PERFORMANCETypes of join-strategies
Nested-loop joinsHash joinsSort-Merge joinsBitmap-index scan; Bitmap-And/Or joins (in-memory)
Can use multiple indexes of a table in the same scanSemi joinsAnti joins
DEVELOPER : PERFORMANCEFaster than NoSQL (at NoSQL use case)See slides 32 onwards of Chrisophe Pettus'PostgreSQL as a Schemaless Database
http://thebuild.com/presentations/pg-as-nosql-pgday-fosdem-2013.pdf
DEVELOPER : DIAGNOSTICSPer-function statisticsPerformance Views
pg_stat_activitypg_lockspg_stat_*
pg_stat_all_tablespg_stat_all_indexes...
DEVELOPER : DIAGNOSTICSLogging Options
log_min_duration_statementlog_temp_files
DTrace/SystemTap support
Scripts to record and diagnose performance issues
DEVELOPER : EXTENSIBILITYHighly ExtensibleCreate Your Own
Data TypesOperatorsIndex Types
create extensionCheck out Foreign Data WrapperForeign Tables
PGXN.org
DEVELOPER : EXTENSIBILITYExamples
PostGIS
PostGIS adds support for geographic objects to thePostgreSQL object-relational database.
PostgreSQL-HLL
A PostgreSQL extension adding HyperLogLog datastructures as a native data type
MANAGER'S PERSPECTIVEAcquisition Cost (License)Future ProofVendors/Providers (Companies who can help)Maintenance Cost (Support)Buy-in From Upper Management
MANAGER : ACQUISITION COSTFree
MANAGER : ACQUISITION COSTFREESave Money $$$Higher Profit MarginsA Leg Up On The Competition
MANAGER : ACQUISITION COSTBSD-like License
Liberal than/Very different from GPL.Install, use/develop and deploy full feature-set without alicenseUpgrade hardware without paying for license costUnlike commercial RDBMSs where licenses come in theway of development, QA, and hardware upgrades.
MANAGER : FUTURE PROOFCommunity-drivenNo single commercial entity controls it (unlike MySQL)Will be always free (cost and project management)
MANAGER : FUTURE PROOFEver-increasing resource-pool; developers and DBAsCompare growth in job requirements
MANAGER : VENDORS/PROVIDERSMany top-quality vendors
EDB (EnterpriseDB)PG Experts2nd QuadrantOmniTICommand Prompt
Many smaller consulting teams/individuals
MANAGER : MAINTENANCE COST24/7 Support availableVery affordable support contracts
For e.g. EDB charges per-socket (unlike Oracle, thatcharges per CPU)
MANAGER : MAINTENANCE COSTConsultingRemote-DBADatabase Health ChecksTraining
For DevelopersFor DBAs
MANAGER : UPPER MANAGEMENT BUY-INShow them the last few slides :)
THANK YOU