SlideShare uma empresa Scribd logo
1 de 70
Baixar para ler offline
Writing innite scalability web
applications with PHP and
PostgreSQL
PHPDay 2013 - Verona
Gabriele Bartolini
2ndQuadrant Italia
gabriele.bartolini@2ndQuadrant.it
@_GBartolini_
sabato 18 maggio 13
Gabriele Bartolini
•Co-Founder and Manager of 2ndQuadrant Italia
• Data Architect, Business critical environments (OLTP)
• Data warehousing
•Co-Founder Italian PostgreSQL Users Group
•Co-Founder PostgreSQL Europe
•PostgreSQL Contributor and Advocate
sabato 18 maggio 13
Gabriele Bartolini 1.0 (1995-2005)
•Web mining
•Web programmer
• C, C++ and PHP
• Web accessibility
• IWA
• W3C (EARL)
•Open source developer
• ht://Dig (C++)
• ht://Check (C++, MySQL,
PHP)
• ht://Miner (C++,
PostgreSQL)
sabato 18 maggio 13
PostgreSQL = Postgres
100% open source, available at www.postgresql.org
sabato 18 maggio 13
Who’s using Postgres?
... in a production environment
sabato 18 maggio 13
Who’s planning to use Postgres?
sabato 18 maggio 13
Who’s familiar with sharding?
sabato 18 maggio 13
Traditional PHP application
HTML 5
Javascript
CSS 3
PHP
Postgres
JSON
ResultSet
sabato 18 maggio 13
Postgres 9.2+ PHP Application
HTML 5
Javascript
CSS 3
PHP
Postgres
JSON
sabato 18 maggio 13
HTML 5
Javascript
CSS 3
PHP
Postgres
PL/Proxy
Postgres PostgresPostgres
“NoSQL”
......
NoSQL with Postgres
sabato 18 maggio 13
Sharding
•Horizontal partitioning
technique
•Logically and physically
split a table by distributing
data across different
databases/servers
• Reduced number of rows in
each shard
• Reduced index size
•Some DBMS have the
"DISTRIBUTED BY" clause
for "CREATE TABLE"
•Query distribution
• Parallel processing
• Shared nothing architecture
sabato 18 maggio 13
Table 1
Table 1
Shard 1
Table 1
Shard 2
Table 1
Shard 3
Table 1
Shard ...
Table 1
Shard n
Table 1
SELECT * FROM Table1;
Parallel execution on the ‘n’ shards
sabato 18 maggio 13
Part I
Postgre(s|SQL)
sabato 18 maggio 13
PostgreSQL
•Started in 1995 (Postgres started in 1986)
•Current major version is 9.2
• Supported major versions are 8.4, 9.0, 9.1 and 9.2
•The PostgreSQL License (BSD style)
• Not subject to monopoly nor acquisitions
•Platform independent (C language)
sabato 18 maggio 13
Some major features
•Client/Server
•Concurrency (MVCC)
•Referential integrity
•ACID transactions
•Views
•Functions
•Triggers
•Tablespaces
•Partitioning
•Schemas
•Point In Time Recovery
•Master/Slave Replication
sabato 18 maggio 13
Features for developers
•Standard compliant (e.g.
SQL, XML, UTF8, JSON, ...)
•Client interfaces: C/C++,
PHP, JDBC, ODBC, .Net,
Python, Perl, Ruby, ...
•Vast gamma of ORMs
•Several procedural
languages
•Versatile and extensible
• custom data types
• intelligence in the database
• extensions (from 9.1)
• PostGIS
•Database Unit testing
sabato 18 maggio 13
PostgreSQL 9.3
•Autumn 2013
•JSON operators and
functions
•Updatable views
•Materialised views
•Writable foreign tables
•Support for LATERAL
•...
•http://wiki.postgresql.org/
wiki/What
%27s_new_in_PostgreSQL_
9.3
sabato 18 maggio 13
NO ... DISTRIBUTED BY
•PostgreSQL does not support transparent distribution of
data and queries (yet)
•Sharding can be implemented through PL/Proxy using
functions
sabato 18 maggio 13
Part II
Architecture and scalability
sabato 18 maggio 13
Scalability
Property of a database to grow according to both
technical and business requirements
sabato 18 maggio 13
Server
dbdb
Single
SMP Server
Vertical scalability
sabato 18 maggio 13
Server
db
Commodity
Hardware
Server Server
db
Horizontal scalability
sabato 18 maggio 13
Disclaimer
For the sake of simplicity, every database server
described in the following architecture diagrams,
deliberately represents a single point of failure.
Due to its high availability/disaster recovery features and
open source tools, PostgreSQL is widely used in mission
critical environments.
sabato 18 maggio 13
Server
postgres
Physical/Virtual
server
Single server architecture
apache/php
Pros: cost
Cons: performance (CPU, RAM, I/O), scalability, business
continuity, security, no db connection pooling
sabato 18 maggio 13
Web server
Two-server architecture
apache/php
Pros: flexibility (hardware, OS), cost optimisation, security,
performance (CPU, RAM, I/O), db connection pooling
Cons: business continuity, scalability
DB Server
postgres
pgbouncer
Virtual, +CPU, +RAM, -I/O
Physical, =CPU, =RAM, +I/O
sabato 18 maggio 13
Benchmark
•2 x Intel Xeon E5630 CPUs
• 48 GB RAM
• Storage:
• 2 SAS 7.2k rpm, RAID 1
• 2 SAS 15k rpm, RAID 1
• 6 SAS 15k rpm, RAID 1+0
•850 MB/s seq read
•13k UPDATE/sec 32 clients
• 1.1k/sec for “large” dbs
•PostgreSQL 9.2/CentOS 6
•Rental costs:
• 1.8k € setup + 350 €/month
sabato 18 maggio 13
Web server
Multiple web servers architecture
apache/php
DB Server
postgres
pgbouncer
pgbouncer
Web server
apache/php
pgbouncer
HA Proxy
HTTP Balancing
Pros: scalability and
continuity (Web)
Cons: scalability
and continuity (DB)
sabato 18 maggio 13
Web server
Read only database servers
apache/php
DB Master
postgres
pgbouncer
pgbouncer
Web server
apache/php
pgbouncer
HA Proxy
HTTP Balancing
DB Hot Standby
postgres
pgbouncer
Streaming
Replication
RO
RORW RW
sabato 18 maggio 13
Web server
Database sharding architecture
DB Access Server
postgres
pgbouncer
Web server
HA Proxy
Web layer
pl/proxy
Database Access Layer
DB Shard ...
postgres
pgbouncer
DB Shard n
postgres
pgbouncer
DB Shard 1
postgres
pgbouncer
Database
Data Layer
“NoSQL”“NoSQL”
“Infinite” horizontal scalability
Shared
nothing
architecture
sabato 18 maggio 13
Architecture recap
•Do not get carried away by current trends and buzzwords
•Make your decisions about architecture based on:
• business continuity requirements
• results of both database and application benchmarks
•Always start with a simple architecture (two-server)
•Enhance gradually up to sharding for infinite scalability
sabato 18 maggio 13
Part III
(Open Source) Technologies
sabato 18 maggio 13
PgBouncer
•Lightweight connection
pooler for PostgreSQL
•Written in C by Skype
•Recycling connections on:
• sessions
• transactions
• statements (for PL/Proxy)
•“Virtual databases”
• Real databases can be on
different backend servers
•Online reconfiguration,
restart and upgrade
• Online statistics
• Supports PAUSE/RESUME
sabato 18 maggio 13
Conguration example
[databases]
db1_ro = host=pg2 dbname=db1 port=5432
* = host=pg1 port=6432
[pgbouncer]
listen_addr = *
listen_port = 6432
pool_mode = session
...
sabato 18 maggio 13
Statement
Transaction
Session/Transaction/Statement
Connection/Session
Transaction
INSERT
UPDATE
Transaction
INSERT
SELECT
UPDATE
BEGIN
COMMIT
sabato 18 maggio 13
hstore
•Data type in PostgreSQL
•Key/value pairs as a single
value
•Useful for storing:
• unstructured data
• many attributes for a
record
•Keys and values are stored
as text
•Set of operators
• ->, @>, ?, ...
•Indexes
•Integrates with JSON in 9.3
sabato 18 maggio 13
JSON Support
•Introduced in PostgreSQL 9.2
•Data type
•Generators (9.3)
•Operators (9.3)
•Integration with hstore (9.3)
sabato 18 maggio 13
CREATE TABLE pictures (
id SERIAL PRIMARY KEY,
user_id INTEGER NOT NULL
REFERENCES users(id),
title TEXT,
metadata JSON,
thumbnail BYTEA,
picture BYTEA,
created_at TIMESTAMP DEFAULT now(),
updated_at TIMESTAMP DEFAULT now()
);
sabato 18 maggio 13
INSERT INTO pictures
(user_id, title, metadata)
VALUES (
100,
'A picture of my Stratocaster',
'{"latitude":43.883,"longitude":
11.1,"width":2240,"height":1680}'
);
Storing a JSON value
sabato 18 maggio 13
WITH m AS (
SELECT 43.883 AS latitude,
11.1 AS longitude,
2240 AS width, 1680 AS height
)
INSERT INTO pictures
(user_id, title, metadata)
SELECT 100,
'Another picture of my Stratocaster',
to_json(m) FROM m;
Storing a JSON value #2
sabato 18 maggio 13
WITH p AS (
SELECT title, metadata, created_at
FROM pictures WHERE id = 1
)
SELECT to_json(p) AS json FROM p;
{"title":"A picture of my Stratocaster","metadata":
{"latitude":43.883,"longitude":11.1,"width":
2240,"height":1680},"created_at":"2013-05-11
13:11:37.788636"}
9.3 Returning a JSON object
sabato 18 maggio 13
WITH p AS (
SELECT id, title, metadata, created_at
FROM pictures WHERE user_id = 100
)
SELECT json_agg(p) AS json FROM p;
[{"id":1,"title":"A picture of my Stratocaster","metadata":
{"latitude":43.883,"longitude":11.1,"width":2240,"height":
1680},"created_at":"2013-05-11 13:15:21.078747"}, +
{"id":2,"title":"Another picture of my Stratocaster","metadata":
{"latitude":43.883,"longitude":11.1,"width":2240,"height":
1680},"created_at":"2013-05-11 13:15:21.078747"}]
9.3 Returning an array of JSONs
sabato 18 maggio 13
9.3 A taste of JSON operators
SELECT id, (metadata->'longitude',
metadata->'latitude') AS coords
FROM pictures
WHERE user_id = 100;
id | coords
----+---------------
1 | (11.1,43.883)
2 | (11.1,43.883)
...
sabato 18 maggio 13
PL/Javascript
•Procedural Language
•Allows to implement functions inside PostgreSQL using the
Javascript Language
•Available as an extension
•Powered by V8 JavaScript Engine
sabato 18 maggio 13
CREATE FUNCTION plv8_test(keys TEXT[],
vals TEXT[]) RETURNS TEXT
LANGUAGE plv8 IMMUTABLE STRICT AS
$BODY$
var o = {};
for(var i=0; i<keys.length; i++) {
o[keys[i]] = vals[i];
}
return JSON.stringify(o);
$BODY$;
SELECT plv8_test(ARRAY['name', 'age'],
ARRAY['Angus', '58']);
sabato 18 maggio 13
PL/Proxy
•Procedural language for
dening proxy functions
•Written in C by Skype
•The body specifies:
• remote function (target)
• destination (shard)
•Execution can happen on
one, some or all shards
• Execution is parallel if
shards > 1
•Queries are run in auto-
commit mode
• PgBouncer (statement)
sabato 18 maggio 13
The need for an API
•PL/Proxy forces to work
with functions
•One database cluster with:
• access/proxy layer
• data layer (shards)
•Database cluster ~
Singleton class
•Business logic in the
database
•Programmers need to
dene an API with access/
authorisation rules
• Proxy functions (PL/Proxy)
• Remote functions (any)
•Supports SQL/MED
sabato 18 maggio 13
Database sharding architecture
pg-access-1
postgres
pl/proxy
pg-data-2
postgres
pg-data-1
postgres
Database
Access
Layer
Database
Data
Layer
s00 s01 s02 s03
- Denition of the cluster
- Data/Queries distributed by user (hash)
- Functions using the ‘plproxy’ language
- User data tables
- Functions (any language)
sabato 18 maggio 13
Dene the cluster with SQL/MED
CREATE SERVER mycluster
FOREIGN DATA WRAPPER plproxy
OPTIONS (
connection_lifetime '1800',
s0 'dbname=shard00 host=pg-data-1',
s1 'dbname=shard01 host=pg-data-1',
s2 'dbname=shard02 host=pg-data-2',
s3 'dbname=shard03 host=pg-data-2'
);
sabato 18 maggio 13
Proxy function for GET
CREATE OR REPLACE FUNCTION
get_pictures(i_uid INTEGER)
RETURNS json
LANGUAGE plproxy
AS
$BODY$
CLUSTER 'mycluster';
RUN ON hashint4(i_uid);
$BODY$;
sabato 18 maggio 13
Data layer function for GET
CREATE OR REPLACE FUNCTION
get_pictures(i_uid INTEGER)
RETURNS json
LANGUAGE SQL AS
$BODY$
WITH p AS (
SELECT id, title, metadata, created_at
FROM pictures WHERE user_id = $1
) SELECT json_agg(p) AS json FROM p;
$BODY$;
sabato 18 maggio 13
Proxy function for INSERT
CREATE OR REPLACE FUNCTION
insert_picture(i_uid INTEGER, i_title
TEXT, i_metadata JSON, i_thumbnail BYTEA,
i_picture BYTEA)
RETURNS INTEGER LANGUAGE plproxy
AS $BODY$
CLUSTER 'mycluster';
RUN ON hashint4(i_uid);
$BODY$;
sabato 18 maggio 13
Data function for INSERT
CREATE OR REPLACE FUNCTION
insert_picture(i_uid INTEGER, i_title
TEXT, i_metadata JSON, i_thumbnail BYTEA,
i_picture BYTEA)
RETURNS INTEGER LANGUAGE SQL
AS $BODY$
INSERT INTO pictures (user_id, title,
metadata, thumbnail, picture) VALUES ($1,
$2, $3, $4, $5) RETURNING id;
$BODY$;
sabato 18 maggio 13
Data representation in PHP
// Obviously all of this will come from a form
$user_id = 100;
$title = 'A picture of my Stratocaster';
$metadata = array (
'latitude' => 43.883,
'longitude' => 11.1,
'width' => 2240,
'height' => 1680, // ... EXIF?
);
$thumbnail = ... // Binary stream
$picture = ... // Binary stream
sabato 18 maggio 13
INSERT using PDO
// $access_layer_conninfo = 'pgsql:...'
$connection = new PDO($access_layer_conninfo);
$stmt = $connection->prepare('SELECT
insert_picture(?, ?, ?, ?, ?)'); // NOSQL!
$stmt->bindParam(1, $user_id, PDO::PARAM_INT);
$stmt->bindParam(2, $title, PDO::PARAM_STR);
$stmt->bindParam(3, json_encode($metadata),
PDO::PARAM_STR);
$stmt->bindParam(4, $thumbnail, PDO::PARAM_LOB);
$stmt->bindParam(5, $picture, PDO::PARAM_LOB);
$stmt->execute(); // TODO: Check and get the ID
sabato 18 maggio 13
Memcached
•Distributed system for caching of objects in memory
• key/value pairs
• volatile data
•pgmemcache extension
•Integration of database and applications (read scaling)
sabato 18 maggio 13
PostgreSQL
Memcached
m[k] = v
PHP
trigger
+
pgmemcache
sabato 18 maggio 13
Part IV
Testing and deployment
sabato 18 maggio 13
Test-Driven DB development
•Database development
technique
•Write tests before actual
features
•pgTAP is an extension for
TDDD in PostgreSQL
•Allows to check for objects,
privileges, functions,
triggers, data, queries, etc.
•Transactional
•Provides with statistics
• via SQL or pg_prove
•Supports “Test Anything
Protocol” (TAP)
• Continuous integration
sabato 18 maggio 13
BEGIN;
SELECT plan(3);
-- insert test 1 here
-- insert test 2 here
-- insert test 3 here
SELECT * FROM finish();
ROLLBACK;
pgTAP group test example
sabato 18 maggio 13
SELECT results_eq(
'SELECT * FROM active_users()',
'SELECT * FROM users WHERE active',
'active_users() should return active
users'
);
pgTAP example with ‘results_eq’
sabato 18 maggio 13
Deployment with EXTENSION
•Extensibility
•Deployment is a crucial part
of any ICT organisation
•PostgreSQL 9.1 introduces
EXTENSION for packaging
in-database applications
•Fully transactional (atomic)
•Allows for upgrades and
downgrades
•Simplifies logical dump/
restore of objects
•DevOps with EXTENSION:
• Devs write extensions
• Ops deploy them
sabato 18 maggio 13
Extensions in detail
•Extensions require developer to write:
• Control file (metadata, settings, dependencies, ...)
• Installation scripts (SQL statements)
• Update scripts (SQL statements, optional)
• Source code / binaries (optional)
sabato 18 maggio 13
Extension management
-- INSTALLATION
CREATE EXTENSION pictures_app;
-- REMOVAL
DROP EXTENSION pictures_app;
-- UPDATE (fully atomic)
ALTER EXTENSION pictures_app UPDATE;
sabato 18 maggio 13
Part V
Conclusions
sabato 18 maggio 13
Conclusions
•Postgres is much more than a “traditional” database
•PHP integrates perfectly with it, in multiple flavours (native
interface, PDO, Doctrine, etc.)
•Start exploiting “vertical scalability”
•Always perform benchmark!
•Evaluate costs and complexity of “horizontal scalability”
•Postgres is “business friendly” in terms of licensing
sabato 18 maggio 13
Feel free to approach me about
•Open Source Community
•License
•Total Cost of Ownership
•Development life cycle
•Quality of code and
documentation
•Business Continuity
•Security and data protection
•PostgreSQL Eco-system
•Performance and scalability
•Software development
sabato 18 maggio 13
Community
•Next events:
• PGDay.IT (Autumn 2013)
• PGConf.EU (Dublin, Oct 29
- Nov 1, 2013)
•Italian PostgreSQL Users
Group (ITPUG)
• www.itpug.org
•PostgreSQL Europe
• www.postgresql.eu
sabato 18 maggio 13
References
•PostgreSQL: www.postgresql.org
•PgBouncer: http://wiki.postgresql.org/wiki/PgBouncer
•PL/Proxy: http://wiki.postgresql.org/wiki/PL/Proxy
•PL/V8: http://pgxn.org/dist/plv8/
•pgTAP: www.pgtap.org
sabato 18 maggio 13
Questions?
E-mail: gabriele.bartolini@2ndQuadrant.it
Twitter: @_GBartolini_
sabato 18 maggio 13
Thank you!
Copyright (c) 2013 2ndQuadrant Italia
License: Creative Commons BY-NC-SA 3.0
http://creativecommons.org/licenses/by-nc-sa/3.0/it/deed.en
sabato 18 maggio 13

Mais conteĂşdo relacionado

Mais procurados

Big Data, Data Lake, Fast Data - Dataserialiation-Formats
Big Data, Data Lake, Fast Data - Dataserialiation-FormatsBig Data, Data Lake, Fast Data - Dataserialiation-Formats
Big Data, Data Lake, Fast Data - Dataserialiation-FormatsGuido Schmutz
 
Thiết kế hệ thống E-Commerce yêu cầu mở rộng
Thiết kế hệ thống E-Commerce yêu cầu mở rộngThiết kế hệ thống E-Commerce yêu cầu mở rộng
Thiết kế hệ thống E-Commerce yêu cầu mở rộngNguyen Minh Quang
 
微服務資料管理的天堂路 - CQRS / Event Sourcing 的應用與實踐
微服務資料管理的天堂路 - CQRS / Event Sourcing 的應用與實踐微服務資料管理的天堂路 - CQRS / Event Sourcing 的應用與實踐
微服務資料管理的天堂路 - CQRS / Event Sourcing 的應用與實踐Andrew Wu
 
DBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and FlinkDBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and FlinkTimothy Spann
 
OSA Con 2022 - Signal Correlation, the Ho11y Grail - Michael Hausenblas - AWS...
OSA Con 2022 - Signal Correlation, the Ho11y Grail - Michael Hausenblas - AWS...OSA Con 2022 - Signal Correlation, the Ho11y Grail - Michael Hausenblas - AWS...
OSA Con 2022 - Signal Correlation, the Ho11y Grail - Michael Hausenblas - AWS...Altinity Ltd
 
Practical DevSecOps: Fundamentals of Successful Programs
Practical DevSecOps: Fundamentals of Successful ProgramsPractical DevSecOps: Fundamentals of Successful Programs
Practical DevSecOps: Fundamentals of Successful ProgramsMatt Tesauro
 
Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2Claus Ibsen
 
Juraci PaixĂŁo KrĂśhling - All you need to know about OpenTelemetry
Juraci PaixĂŁo KrĂśhling - All you need to know about OpenTelemetryJuraci PaixĂŁo KrĂśhling - All you need to know about OpenTelemetry
Juraci PaixĂŁo KrĂśhling - All you need to know about OpenTelemetryJuliano Costa
 
Developing with the Go client for Apache Kafka
Developing with the Go client for Apache KafkaDeveloping with the Go client for Apache Kafka
Developing with the Go client for Apache KafkaJoe Stein
 
Go micro framework to build microservices
Go micro framework to build microservicesGo micro framework to build microservices
Go micro framework to build microservicesTechMaster Vietnam
 
Infinispan, a distributed in-memory key/value data grid and cache
 Infinispan, a distributed in-memory key/value data grid and cache Infinispan, a distributed in-memory key/value data grid and cache
Infinispan, a distributed in-memory key/value data grid and cacheSebastian Andrasoni
 
4. 대용량 아키텍쳐 설계 패턴
4. 대용량 아키텍쳐 설계 패턴4. 대용량 아키텍쳐 설계 패턴
4. 대용량 아키텍쳐 설계 패턴Terry Cho
 
대용량 분산 아키텍쳐 설계 #1 아키텍쳐 설계 방법론
대용량 분산 아키텍쳐 설계 #1 아키텍쳐 설계 방법론대용량 분산 아키텍쳐 설계 #1 아키텍쳐 설계 방법론
대용량 분산 아키텍쳐 설계 #1 아키텍쳐 설계 방법론Terry Cho
 
Scouter와 influx db – grafana 연동 가이드
Scouter와 influx db – grafana 연동 가이드Scouter와 influx db – grafana 연동 가이드
Scouter와 influx db – grafana 연동 가이드Ji-Woong Choi
 
SRV401 Deep Dive on Amazon Elastic File System (Amazon EFS)
SRV401 Deep Dive on Amazon Elastic File System (Amazon EFS)SRV401 Deep Dive on Amazon Elastic File System (Amazon EFS)
SRV401 Deep Dive on Amazon Elastic File System (Amazon EFS)Amazon Web Services
 
Graylog Engineering - Design Your Architecture
Graylog Engineering - Design Your ArchitectureGraylog Engineering - Design Your Architecture
Graylog Engineering - Design Your ArchitectureGraylog
 
WUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel Zikmund
WUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel ZikmundWUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel Zikmund
WUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel ZikmundKarel Zikmund
 
Scylla on Kubernetes: Introducing the Scylla Operator
Scylla on Kubernetes: Introducing the Scylla OperatorScylla on Kubernetes: Introducing the Scylla Operator
Scylla on Kubernetes: Introducing the Scylla OperatorScyllaDB
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group ReplicationKenny Gryp
 

Mais procurados (20)

Big Data, Data Lake, Fast Data - Dataserialiation-Formats
Big Data, Data Lake, Fast Data - Dataserialiation-FormatsBig Data, Data Lake, Fast Data - Dataserialiation-Formats
Big Data, Data Lake, Fast Data - Dataserialiation-Formats
 
Thiết kế hệ thống E-Commerce yêu cầu mở rộng
Thiết kế hệ thống E-Commerce yêu cầu mở rộngThiết kế hệ thống E-Commerce yêu cầu mở rộng
Thiết kế hệ thống E-Commerce yêu cầu mở rộng
 
微服務資料管理的天堂路 - CQRS / Event Sourcing 的應用與實踐
微服務資料管理的天堂路 - CQRS / Event Sourcing 的應用與實踐微服務資料管理的天堂路 - CQRS / Event Sourcing 的應用與實踐
微服務資料管理的天堂路 - CQRS / Event Sourcing 的應用與實踐
 
DBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and FlinkDBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and Flink
 
OSA Con 2022 - Signal Correlation, the Ho11y Grail - Michael Hausenblas - AWS...
OSA Con 2022 - Signal Correlation, the Ho11y Grail - Michael Hausenblas - AWS...OSA Con 2022 - Signal Correlation, the Ho11y Grail - Michael Hausenblas - AWS...
OSA Con 2022 - Signal Correlation, the Ho11y Grail - Michael Hausenblas - AWS...
 
Practical DevSecOps: Fundamentals of Successful Programs
Practical DevSecOps: Fundamentals of Successful ProgramsPractical DevSecOps: Fundamentals of Successful Programs
Practical DevSecOps: Fundamentals of Successful Programs
 
Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2
 
Juraci PaixĂŁo KrĂśhling - All you need to know about OpenTelemetry
Juraci PaixĂŁo KrĂśhling - All you need to know about OpenTelemetryJuraci PaixĂŁo KrĂśhling - All you need to know about OpenTelemetry
Juraci PaixĂŁo KrĂśhling - All you need to know about OpenTelemetry
 
Developing with the Go client for Apache Kafka
Developing with the Go client for Apache KafkaDeveloping with the Go client for Apache Kafka
Developing with the Go client for Apache Kafka
 
Go micro framework to build microservices
Go micro framework to build microservicesGo micro framework to build microservices
Go micro framework to build microservices
 
Infinispan, a distributed in-memory key/value data grid and cache
 Infinispan, a distributed in-memory key/value data grid and cache Infinispan, a distributed in-memory key/value data grid and cache
Infinispan, a distributed in-memory key/value data grid and cache
 
4. 대용량 아키텍쳐 설계 패턴
4. 대용량 아키텍쳐 설계 패턴4. 대용량 아키텍쳐 설계 패턴
4. 대용량 아키텍쳐 설계 패턴
 
Envoy and Kafka
Envoy and KafkaEnvoy and Kafka
Envoy and Kafka
 
대용량 분산 아키텍쳐 설계 #1 아키텍쳐 설계 방법론
대용량 분산 아키텍쳐 설계 #1 아키텍쳐 설계 방법론대용량 분산 아키텍쳐 설계 #1 아키텍쳐 설계 방법론
대용량 분산 아키텍쳐 설계 #1 아키텍쳐 설계 방법론
 
Scouter와 influx db – grafana 연동 가이드
Scouter와 influx db – grafana 연동 가이드Scouter와 influx db – grafana 연동 가이드
Scouter와 influx db – grafana 연동 가이드
 
SRV401 Deep Dive on Amazon Elastic File System (Amazon EFS)
SRV401 Deep Dive on Amazon Elastic File System (Amazon EFS)SRV401 Deep Dive on Amazon Elastic File System (Amazon EFS)
SRV401 Deep Dive on Amazon Elastic File System (Amazon EFS)
 
Graylog Engineering - Design Your Architecture
Graylog Engineering - Design Your ArchitectureGraylog Engineering - Design Your Architecture
Graylog Engineering - Design Your Architecture
 
WUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel Zikmund
WUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel ZikmundWUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel Zikmund
WUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel Zikmund
 
Scylla on Kubernetes: Introducing the Scylla Operator
Scylla on Kubernetes: Introducing the Scylla OperatorScylla on Kubernetes: Introducing the Scylla Operator
Scylla on Kubernetes: Introducing the Scylla Operator
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 

Destaque

Diving deep into twig
Diving deep into twigDiving deep into twig
Diving deep into twigMatthias Noback
 
Get Soaked - An In Depth Look At PHP Streams
Get Soaked - An In Depth Look At PHP StreamsGet Soaked - An In Depth Look At PHP Streams
Get Soaked - An In Depth Look At PHP StreamsDavey Shafik
 
Techniques d'accĂŠlĂŠration des pages web
Techniques d'accĂŠlĂŠration des pages webTechniques d'accĂŠlĂŠration des pages web
Techniques d'accĂŠlĂŠration des pages webJean-Pierre Vincent
 
Elastic Searching With PHP
Elastic Searching With PHPElastic Searching With PHP
Elastic Searching With PHPLea Hänsenberger
 
PHP5.5 is Here
PHP5.5 is HerePHP5.5 is Here
PHP5.5 is Herejulien pauli
 
Automation using-phing
Automation using-phingAutomation using-phing
Automation using-phingRajat Pandit
 
Electrify your code with PHP Generators
Electrify your code with PHP GeneratorsElectrify your code with PHP Generators
Electrify your code with PHP GeneratorsMark Baker
 
The quest for global design principles (SymfonyLive Berlin 2015)
The quest for global design principles (SymfonyLive Berlin 2015)The quest for global design principles (SymfonyLive Berlin 2015)
The quest for global design principles (SymfonyLive Berlin 2015)Matthias Noback
 
Top tips my_sql_performance
Top tips my_sql_performanceTop tips my_sql_performance
Top tips my_sql_performanceafup Paris
 
Mocking Demystified
Mocking DemystifiedMocking Demystified
Mocking DemystifiedMarcello Duarte
 
Why elasticsearch rocks!
Why elasticsearch rocks!Why elasticsearch rocks!
Why elasticsearch rocks!tlrx
 
Understanding Craftsmanship SwanseaCon2015
Understanding Craftsmanship SwanseaCon2015Understanding Craftsmanship SwanseaCon2015
Understanding Craftsmanship SwanseaCon2015Marcello Duarte
 
Si le tdd est mort alors pratiquons une autopsie mix-it 2015
Si le tdd est mort alors pratiquons une autopsie mix-it 2015Si le tdd est mort alors pratiquons une autopsie mix-it 2015
Si le tdd est mort alors pratiquons une autopsie mix-it 2015Bruno Boucard
 
L'ABC du BDD (Behavior Driven Development)
L'ABC du BDD (Behavior Driven Development)L'ABC du BDD (Behavior Driven Development)
L'ABC du BDD (Behavior Driven Development)Arnauld Loyer
 
TDD with PhpSpec - Lone Star PHP 2016
TDD with PhpSpec - Lone Star PHP 2016TDD with PhpSpec - Lone Star PHP 2016
TDD with PhpSpec - Lone Star PHP 2016CiaranMcNulty
 
Performance serveur et apache
Performance serveur et apachePerformance serveur et apache
Performance serveur et apacheafup Paris
 
The Wonderful World of Symfony Components
The Wonderful World of Symfony ComponentsThe Wonderful World of Symfony Components
The Wonderful World of Symfony ComponentsRyan Weaver
 
PHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersPHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersKacper Gunia
 

Destaque (20)

Diving deep into twig
Diving deep into twigDiving deep into twig
Diving deep into twig
 
Get Soaked - An In Depth Look At PHP Streams
Get Soaked - An In Depth Look At PHP StreamsGet Soaked - An In Depth Look At PHP Streams
Get Soaked - An In Depth Look At PHP Streams
 
Techniques d'accĂŠlĂŠration des pages web
Techniques d'accĂŠlĂŠration des pages webTechniques d'accĂŠlĂŠration des pages web
Techniques d'accĂŠlĂŠration des pages web
 
Elastic Searching With PHP
Elastic Searching With PHPElastic Searching With PHP
Elastic Searching With PHP
 
PHP5.5 is Here
PHP5.5 is HerePHP5.5 is Here
PHP5.5 is Here
 
Automation using-phing
Automation using-phingAutomation using-phing
Automation using-phing
 
Electrify your code with PHP Generators
Electrify your code with PHP GeneratorsElectrify your code with PHP Generators
Electrify your code with PHP Generators
 
The quest for global design principles (SymfonyLive Berlin 2015)
The quest for global design principles (SymfonyLive Berlin 2015)The quest for global design principles (SymfonyLive Berlin 2015)
The quest for global design principles (SymfonyLive Berlin 2015)
 
Top tips my_sql_performance
Top tips my_sql_performanceTop tips my_sql_performance
Top tips my_sql_performance
 
Mocking Demystified
Mocking DemystifiedMocking Demystified
Mocking Demystified
 
Why elasticsearch rocks!
Why elasticsearch rocks!Why elasticsearch rocks!
Why elasticsearch rocks!
 
Understanding Craftsmanship SwanseaCon2015
Understanding Craftsmanship SwanseaCon2015Understanding Craftsmanship SwanseaCon2015
Understanding Craftsmanship SwanseaCon2015
 
Si le tdd est mort alors pratiquons une autopsie mix-it 2015
Si le tdd est mort alors pratiquons une autopsie mix-it 2015Si le tdd est mort alors pratiquons une autopsie mix-it 2015
Si le tdd est mort alors pratiquons une autopsie mix-it 2015
 
L'ABC du BDD (Behavior Driven Development)
L'ABC du BDD (Behavior Driven Development)L'ABC du BDD (Behavior Driven Development)
L'ABC du BDD (Behavior Driven Development)
 
Caching on the Edge
Caching on the EdgeCaching on the Edge
Caching on the Edge
 
TDD with PhpSpec - Lone Star PHP 2016
TDD with PhpSpec - Lone Star PHP 2016TDD with PhpSpec - Lone Star PHP 2016
TDD with PhpSpec - Lone Star PHP 2016
 
Performance serveur et apache
Performance serveur et apachePerformance serveur et apache
Performance serveur et apache
 
Behat 3.0 meetup (March)
Behat 3.0 meetup (March)Behat 3.0 meetup (March)
Behat 3.0 meetup (March)
 
The Wonderful World of Symfony Components
The Wonderful World of Symfony ComponentsThe Wonderful World of Symfony Components
The Wonderful World of Symfony Components
 
PHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersPHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4Developers
 

Semelhante a Writing infinite scalability web applications with PHP and PostgreSQL

When it all GOes right
When it all GOes rightWhen it all GOes right
When it all GOes rightPavlo Golub
 
Softshake 2013: Introduction to NoSQL with Couchbase
Softshake 2013: Introduction to NoSQL with CouchbaseSoftshake 2013: Introduction to NoSQL with Couchbase
Softshake 2013: Introduction to NoSQL with CouchbaseTugdual Grall
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Postgre sql best_practices
Postgre sql best_practicesPostgre sql best_practices
Postgre sql best_practicesJacques Kostic
 
ER/Studio and DB PowerStudio Launch Webinar: Big Data, Big Models, Big News!
ER/Studio and DB PowerStudio Launch Webinar: Big Data, Big Models, Big News! ER/Studio and DB PowerStudio Launch Webinar: Big Data, Big Models, Big News!
ER/Studio and DB PowerStudio Launch Webinar: Big Data, Big Models, Big News! Embarcadero Technologies
 
CodeCamp Iasi - Creating serverless data analytics system on GCP using BigQuery
CodeCamp Iasi - Creating serverless data analytics system on GCP using BigQueryCodeCamp Iasi - Creating serverless data analytics system on GCP using BigQuery
CodeCamp Iasi - Creating serverless data analytics system on GCP using BigQueryMĂĄrton Kodok
 
Useful PostgreSQL Extensions
Useful PostgreSQL ExtensionsUseful PostgreSQL Extensions
Useful PostgreSQL ExtensionsEDB
 
Elephant Roads: PostgreSQL Patches and Variants
Elephant Roads: PostgreSQL Patches and VariantsElephant Roads: PostgreSQL Patches and Variants
Elephant Roads: PostgreSQL Patches and VariantsPostgreSQL Experts, Inc.
 
Elephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forksElephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forksCommand Prompt., Inc
 
Postgre sql best_practices
Postgre sql best_practicesPostgre sql best_practices
Postgre sql best_practicesEmiliano Fusaglia
 
Operating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with KubernetesOperating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with KubernetesJonathan Katz
 
Supercharge your data analytics with BigQuery
Supercharge your data analytics with BigQuerySupercharge your data analytics with BigQuery
Supercharge your data analytics with BigQueryMĂĄrton Kodok
 
NoSQL Now 2013 Presentation
NoSQL Now 2013 PresentationNoSQL Now 2013 Presentation
NoSQL Now 2013 PresentationArjen Schoneveld
 
IoT databases - review and challenges - IoT, Hardware & Robotics meetup - onl...
IoT databases - review and challenges - IoT, Hardware & Robotics meetup - onl...IoT databases - review and challenges - IoT, Hardware & Robotics meetup - onl...
IoT databases - review and challenges - IoT, Hardware & Robotics meetup - onl...Marcin Bielak
 
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)Gabriele Bartolini
 
Neo4j Database and Graph Platform Overview
Neo4j Database and Graph Platform OverviewNeo4j Database and Graph Platform Overview
Neo4j Database and Graph Platform OverviewNeo4j
 
State of GeoServer
State of GeoServerState of GeoServer
State of GeoServerJody Garnett
 
Ducksboard - A real-time data oriented webservice architecture
Ducksboard - A real-time data oriented webservice architectureDucksboard - A real-time data oriented webservice architecture
Ducksboard - A real-time data oriented webservice architectureDucksboard
 
Presto: Query Anything - Data Engineer’s perspective
Presto: Query Anything - Data Engineer’s perspectivePresto: Query Anything - Data Engineer’s perspective
Presto: Query Anything - Data Engineer’s perspectiveAlluxio, Inc.
 

Semelhante a Writing infinite scalability web applications with PHP and PostgreSQL (20)

When it all GOes right
When it all GOes rightWhen it all GOes right
When it all GOes right
 
Couchbase
CouchbaseCouchbase
Couchbase
 
Softshake 2013: Introduction to NoSQL with Couchbase
Softshake 2013: Introduction to NoSQL with CouchbaseSoftshake 2013: Introduction to NoSQL with Couchbase
Softshake 2013: Introduction to NoSQL with Couchbase
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Postgre sql best_practices
Postgre sql best_practicesPostgre sql best_practices
Postgre sql best_practices
 
ER/Studio and DB PowerStudio Launch Webinar: Big Data, Big Models, Big News!
ER/Studio and DB PowerStudio Launch Webinar: Big Data, Big Models, Big News! ER/Studio and DB PowerStudio Launch Webinar: Big Data, Big Models, Big News!
ER/Studio and DB PowerStudio Launch Webinar: Big Data, Big Models, Big News!
 
CodeCamp Iasi - Creating serverless data analytics system on GCP using BigQuery
CodeCamp Iasi - Creating serverless data analytics system on GCP using BigQueryCodeCamp Iasi - Creating serverless data analytics system on GCP using BigQuery
CodeCamp Iasi - Creating serverless data analytics system on GCP using BigQuery
 
Useful PostgreSQL Extensions
Useful PostgreSQL ExtensionsUseful PostgreSQL Extensions
Useful PostgreSQL Extensions
 
Elephant Roads: PostgreSQL Patches and Variants
Elephant Roads: PostgreSQL Patches and VariantsElephant Roads: PostgreSQL Patches and Variants
Elephant Roads: PostgreSQL Patches and Variants
 
Elephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forksElephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forks
 
Postgre sql best_practices
Postgre sql best_practicesPostgre sql best_practices
Postgre sql best_practices
 
Operating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with KubernetesOperating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with Kubernetes
 
Supercharge your data analytics with BigQuery
Supercharge your data analytics with BigQuerySupercharge your data analytics with BigQuery
Supercharge your data analytics with BigQuery
 
NoSQL Now 2013 Presentation
NoSQL Now 2013 PresentationNoSQL Now 2013 Presentation
NoSQL Now 2013 Presentation
 
IoT databases - review and challenges - IoT, Hardware & Robotics meetup - onl...
IoT databases - review and challenges - IoT, Hardware & Robotics meetup - onl...IoT databases - review and challenges - IoT, Hardware & Robotics meetup - onl...
IoT databases - review and challenges - IoT, Hardware & Robotics meetup - onl...
 
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)
 
