SlideShare una empresa de Scribd logo
1 de 56
CakePHP PostgreSQL
         ×
First Mac
(Masashi Shinbara)
(Masashi Shinbara)

×
(Masashi Shinbara)

×
(Masashi Shinbara)

×


    /shin1x1
(Masashi Shinbara)

  ×


       /shin1x1

Shin x blog
http://www.1x1.jp/blog/
PostgreSQL

• Oracle / Access(mdb)
• 2000                 PostgreSQL7.0

• Oracle
• DB
Agenda

• CakePHP
•
• pgpool-II + Slony-1
CakePHP
Oracle
SQLServer
EASY




       Oracle
       SQLServer
EASY




              Oracle
              SQLServer
TEST
EASY




                Oracle
       CUSTOM   SQLServer
TEST
POPULAR   EASY




                   Oracle
          CUSTOM   SQLServer
TEST
2007
2007
   2008
2007
   2008
       2009
Cake




2008          2009
SNS
pgpool-II + Slony-1
pgpool-II

• CakePHP   PostgreSQL

•
• Web/AP
Slony-I

•
•
• slonik
CakePHP


• DB   pgpool-II

•
DB
<?php
class DATABASE_CONFIG {
  var $default = array(
     'connect' => 'pg_connect',
     'driver' => 'postgres',
     'persistent' => false,
     'host' => 'localhost',
     'port' => '9999',
     'login' => '1x1',
     'password' => '',
     'database' => 'hoge',
  );
pgpool-II
•
    •
    •
    •   SQL

•
    •
pgpool-II

 UPDATE users SET name='abc';

 BEGIN;
 SELECT COUNT(*) FROM users;
 INSERT INTO users(name) VALUES('abc');
 COMMIT;

 /**/ SELECT * FROM users;

 SELECT * FROM users;
pgpool-II

 UPDATE users SET name='abc';

 BEGIN;
 SELECT COUNT(*) FROM users;
 INSERT INTO users(name) VALUES('abc');
 COMMIT;

 /**/ SELECT * FROM users;

 SELECT * FROM users;
pgpool-II

 UPDATE users SET name='abc';

 BEGIN;
 SELECT COUNT(*) FROM users;
 INSERT INTO users(name) VALUES('abc');
 COMMIT;

 /**/ SELECT * FROM users;

 SELECT * FROM users;
pgpool-II

 UPDATE users SET name='abc';

 BEGIN;
 SELECT COUNT(*) FROM users;
 INSERT INTO users(name) VALUES('abc');
 COMMIT;

 /**/ SELECT * FROM users;

 SELECT * FROM users;
pgpool-II

 UPDATE users SET name='abc';

 BEGIN;
 SELECT COUNT(*) FROM users;
 INSERT INTO users(name) VALUES('abc');
 COMMIT;

 /**/ SELECT * FROM users;

 SELECT * FROM users;
pgpool-II

 UPDATE users SET name='abc';

 BEGIN;
 SELECT COUNT(*) FROM users;
 INSERT INTO users(name) VALUES('abc');
 COMMIT;

 /**/ SELECT * FROM users;

 SELECT * FROM users;
Slony-I
•


•              SQL
    /**/ SELECT * FROM users;
    CakePHP
CakePHP
[app/models/datasources/dbo/dbo_postgres_replication.php]

class DboPostgresReplication extends DboPostgres {
  public function execute($sql) {
    if (!AppModel::$toSlave) {
      if (preg_match('/^SELECT/i', $sql)) {
        $sql = '/**/'.$sql;
      }
    }
    return parent::execute($sql);
  }
}
• CakePHP               PHP

• CakePHP     PostgreSQL



• pgpool-II + Slony-I
Q?


