PHP: So you'd like to migrate from MySQL to CouchDB? - Part II

This is part II of my introductory series to move from MySQL a relational database (management) system to CouchDB. I will be using MySQL as an example. Part I of this series is available here. Recap In part I, I introduced CouchDB by explaining its basics. I continued by showing a simple request to create a document using curl (on the shell) and expanded how the same request could be written in PHP (using ext/curl) — or in HTTP_Request2 or with phpillow....

November 12, 2009 · 5 min

PHP: So you'd like to migrate from MySQL to CouchDB? - Part I

Update (2009-10-13): I posted part II! This is the first part of a series. I’ll start off by introducing CouchDB — from a PHP side, then I’ll demo a couple basic use cases and I later on, I’ll dive into migrations from MySQL. My idea is to introduce CouchDB to a world where database-driven development generally refers to MySQL. By no means, this is meant to be disrespectful to MySQL, or SQL-databases in general....

October 31, 2009 · 5 min

MySQL: Using indices correctly

The objective was to select sessions from a table, that are older than two days. Table setup This is the definition: CREATE TABLE `session` ( `id` varchar(32) NOT NULL DEFAULT '', `data` text NOT NULL, `user` int(11) DEFAULT NULL, `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), KEY `user_id` (`user`), KEY `rec_datemod` (`updated`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; Right and wrong Wrong query:...

May 5, 2009 · 2 min