Neo4j Database and Graph Platform Overview
Neo4j Database and Graph Platform OverviewNeo4j Database and Graph Platform Overview
Neo4j Database and Graph Platform Overview
 
State of GeoServer
State of GeoServerState of GeoServer
State of GeoServer
 
Ducksboard - A real-time data oriented webservice architecture
Ducksboard - A real-time data oriented webservice architectureDucksboard - A real-time data oriented webservice architecture
Ducksboard - A real-time data oriented webservice architecture
 
Presto: Query Anything - Data Engineer’s perspective
Presto: Query Anything - Data Engineer’s perspectivePresto: Query Anything - Data Engineer’s perspective
Presto: Query Anything - Data Engineer’s perspective
 

Mais de Gabriele Bartolini

Webinar: PostgreSQL continuous backup and PITR with Barman
Webinar: PostgreSQL continuous backup and PITR with BarmanWebinar: PostgreSQL continuous backup and PITR with Barman
Webinar: PostgreSQL continuous backup and PITR with BarmanGabriele Bartolini
 
From 0 to ~100: Business Continuity with PostgreSQL
From 0 to ~100: Business Continuity with PostgreSQLFrom 0 to ~100: Business Continuity with PostgreSQL
From 0 to ~100: Business Continuity with PostgreSQLGabriele Bartolini
 
PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)
PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)
PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)Gabriele Bartolini
 
PostgreSQL 9.3: novitĂ  in "vista" (in italiano)
PostgreSQL 9.3: novitĂ  in "vista" (in italiano)PostgreSQL 9.3: novitĂ  in "vista" (in italiano)
PostgreSQL 9.3: novitĂ  in "vista" (in italiano)Gabriele Bartolini
 
JSON con PostgreSQL 9.3 (in italiano)
JSON con PostgreSQL 9.3 (in italiano)JSON con PostgreSQL 9.3 (in italiano)
JSON con PostgreSQL 9.3 (in italiano)Gabriele Bartolini
 
PostgreSQL Disaster Recovery with Barman
PostgreSQL Disaster Recovery with BarmanPostgreSQL Disaster Recovery with Barman
PostgreSQL Disaster Recovery with BarmanGabriele Bartolini
 

Mais de Gabriele Bartolini (7)

Webinar: PostgreSQL continuous backup and PITR with Barman
Webinar: PostgreSQL continuous backup and PITR with BarmanWebinar: PostgreSQL continuous backup and PITR with Barman
Webinar: PostgreSQL continuous backup and PITR with Barman
 
From 0 to ~100: Business Continuity with PostgreSQL
From 0 to ~100: Business Continuity with PostgreSQLFrom 0 to ~100: Business Continuity with PostgreSQL
From 0 to ~100: Business Continuity with PostgreSQL
 
PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)
PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)
PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)
 
PostgreSQL 9.3: novitĂ  in "vista" (in italiano)
PostgreSQL 9.3: novitĂ  in "vista" (in italiano)PostgreSQL 9.3: novitĂ  in "vista" (in italiano)
PostgreSQL 9.3: novitĂ  in "vista" (in italiano)
 
JSON con PostgreSQL 9.3 (in italiano)
JSON con PostgreSQL 9.3 (in italiano)JSON con PostgreSQL 9.3 (in italiano)
JSON con PostgreSQL 9.3 (in italiano)
 
PostgreSQL Disaster Recovery with Barman
PostgreSQL Disaster Recovery with BarmanPostgreSQL Disaster Recovery with Barman
PostgreSQL Disaster Recovery with Barman
 
Why use PostgreSQL?
Why use PostgreSQL?Why use PostgreSQL?
Why use PostgreSQL?
 

Último

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraĂşjo
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 

Último (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

Writing infinite scalability web applications with PHP and PostgreSQL

  • 1. Writing innite scalability web applications with PHP and PostgreSQL PHPDay 2013 - Verona Gabriele Bartolini 2ndQuadrant Italia gabriele.bartolini@2ndQuadrant.it @_GBartolini_ sabato 18 maggio 13
  • 2. Gabriele Bartolini •Co-Founder and Manager of 2ndQuadrant Italia • Data Architect, Business critical environments (OLTP) • Data warehousing •Co-Founder Italian PostgreSQL Users Group •Co-Founder PostgreSQL Europe •PostgreSQL Contributor and Advocate sabato 18 maggio 13
  • 3. Gabriele Bartolini 1.0 (1995-2005) •Web mining •Web programmer • C, C++ and PHP • Web accessibility • IWA • W3C (EARL) •Open source developer • ht://Dig (C++) • ht://Check (C++, MySQL, PHP) • ht://Miner (C++, PostgreSQL) sabato 18 maggio 13
  • 4. PostgreSQL = Postgres 100% open source, available at www.postgresql.org sabato 18 maggio 13
  • 5. Who’s using Postgres? ... in a production environment sabato 18 maggio 13
  • 6. Who’s planning to use Postgres? sabato 18 maggio 13
  • 7. Who’s familiar with sharding? sabato 18 maggio 13
  • 8. Traditional PHP application HTML 5 Javascript CSS 3 PHP Postgres JSON ResultSet sabato 18 maggio 13
  • 9. Postgres 9.2+ PHP Application HTML 5 Javascript CSS 3 PHP Postgres JSON sabato 18 maggio 13
  • 10. HTML 5 Javascript CSS 3 PHP Postgres PL/Proxy Postgres PostgresPostgres “NoSQL” ...... NoSQL with Postgres sabato 18 maggio 13
  • 11. Sharding •Horizontal partitioning technique •Logically and physically split a table by distributing data across different databases/servers • Reduced number of rows in each shard • Reduced index size •Some DBMS have the "DISTRIBUTED BY" clause for "CREATE TABLE" •Query distribution • Parallel processing • Shared nothing architecture sabato 18 maggio 13
  • 12. Table 1 Table 1 Shard 1 Table 1 Shard 2 Table 1 Shard 3 Table 1 Shard ... Table 1 Shard n Table 1 SELECT * FROM Table1; Parallel execution on the ‘n’ shards sabato 18 maggio 13
  • 14. PostgreSQL •Started in 1995 (Postgres started in 1986) •Current major version is 9.2 • Supported major versions are 8.4, 9.0, 9.1 and 9.2 •The PostgreSQL License (BSD style) • Not subject to monopoly nor acquisitions •Platform independent (C language) sabato 18 maggio 13
  • 15. Some major features •Client/Server •Concurrency (MVCC) •Referential integrity •ACID transactions •Views •Functions •Triggers •Tablespaces •Partitioning •Schemas •Point In Time Recovery •Master/Slave Replication sabato 18 maggio 13
  • 16. Features for developers •Standard compliant (e.g. SQL, XML, UTF8, JSON, ...) •Client interfaces: C/C++, PHP, JDBC, ODBC, .Net, Python, Perl, Ruby, ... •Vast gamma of ORMs •Several procedural languages •Versatile and extensible • custom data types • intelligence in the database • extensions (from 9.1) • PostGIS •Database Unit testing sabato 18 maggio 13
  • 17. PostgreSQL 9.3 •Autumn 2013 •JSON operators and functions •Updatable views •Materialised views •Writable foreign tables •Support for LATERAL •... •http://wiki.postgresql.org/ wiki/What %27s_new_in_PostgreSQL_ 9.3 sabato 18 maggio 13
  • 18. NO ... DISTRIBUTED BY •PostgreSQL does not support transparent distribution of data and queries (yet) •Sharding can be implemented through PL/Proxy using functions sabato 18 maggio 13
  • 19. Part II Architecture and scalability sabato 18 maggio 13
  • 20. Scalability Property of a database to grow according to both technical and business requirements sabato 18 maggio 13
  • 23. Disclaimer For the sake of simplicity, every database server described in the following architecture diagrams, deliberately represents a single point of failure. Due to its high availability/disaster recovery features and open source tools, PostgreSQL is widely used in mission critical environments. sabato 18 maggio 13
  • 24. Server postgres Physical/Virtual server Single server architecture apache/php Pros: cost Cons: performance (CPU, RAM, I/O), scalability, business continuity, security, no db connection pooling sabato 18 maggio 13
  • 25. Web server Two-server architecture apache/php Pros: flexibility (hardware, OS), cost optimisation, security, performance (CPU, RAM, I/O), db connection pooling Cons: business continuity, scalability DB Server postgres pgbouncer Virtual, +CPU, +RAM, -I/O Physical, =CPU, =RAM, +I/O sabato 18 maggio 13
  • 26. Benchmark •2 x Intel Xeon E5630 CPUs • 48 GB RAM • Storage: • 2 SAS 7.2k rpm, RAID 1 • 2 SAS 15k rpm, RAID 1 • 6 SAS 15k rpm, RAID 1+0 •850 MB/s seq read •13k UPDATE/sec 32 clients • 1.1k/sec for “large” dbs •PostgreSQL 9.2/CentOS 6 •Rental costs: • 1.8k € setup + 350 €/month sabato 18 maggio 13
  • 27. Web server Multiple web servers architecture apache/php DB Server postgres pgbouncer pgbouncer Web server apache/php pgbouncer HA Proxy HTTP Balancing Pros: scalability and continuity (Web) Cons: scalability and continuity (DB) sabato 18 maggio 13
  • 28. Web server Read only database servers apache/php DB Master postgres pgbouncer pgbouncer Web server apache/php pgbouncer HA Proxy HTTP Balancing DB Hot Standby postgres pgbouncer Streaming Replication RO RORW RW sabato 18 maggio 13
  • 29. Web server Database sharding architecture DB Access Server postgres pgbouncer Web server HA Proxy Web layer pl/proxy Database Access Layer DB Shard ... postgres pgbouncer DB Shard n postgres pgbouncer DB Shard 1 postgres pgbouncer Database Data Layer “NoSQL”“NoSQL” “Innite” horizontal scalability Shared nothing architecture sabato 18 maggio 13
  • 30. Architecture recap •Do not get carried away by current trends and buzzwords •Make your decisions about architecture based on: • business continuity requirements • results of both database and application benchmarks •Always start with a simple architecture (two-server) •Enhance gradually up to sharding for innite scalability sabato 18 maggio 13
  • 31. Part III (Open Source) Technologies sabato 18 maggio 13
  • 32. PgBouncer •Lightweight connection pooler for PostgreSQL •Written in C by Skype •Recycling connections on: • sessions • transactions • statements (for PL/Proxy) •“Virtual databases” • Real databases can be on different backend servers •Online reconguration, restart and upgrade • Online statistics • Supports PAUSE/RESUME sabato 18 maggio 13
  • 33. Conguration example [databases] db1_ro = host=pg2 dbname=db1 port=5432 * = host=pg1 port=6432 [pgbouncer] listen_addr = * listen_port = 6432 pool_mode = session ... sabato 18 maggio 13
  • 35. hstore •Data type in PostgreSQL •Key/value pairs as a single value •Useful for storing: • unstructured data • many attributes for a record •Keys and values are stored as text •Set of operators • ->, @>, ?, ... •Indexes •Integrates with JSON in 9.3 sabato 18 maggio 13
  • 36. JSON Support •Introduced in PostgreSQL 9.2 •Data type •Generators (9.3) •Operators (9.3) •Integration with hstore (9.3) sabato 18 maggio 13
  • 37. CREATE TABLE pictures ( id SERIAL PRIMARY KEY, user_id INTEGER NOT NULL REFERENCES users(id), title TEXT, metadata JSON, thumbnail BYTEA, picture BYTEA, created_at TIMESTAMP DEFAULT now(), updated_at TIMESTAMP DEFAULT now() ); sabato 18 maggio 13
  • 38. INSERT INTO pictures (user_id, title, metadata) VALUES ( 100, 'A picture of my Stratocaster', '{"latitude":43.883,"longitude": 11.1,"width":2240,"height":1680}' ); Storing a JSON value sabato 18 maggio 13
  • 39. WITH m AS ( SELECT 43.883 AS latitude, 11.1 AS longitude, 2240 AS width, 1680 AS height ) INSERT INTO pictures (user_id, title, metadata) SELECT 100, 'Another picture of my Stratocaster', to_json(m) FROM m; Storing a JSON value #2 sabato 18 maggio 13
  • 40. WITH p AS ( SELECT title, metadata, created_at FROM pictures WHERE id = 1 ) SELECT to_json(p) AS json FROM p; {"title":"A picture of my Stratocaster","metadata": {"latitude":43.883,"longitude":11.1,"width": 2240,"height":1680},"created_at":"2013-05-11 13:11:37.788636"} 9.3 Returning a JSON object sabato 18 maggio 13
  • 41. WITH p AS ( SELECT id, title, metadata, created_at FROM pictures WHERE user_id = 100 ) SELECT json_agg(p) AS json FROM p; [{"id":1,"title":"A picture of my Stratocaster","metadata": {"latitude":43.883,"longitude":11.1,"width":2240,"height": 1680},"created_at":"2013-05-11 13:15:21.078747"}, + {"id":2,"title":"Another picture of my Stratocaster","metadata": {"latitude":43.883,"longitude":11.1,"width":2240,"height": 1680},"created_at":"2013-05-11 13:15:21.078747"}] 9.3 Returning an array of JSONs sabato 18 maggio 13
  • 42. 9.3 A taste of JSON operators SELECT id, (metadata->'longitude', metadata->'latitude') AS coords FROM pictures WHERE user_id = 100; id | coords ----+--------------- 1 | (11.1,43.883) 2 | (11.1,43.883) ... sabato 18 maggio 13
  • 43. PL/Javascript •Procedural Language •Allows to implement functions inside PostgreSQL using the Javascript Language •Available as an extension •Powered by V8 JavaScript Engine sabato 18 maggio 13
  • 44. CREATE FUNCTION plv8_test(keys TEXT[], vals TEXT[]) RETURNS TEXT LANGUAGE plv8 IMMUTABLE STRICT AS $BODY$ var o = {}; for(var i=0; i<keys.length; i++) { o[keys[i]] = vals[i]; } return JSON.stringify(o); $BODY$; SELECT plv8_test(ARRAY['name', 'age'], ARRAY['Angus', '58']); sabato 18 maggio 13
  • 45. PL/Proxy •Procedural language for dening proxy functions •Written in C by Skype •The body species: • remote function (target) • destination (shard) •Execution can happen on one, some or all shards • Execution is parallel if shards > 1 •Queries are run in auto- commit mode • PgBouncer (statement) sabato 18 maggio 13
  • 46. The need for an API •PL/Proxy forces to work with functions •One database cluster with: • access/proxy layer • data layer (shards) •Database cluster ~ Singleton class •Business logic in the database •Programmers need to dene an API with access/ authorisation rules • Proxy functions (PL/Proxy) • Remote functions (any) •Supports SQL/MED sabato 18 maggio 13
  • 47. Database sharding architecture pg-access-1 postgres pl/proxy pg-data-2 postgres pg-data-1 postgres Database Access Layer Database Data Layer s00 s01 s02 s03 - Denition of the cluster - Data/Queries distributed by user (hash) - Functions using the ‘plproxy’ language - User data tables - Functions (any language) sabato 18 maggio 13
  • 48. Dene the cluster with SQL/MED CREATE SERVER mycluster FOREIGN DATA WRAPPER plproxy OPTIONS ( connection_lifetime '1800', s0 'dbname=shard00 host=pg-data-1', s1 'dbname=shard01 host=pg-data-1', s2 'dbname=shard02 host=pg-data-2', s3 'dbname=shard03 host=pg-data-2' ); sabato 18 maggio 13
  • 49. Proxy function for GET CREATE OR REPLACE FUNCTION get_pictures(i_uid INTEGER) RETURNS json LANGUAGE plproxy AS $BODY$ CLUSTER 'mycluster'; RUN ON hashint4(i_uid); $BODY$; sabato 18 maggio 13
  • 50. Data layer function for GET CREATE OR REPLACE FUNCTION get_pictures(i_uid INTEGER) RETURNS json LANGUAGE SQL AS $BODY$ WITH p AS ( SELECT id, title, metadata, created_at FROM pictures WHERE user_id = $1 ) SELECT json_agg(p) AS json FROM p; $BODY$; sabato 18 maggio 13
  • 51. Proxy function for INSERT CREATE OR REPLACE FUNCTION insert_picture(i_uid INTEGER, i_title TEXT, i_metadata JSON, i_thumbnail BYTEA, i_picture BYTEA) RETURNS INTEGER LANGUAGE plproxy AS $BODY$ CLUSTER 'mycluster'; RUN ON hashint4(i_uid); $BODY$; sabato 18 maggio 13
  • 52. Data function for INSERT CREATE OR REPLACE FUNCTION insert_picture(i_uid INTEGER, i_title TEXT, i_metadata JSON, i_thumbnail BYTEA, i_picture BYTEA) RETURNS INTEGER LANGUAGE SQL AS $BODY$ INSERT INTO pictures (user_id, title, metadata, thumbnail, picture) VALUES ($1, $2, $3, $4, $5) RETURNING id; $BODY$; sabato 18 maggio 13
  • 53. Data representation in PHP // Obviously all of this will come from a form $user_id = 100; $title = 'A picture of my Stratocaster'; $metadata = array ( 'latitude' => 43.883, 'longitude' => 11.1, 'width' => 2240, 'height' => 1680, // ... EXIF? ); $thumbnail = ... // Binary stream $picture = ... // Binary stream sabato 18 maggio 13
  • 54. INSERT using PDO // $access_layer_conninfo = 'pgsql:...' $connection = new PDO($access_layer_conninfo); $stmt = $connection->prepare('SELECT insert_picture(?, ?, ?, ?, ?)'); // NOSQL! $stmt->bindParam(1, $user_id, PDO::PARAM_INT); $stmt->bindParam(2, $title, PDO::PARAM_STR); $stmt->bindParam(3, json_encode($metadata), PDO::PARAM_STR); $stmt->bindParam(4, $thumbnail, PDO::PARAM_LOB); $stmt->bindParam(5, $picture, PDO::PARAM_LOB); $stmt->execute(); // TODO: Check and get the ID sabato 18 maggio 13
  • 55. Memcached •Distributed system for caching of objects in memory • key/value pairs • volatile data •pgmemcache extension •Integration of database and applications (read scaling) sabato 18 maggio 13
  • 57. Part IV Testing and deployment sabato 18 maggio 13
  • 58. Test-Driven DB development •Database development technique •Write tests before actual features •pgTAP is an extension for TDDD in PostgreSQL •Allows to check for objects, privileges, functions, triggers, data, queries, etc. •Transactional •Provides with statistics • via SQL or pg_prove •Supports “Test Anything Protocol” (TAP) • Continuous integration sabato 18 maggio 13
  • 59. BEGIN; SELECT plan(3); -- insert test 1 here -- insert test 2 here -- insert test 3 here SELECT * FROM finish(); ROLLBACK; pgTAP group test example sabato 18 maggio 13
  • 60. SELECT results_eq( 'SELECT * FROM active_users()', 'SELECT * FROM users WHERE active', 'active_users() should return active users' ); pgTAP example with ‘results_eq’ sabato 18 maggio 13
  • 61. Deployment with EXTENSION •Extensibility •Deployment is a crucial part of any ICT organisation •PostgreSQL 9.1 introduces EXTENSION for packaging in-database applications •Fully transactional (atomic) •Allows for upgrades and downgrades •Simplies logical dump/ restore of objects •DevOps with EXTENSION: • Devs write extensions • Ops deploy them sabato 18 maggio 13
  • 62. Extensions in detail •Extensions require developer to write: • Control le (metadata, settings, dependencies, ...) • Installation scripts (SQL statements) • Update scripts (SQL statements, optional) • Source code / binaries (optional) sabato 18 maggio 13
  • 63. Extension management -- INSTALLATION CREATE EXTENSION pictures_app; -- REMOVAL DROP EXTENSION pictures_app; -- UPDATE (fully atomic) ALTER EXTENSION pictures_app UPDATE; sabato 18 maggio 13
  • 65. Conclusions •Postgres is much more than a “traditional” database •PHP integrates perfectly with it, in multiple flavours (native interface, PDO, Doctrine, etc.) •Start exploiting “vertical scalability” •Always perform benchmark! •Evaluate costs and complexity of “horizontal scalability” •Postgres is “business friendly” in terms of licensing sabato 18 maggio 13
  • 66. Feel free to approach me about •Open Source Community •License •Total Cost of Ownership •Development life cycle •Quality of code and documentation •Business Continuity •Security and data protection •PostgreSQL Eco-system •Performance and scalability •Software development sabato 18 maggio 13
  • 67. Community •Next events: • PGDay.IT (Autumn 2013) • PGConf.EU (Dublin, Oct 29 - Nov 1, 2013) •Italian PostgreSQL Users Group (ITPUG) • www.itpug.org •PostgreSQL Europe • www.postgresql.eu sabato 18 maggio 13
  • 68. References •PostgreSQL: www.postgresql.org •PgBouncer: http://wiki.postgresql.org/wiki/PgBouncer •PL/Proxy: http://wiki.postgresql.org/wiki/PL/Proxy •PL/V8: http://pgxn.org/dist/plv8/ •pgTAP: www.pgtap.org sabato 18 maggio 13
  • 70. Thank you! Copyright (c) 2013 2ndQuadrant Italia License: Creative Commons BY-NC-SA 3.0 http://creativecommons.org/licenses/by-nc-sa/3.0/it/deed.en sabato 18 maggio 13