Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sameer Borate:
Efficiently Replicating RETS data to MySQL
May 03, 2013 @ 15:26:33

Sameer Borate has a new post to his site that shares how he converted a RETS database to MySQL with the help of a PHP library, PHPRETS.

A recent project of mine entailed replicating a RETS database on a local MySQL database server. The client had a new real-estate mobile search app in development and wanted to have a local copy of the RETS database for search queries instead of a remote RETS server. [...] Replicating RETS data rather than using the live version is slightly complex, however. In order to replicate the RETS data into your own local database, a series of processes are needed in order to make sure the data you have is both updated and in sync with the server.

He breaks it down into three main steps with some sample code for each:

  • Grabbing the complete database once
  • Keeping the data in sync
  • Ensuring the cron job is executed on regular intervals
tagged: rets database replication mysql phprets library tutorial

Link: http://www.codediesel.com/data/efficiently-replicating-rets-data-to-mysql

Ulf Wendel's Blog:
PECL/mysqlnd_ms compared to a classic
Sep 28, 2011 @ 13:43:57

Ulf Wendel has a new post that compares the performance of a classic method for using the mysqlnd plugin in MySQL replication to mysqlnd_ms, the replication and load balancing plugin for the mysqlnd driver (that works with the mysql and mysqli functionality and is, as of this beta of PHP, the default driver for MySQL connections).

Recently I was asked if PECL/mysqlnd_ms should be used to add MySQL replication support to a yet to be developed PHP application. The mysqlnd plugin, which supports all PHP MySQL extensions (PDO, mysqli, mysql), stood up against a classical, simple, proven and fast approach: one connection for reads, one connection for writes. Let’s compare. This is a bit of an unfair challenge, because PECL/mysqlnd_ms was designed as a drop-in for existing applications, not optimized for those starting from scratch, *yell*... The plugin stands up quite well, anyway!

He starts with a look at the "classical pattern" of using a factory or singleton to make a database object instance that gives back different connections for reads versus writes (slave vs master). The mysqlnd_ms plugin allows you to define configuration settings to tell the queries to automatically go to certain places for different actions. For example, you could use "master_on_write" to tell it to use a master node if you're doing an INSERT or UPDATE versus a SELECT. He also shows a more complex example using a SQL hint and one issue that might come from the "human element" - not paying attention to database character sets.

tagged: pecl mysqlnd mysqlndms mysql replication configuration automatic

Link:

Federico Cargnelutti's Blog:
Database Replication Adapter for Zend Framework Applications
Oct 05, 2009 @ 14:33:00

Federico Cargnelutti has added a new post to his blog today looking at a database replication adapter he's created for the Zend Framework - the ReplicationAdapter.

In 2008, Paul M. Jones announced the release of an SQL adapter that allows Solar users to connect to master/slave database installations. My first reaction was: Great! This will inspire other FOSS developers to create similar components. And guess what, it did. I wrote my own ReplicationAdapter. It’s not great, but it’s flexible enough to support the most commonly used replication scenarios:

He gives examples of how it can be used for single-master replication, multi-master replication and how the adapter can be used to create a distributed caching system for database connections. A brief Zend Framework-based example is also included.

tagged: database replication adapter zendframework

Link:

Brian Moon's Blog:
Putting files into a database
Oct 24, 2007 @ 16:24:00

In a recent blog post, Brian Moon talks about doing something he never thought he'd do - storing files in a database. He does, however, have two legitimate places he's found it useful.

Now, most people will say you should never do this. And lots of time they are right. And once upon a time I agreed with them without question. Then I started living in the real world where sometimes you have to do things you never thought you would. Here are the two places where I stores files in a database.

His places are in Phorum, using the method to keep the system's database and file attachments contained and easier to move around, and in the replication of their databases, making it simple to have images for the deals on dealnews transferable to the various slave databases.

tagged: database store file phorum dealnews replication database store file phorum dealnews replication

Link:

Brian Moon's Blog:
Putting files into a database
Oct 24, 2007 @ 16:24:00

In a recent blog post, Brian Moon talks about doing something he never thought he'd do - storing files in a database. He does, however, have two legitimate places he's found it useful.

Now, most people will say you should never do this. And lots of time they are right. And once upon a time I agreed with them without question. Then I started living in the real world where sometimes you have to do things you never thought you would. Here are the two places where I stores files in a database.

His places are in Phorum, using the method to keep the system's database and file attachments contained and easier to move around, and in the replication of their databases, making it simple to have images for the deals on dealnews transferable to the various slave databases.

tagged: database store file phorum dealnews replication database store file phorum dealnews replication

Link:


Trending Topics: