I recently had to deal with performance problems in a very large application with a considerable number of SQL queries (i.e. object.find_by_sql or object.paginate_by_sql). And while we can argue whether or not using sql directly in an ActiveRecord context is good, some of these were complex enough (think sum operations, etc) that I didn't want to go and rewrite them as ActiveRecord. And, given a table that is being changed constantly by a crawler, the MySQL query cache wasn't an option*.
mysql> SHOW processlist;
+ --------+-------------+-----------+------+---------+------+-----------------------------------------------------------------------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+ --------+-------------+-----------+------+---------+------+-----------------------------------------------------------------------+------------------+
| 801812 | system user | | NULL | Connect | 2665 | Waiting FOR master TO send event …
mysql> CREATE TABLE j1 ( c1 int ) ;
Query OK, 0 rows affected ( 0 . 16 sec )
CREATE TABLE j2 ( c1 int ) ;
Query OK, 0 rows affected ( 0 . 11 sec )
mysql> CREATE TABLE j3 ( c1 int ) ;
Query OK, 0 rows affected ( 0 . 10 sec )
SQL:
mysql> EXPLAIN extended SELECT j1.c1 FROM j1, j2, j3 WHERE j1.c1 = j2.c1 AND j3.c1 = j1.c1;
+ ----+-------------+-------+------+---------------+------+---------+------+------+-----------------------------------------------------+ …
Modeling this type of data in MySQL was quickly becoming a pain, so we pulled the trigger in November 2009 and switched Harmony from MySQL to Mongo (despite being about 90% done in MySQL). With the change to Mongo, all those little pieces of information that make up a web page can be stored in one document and natively as whatever type of data they are (number, text, etc.) .
In addition to Harmony, I have several toy apps that I use throughout the day that are powered by Mongo…
Support for popular extensions including sqlite3-ruby, mysql, Nokogiri, yajl-ruby (and the obligatory "much, much more.")
Integrated profiler
JIT compilation (a la JRuby) for über-performance
It doesn't work on Windows (yet)
The How: Getting Rubinius 1.0 Running
Sorry to sound like a broken record but.. the best way to get Rubinius 1.0 running is to use Wayne E Seguin's RVM ( Ruby Version Manager)! RVM has already been updated to support …
…MySQL servers. We use the excellent Percona Server for all of our MySQL instances and couldn't be happier with it.
Here's an example of one of our MySQL servers. In this case, the Highrise master database server:
Dell R710
2 x Intel Xeon E5530 Processors
96GB RAM
6×146GB 15,000 RPM SAS drives
For the disk configuration we take the first two drives and put them into a RAID1 volume that is shared between the root filesystem and MySQL binary …
I am starting a series of posts dealing with blockers at work. Here is the first one using gem bundler on Snow Leopard and mysql Mac OS X 10.5 (x86_64) version.
Command: [source:ruby] rake db:create [/source]
Error: [source:ruby] rake aborted! uninitialized constant MysqlCompat:: MysqlRes [/source]
Solution: Compile the bundled mysql gem with correct options. That is, locate your mysql_config and create a ...
Support for the MySQL2 gem , which will take care of MySQL encoding issues on Ruby 1.9.2.
Made the rails command work even when you're in a subdirectory
Dealt with a variety of web encoding issues
Indulge yourself in the delights of all the glorious details from the commit logs or checkout the slightly less pedantic summaries in the CHANGELOGs.
This release candidate of Rails…
…Here is the first one using gem bundler on Snow Leopard and mysql Mac OS X 10.5 (x86_64) version.
Command: rake db:create
Error: rake aborted! uninitialized constant MysqlCompat:: MysqlRes
Solution:
Compile the bundled mysql gem with correct options. That is, locate your mysql_config and create a bundler_config.yml in application root dir. mysql: config: /usr/local/mysql/bin/ mysql config
Run: sudo env ARCHFLAGS="-arch x86_64" gem bundle --config-file …
…"odd" and "even"?) db server, that the master database is being replicated to on the fly via MySQL master/slave replication. During an upgrade we now also stop the replication, so that we can use the slave right away if something happened to the master during an upgrade and we couldn't use ZFS to rollback.
As if that was not enough, there is one more layer that allows users to recover from user errors in a fine-grained manner. It's Confluence wiki page versioning …