Python: talk about key-value databases

April 28, 2009 § Leave a comment

by Bob Ippolito: http://blip.tv/file/1949416/

Mysql: benchmarking many writes

April 28, 2009 § Leave a comment

Purpose:

  • Benchmarking Mysql writes to be compared with key-value databases writes.

Basic info:

  • 2.53 G Core 2 Duo Mac Book Pro
  • 4 GB RAM
  • Ruby client

Code can be found: here

Results for 100,000 rows with 16 char length value:

Write 100000 rows with string-length: 16
Thread ID: 659670
Total: 9.095328

%self     total     self     wait    child    calls  name
66.58      6.06     6.06     0.00     0.00   100000  Mysql#query (ruby_runtime:0}
20.30      9.10     1.85     0.00     7.25        1  Integer#times (ruby_runtime:0}
13.11      1.19     1.19     0.00     0.00   100000  Object#insert_statement (/Users/didip/projects/ruby/mysql-profile/write_profile.rb:27}
0.00      9.10     0.00     0.00     9.10        1  Object#write_many_profile (/Users/didip/projects/ruby/mysql-profile/write_profile.rb:37}

Results for 1,000,000 rows with 16 char length value:

Write 1000000 rows with string-length: 16
Thread ID: 659670
Total: 88.175784

%self     total     self     wait    child    calls  name
66.33     58.49    58.49     0.00     0.00  1000000  Mysql#query (ruby_runtime:0}
20.48     88.18    18.06     0.00    70.12        1  Integer#times (ruby_runtime:0}
13.19     11.63    11.63     0.00     0.00  1000000  Object#insert_statement (/Users/didip/projects/ruby/mysql-profile/write_profile.rb:27}
0.00     88.18     0.00     0.00    88.18        1  Object#write_many_profile (/Users/didip/projects/ruby/mysql-profile/write_profile.rb:37}

Python: Object to JSON

April 27, 2009 § Leave a comment

I want to store python object to JSON. Including a complex one (not just object that contains simple attributes).

Apparently, John Paulett has a need for that too. Here’s his code. The best part is: It uses CJSON! Bingo.

Python: using Memcache Client

April 23, 2009 § Leave a comment

For some reason, it’s always hard to find example on how to create memcache client object using Python.

This time, I will remember:

import memcache
memc = memcache.Client(['127.0.0.1:11211'])

Ruby: ActiveRecord

April 23, 2009 § Leave a comment

All the possible ways of cleaning up database connections via ActiveRecord:

http://coderrr.wordpress.com/2009/01/12/rails-22-activerecord-connection-cleanup/

Ruby: Moneta

April 21, 2009 § Leave a comment

In short, Moneta is just like Shove in Python. It is a single interface to various dictionary/hash like storages. Which means all those sexy Key-Value databases.

I’m currently benchmarking Moneta’s Tokyo vs Redis vs Memcache.

Results so far:

  • Surprisingly, the Tokyo implementation is significantly faster. Even against memcache implementation. Why?
  • Similar to LightCloud benchmark, the size of value does not affect speed of storing/getting.

Reference:

Programmer Competency Matrix

April 19, 2009 § 1 Comment

http://www.indiangeek.net/wp-content/uploads/Programmer%20competency%20matrix.htm

Where Am I?

You are currently viewing the archives for April, 2009 at RAPD.

Follow

Get every new post delivered to your Inbox.