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',
    ...
pgpool-II
•
    •
    •
    •   SQL

•
    •
pgpool-II

 UPDATE users SET name='abc';

 BEGIN;
 SELECT COUNT(*) FROM users;
 INSERT INTO users(name) VALUES('abc');
 CO...
pgpool-II

 UPDATE users SET name='abc';

 BEGIN;
 SELECT COUNT(*) FROM users;
 INSERT INTO users(name) VALUES('abc');
 CO...
pgpool-II

 UPDATE users SET name='abc';

 BEGIN;
 SELECT COUNT(*) FROM users;
 INSERT INTO users(name) VALUES('abc');
 CO...
pgpool-II

 UPDATE users SET name='abc';

 BEGIN;
 SELECT COUNT(*) FROM users;
 INSERT INTO users(name) VALUES('abc');
 CO...
pgpool-II

 UPDATE users SET name='abc';

 BEGIN;
 SELECT COUNT(*) FROM users;
 INSERT INTO users(name) VALUES('abc');
 CO...
pgpool-II

 UPDATE users SET name='abc';

 BEGIN;
 SELECT COUNT(*) FROM users;
 INSERT INTO users(name) VALUES('abc');
 CO...
Slony-I
•


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

class DboPostgresReplication extends DboPostgres {
  pu...
• CakePHP               PHP

• CakePHP     PostgreSQL



• pgpool-II + Slony-I
Q?


     /shin1x1
CakePHP + PostgreSQL
CakePHP + PostgreSQL
CakePHP + PostgreSQL
CakePHP + PostgreSQL
CakePHP + PostgreSQL
CakePHP + PostgreSQL
CakePHP + PostgreSQL
CakePHP + PostgreSQL
CakePHP + PostgreSQL
CakePHP + PostgreSQL
CakePHP + PostgreSQL
CakePHP + PostgreSQL
CakePHP + PostgreSQL
CakePHP + PostgreSQL
CakePHP + PostgreSQL
CakePHP + PostgreSQL
CakePHP + PostgreSQL
CakePHP + PostgreSQL
CakePHP + PostgreSQL
Upcoming SlideShare
Loading in...5
×

CakePHP + PostgreSQL

6,280
-1

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
6,280
On Slideshare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • CakePHP + PostgreSQL

    1. 1. CakePHP PostgreSQL ×
    2. 2. First Mac
    3. 3. (Masashi Shinbara)
    4. 4. (Masashi Shinbara) ×
    5. 5. (Masashi Shinbara) ×
    6. 6. (Masashi Shinbara) × /shin1x1
    7. 7. (Masashi Shinbara) × /shin1x1 Shin x blog http://www.1x1.jp/blog/
    8. 8. PostgreSQL • Oracle / Access(mdb) • 2000 PostgreSQL7.0 • Oracle • DB
    9. 9. Agenda • CakePHP • • pgpool-II + Slony-1
    10. 10. CakePHP
    11. 11. Oracle SQLServer
    12. 12. EASY Oracle SQLServer
    13. 13. EASY Oracle SQLServer TEST
    14. 14. EASY Oracle CUSTOM SQLServer TEST
    15. 15. POPULAR EASY Oracle CUSTOM SQLServer TEST
    16. 16. 2007
    17. 17. 2007 2008
    18. 18. 2007 2008 2009
    19. 19. Cake 2008 2009
    20. 20. SNS
    21. 21. pgpool-II + Slony-1
    22. 22. pgpool-II • CakePHP PostgreSQL • • Web/AP
    23. 23. Slony-I • • • slonik
    24. 24. CakePHP • DB pgpool-II •
    25. 25. DB <?php class DATABASE_CONFIG { var $default = array( 'connect' => 'pg_connect', 'driver' => 'postgres', 'persistent' => false, 'host' => 'localhost', 'port' => '9999', 'login' => '1x1', 'password' => '', 'database' => 'hoge', );
    26. 26. pgpool-II • • • • SQL • •
    27. 27. 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;
    28. 28. 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;
    29. 29. 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;
    30. 30. 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;
    31. 31. 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;
    32. 32. 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;
    33. 33. Slony-I
    34. 34. • • SQL /**/ SELECT * FROM users; CakePHP
    35. 35. 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); } }
    36. 36. • CakePHP PHP • CakePHP PostgreSQL • pgpool-II + Slony-I
    37. 37. Q? /shin1x1

    ×