     /shin1x1

Más contenido relacionado

La actualidad más candente

wwc start-launched
wwc start-launchedwwc start-launched
wwc start-launched
Mat Schaffer
 
Devsumi2012 攻めの運用の極意
Devsumi2012 攻めの運用の極意Devsumi2012 攻めの運用の極意
Devsumi2012 攻めの運用の極意
Ryosuke IWANAGA
 
"Mobage DBA Fight against Big Data" - NHN TE
"Mobage DBA Fight against Big Data" - NHN TE"Mobage DBA Fight against Big Data" - NHN TE
"Mobage DBA Fight against Big Data" - NHN TE
Ryosuke IWANAGA
 
openstack源码分析(1)
openstack源码分析(1)openstack源码分析(1)
openstack源码分析(1)
cannium
 

La actualidad más candente (20)

Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
 
Hacking ansible
Hacking ansibleHacking ansible
Hacking ansible
 
Vidoop CouchDB Talk
Vidoop CouchDB TalkVidoop CouchDB Talk
Vidoop CouchDB Talk
 
How to simplify OSGi development using OBR - Peter Kriens
How to simplify OSGi development using OBR - Peter KriensHow to simplify OSGi development using OBR - Peter Kriens
How to simplify OSGi development using OBR - Peter Kriens
 
More tips n tricks
More tips n tricksMore tips n tricks
More tips n tricks
 
Code Splitting in Practice - Shanghai JS Meetup May 2016
Code Splitting in Practice - Shanghai JS Meetup May 2016Code Splitting in Practice - Shanghai JS Meetup May 2016
Code Splitting in Practice - Shanghai JS Meetup May 2016
 
Ufo Ship for AWS ECS
Ufo Ship for AWS ECSUfo Ship for AWS ECS
Ufo Ship for AWS ECS
 
Using Embulk at Treasure Data
Using Embulk at Treasure DataUsing Embulk at Treasure Data
Using Embulk at Treasure Data
 
Recent Updates at Embulk Meetup #3
Recent Updates at Embulk Meetup #3Recent Updates at Embulk Meetup #3
Recent Updates at Embulk Meetup #3
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
wwc start-launched
wwc start-launchedwwc start-launched
wwc start-launched
 
Devsumi2012 攻めの運用の極意
Devsumi2012 攻めの運用の極意Devsumi2012 攻めの運用の極意
Devsumi2012 攻めの運用の極意
 
DATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backupDATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backup
 
Ansible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife OrchestrationAnsible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife Orchestration
 
"Mobage DBA Fight against Big Data" - NHN TE
"Mobage DBA Fight against Big Data" - NHN TE"Mobage DBA Fight against Big Data" - NHN TE
"Mobage DBA Fight against Big Data" - NHN TE
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
openstack源码分析(1)
openstack源码分析(1)openstack源码分析(1)
openstack源码分析(1)
 
Ansible for beginners ...?
Ansible for beginners ...?Ansible for beginners ...?
Ansible for beginners ...?
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
 

Destacado (7)

Análisis de viabilidad para ofrecer internet via wifi en el quindio
Análisis de viabilidad para ofrecer internet via wifi en el quindioAnálisis de viabilidad para ofrecer internet via wifi en el quindio
Análisis de viabilidad para ofrecer internet via wifi en el quindio
 
What I Learn
What I LearnWhat I Learn
What I Learn
 
Listas twitter paso_a_paso
Listas twitter paso_a_pasoListas twitter paso_a_paso
Listas twitter paso_a_paso
 
Moodle Slidecast1a Team 37
Moodle Slidecast1a Team 37Moodle Slidecast1a Team 37
Moodle Slidecast1a Team 37
 
Sydney M.
Sydney M.Sydney M.
Sydney M.
 
Michaela P.
Michaela P.Michaela P.
Michaela P.
 
A Beginning
A BeginningA Beginning
A Beginning
 

Similar a CakePHP + PostgreSQL

Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Tatsuhiko Miyagawa
 
Socket applications
Socket applicationsSocket applications
Socket applications
João Moura
 
glance replicator
glance replicatorglance replicator
glance replicator
irix_jp
 
Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHP
Jeremy Kendall
 

Similar a CakePHP + PostgreSQL (20)

Get to know PostgreSQL!
Get to know PostgreSQL!Get to know PostgreSQL!
Get to know PostgreSQL!
 
07 Using Oracle-Supported Package in Application Development
07 Using Oracle-Supported Package in Application Development07 Using Oracle-Supported Package in Application Development
07 Using Oracle-Supported Package in Application Development
 
CakePHP
CakePHPCakePHP
CakePHP
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Phinx talk
Phinx talkPhinx talk
Phinx talk
 
Practical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails AppPractical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails App
 
Oracle SQL Tuning
Oracle SQL TuningOracle SQL Tuning
Oracle SQL Tuning
 
Socket applications
Socket applicationsSocket applications
Socket applications
 
PostgreSQL 9.6 새 기능 소개
PostgreSQL 9.6 새 기능 소개PostgreSQL 9.6 새 기능 소개
PostgreSQL 9.6 새 기능 소개
 
Forget Grunt and Gulp! Webpack and NPM rule them all!
Forget Grunt and Gulp! Webpack and NPM rule them all!Forget Grunt and Gulp! Webpack and NPM rule them all!
Forget Grunt and Gulp! Webpack and NPM rule them all!
 
SQLMAP Tool Usage - A Heads Up
SQLMAP Tool Usage - A  Heads UpSQLMAP Tool Usage - A  Heads Up
SQLMAP Tool Usage - A Heads Up
 
SQL Track: Restoring databases with powershell
SQL Track: Restoring databases with powershellSQL Track: Restoring databases with powershell
SQL Track: Restoring databases with powershell
 
MySQL crash course by moshe kaplan
MySQL crash course by moshe kaplanMySQL crash course by moshe kaplan
MySQL crash course by moshe kaplan
 
glance replicator
glance replicatorglance replicator
glance replicator
 
Apollo ecosystem
Apollo ecosystemApollo ecosystem
Apollo ecosystem
 
Countdown to PostgreSQL v9.5 - Foriegn Tables can be part of Inheritance Tree
Countdown to PostgreSQL v9.5 - Foriegn Tables can be part of Inheritance Tree Countdown to PostgreSQL v9.5 - Foriegn Tables can be part of Inheritance Tree
Countdown to PostgreSQL v9.5 - Foriegn Tables can be part of Inheritance Tree
 
Postgres-BDR with Google Cloud Platform
Postgres-BDR with Google Cloud PlatformPostgres-BDR with Google Cloud Platform
Postgres-BDR with Google Cloud Platform
 
Testing with PostgreSQL
Testing with PostgreSQLTesting with PostgreSQL
Testing with PostgreSQL
 
DBA だってもっと効率化したい!〜最近の自動化事情とOracle Database〜
DBA だってもっと効率化したい!〜最近の自動化事情とOracle Database〜DBA だってもっと効率化したい!〜最近の自動化事情とOracle Database〜
DBA だってもっと効率化したい!〜最近の自動化事情とOracle Database〜
 
Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHP
 

Más de Masashi Shinbara

レイヤードアーキテクチャを意識した PHPアプリケーションの構築 ver2
レイヤードアーキテクチャを意識した PHPアプリケーションの構築 ver2レイヤードアーキテクチャを意識した PHPアプリケーションの構築 ver2
レイヤードアーキテクチャを意識した PHPアプリケーションの構築 ver2
Masashi Shinbara
 
Twilio を使えば簡単にできる アプリケーションと電話/SMS連携
Twilio を使えば簡単にできる アプリケーションと電話/SMS連携Twilio を使えば簡単にできる アプリケーションと電話/SMS連携
Twilio を使えば簡単にできる アプリケーションと電話/SMS連携
Masashi Shinbara
 
How to learn Laravel5 application from Authentication
How to learn Laravel5 application from AuthenticationHow to learn Laravel5 application from Authentication
How to learn Laravel5 application from Authentication
Masashi Shinbara
 
Azure Websites で作るスケーラブルな PHP アプリケーション
Azure Websites で作るスケーラブルな PHP アプリケーションAzure Websites で作るスケーラブルな PHP アプリケーション
Azure Websites で作るスケーラブルな PHP アプリケーション
Masashi Shinbara
 

Más de Masashi Shinbara (20)

日本語消えたスライド
日本語消えたスライド日本語消えたスライド
日本語消えたスライド
 
Twilio入門 -Web アプリ編-
Twilio入門 -Web アプリ編-Twilio入門 -Web アプリ編-
Twilio入門 -Web アプリ編-
 
いまどきのPHP開発現場 -2015年秋-
いまどきのPHP開発現場 -2015年秋-いまどきのPHP開発現場 -2015年秋-
いまどきのPHP開発現場 -2015年秋-
 
レイヤードアーキテクチャを意識した PHPアプリケーションの構築 ver2
レイヤードアーキテクチャを意識した PHPアプリケーションの構築 ver2レイヤードアーキテクチャを意識した PHPアプリケーションの構築 ver2
レイヤードアーキテクチャを意識した PHPアプリケーションの構築 ver2
 
先取り!PHP 7 と WordPress
先取り!PHP 7 と WordPress先取り!PHP 7 と WordPress
先取り!PHP 7 と WordPress
 
Twilio を使えば簡単にできる アプリケーションと電話/SMS連携
Twilio を使えば簡単にできる アプリケーションと電話/SMS連携Twilio を使えば簡単にできる アプリケーションと電話/SMS連携
Twilio を使えば簡単にできる アプリケーションと電話/SMS連携
 
レイヤードアーキテクチャを意識したPHPアプリケーションの構築
レイヤードアーキテクチャを意識したPHPアプリケーションの構築レイヤードアーキテクチャを意識したPHPアプリケーションの構築
レイヤードアーキテクチャを意識したPHPアプリケーションの構築
 
How to learn Laravel5 application from Authentication
How to learn Laravel5 application from AuthenticationHow to learn Laravel5 application from Authentication
How to learn Laravel5 application from Authentication
 
認証機能で学ぶ Laravel 5 アプリケーション
認証機能で学ぶ Laravel 5 アプリケーション認証機能で学ぶ Laravel 5 アプリケーション
認証機能で学ぶ Laravel 5 アプリケーション
 
Azure Websites で作るスケーラブルな PHP アプリケーション
Azure Websites で作るスケーラブルな PHP アプリケーションAzure Websites で作るスケーラブルな PHP アプリケーション
Azure Websites で作るスケーラブルな PHP アプリケーション
 
わかってるフレームワーク Laravel
わかってるフレームワーク Laravelわかってるフレームワーク Laravel
わかってるフレームワーク Laravel
 
ビルドサーバで使うDocker
ビルドサーバで使うDockerビルドサーバで使うDocker
ビルドサーバで使うDocker
 
Ansible ではじめるサーバ作業の自動化
Ansible ではじめるサーバ作業の自動化Ansible ではじめるサーバ作業の自動化
Ansible ではじめるサーバ作業の自動化
 
開発現場で活用するVagrant
開発現場で活用するVagrant開発現場で活用するVagrant
開発現場で活用するVagrant
 
PHPコードではなく PHPコードの「書き方」を知る
PHPコードではなく PHPコードの「書き方」を知るPHPコードではなく PHPコードの「書き方」を知る
PHPコードではなく PHPコードの「書き方」を知る
 
Heroku で作る
スケーラブルな 
PHP アプリケーション
Heroku で作る
スケーラブルな 
PHP アプリケーションHeroku で作る
スケーラブルな 
PHP アプリケーション
Heroku で作る
スケーラブルな 
PHP アプリケーション
 
Vagrant体験入門
Vagrant体験入門Vagrant体験入門
Vagrant体験入門
 
VagrantユーザのためのDocker入門
VagrantユーザのためのDocker入門VagrantユーザのためのDocker入門
VagrantユーザのためのDocker入門
 
Laravel ユーザなら知っておくべきAuthオートログイン
Laravel ユーザなら知っておくべきAuthオートログインLaravel ユーザなら知っておくべきAuthオートログイン
Laravel ユーザなら知っておくべきAuthオートログイン
 
キャラ立ちしたエンジニアになる!
キャラ立ちしたエンジニアになる!キャラ立ちしたエンジニアになる!
キャラ立ちしたエンジニアになる!
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

CakePHP + PostgreSQL