Archive for the ‘MySQL’ Category

New Tutorials No Dpm -r5 Tonight

Admin wrote: Out of time, finally getting tired. Tomorrow, for sure :) One last bug to hunt down.

For now, HEAD’s looking pretty good. grab the export tarball, check out the git repo, etc. If you’re bored.

The most interesting addition is the CMake build and the fact that DPM’s now portable to at least four operating systems. I’ve read Jan’s recent posts on the subjecft of build systems, and I’ll admit up front that I haven’t touched DPM recently due to my reluctance to use autotools.

I’ve decided CMake isn’t evil enough to warrant avoiding it. It’s an extra dependency, so we’ll see how it goes. There’s even been recent discussion on using lua as CMake’s build language :)

Also, I’ve finally done a few tests with mysql’s sql-bench “run-all-tests” against DPM. So far, it’s passed with no memory leaks or crashes! My one oustanding crash bug was a simple fix noted below.

Updates for R5 (slight recap from yesterday):

- Uses CMake as a build system. File tries really hard to satisfy dependency checks and to build it correctly.
- Ported to multiple operating systems (not win32, not really interested). OS X, OpenBSD, FreeBSD.
- Will now optionally build with -g, instead of always.
- With addition of CMake, ‘make install’ now exists and works. No more path hacking to get it loading the default libraries.
- Bugfixes: auth packets can now specify default databases, close open connections if the associated lua object is garbage collected.
- Specify under –verbose if closed connections are listeners
- Finally (argh!) able to set a listener to INADDR_ANY by specifying nil for an IP address: dpm.listener(nil, 3306) would emulate mysql’s default network behavior.
- Some documentation updates.

Still not done for R5:

- Bug: Backend authentication does not always work, due to the random scramble generating invalid characters.
- Unix domain socket support (easy, but not five minutes of work).
- Allow lua connection objects to retrieve the connected IP address. (for authentication, etc).
- Potentially a fix for ensuring network flushes happen if packets have been written to the buffer, as presently it will only flush connections which directly receive packets, and proxied connections. Dumb.
- Potentially a few simple dpml additions to help ease new users in.

For R6:

TBD ;) Really needs a test suite.
(Link)

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Furl
  • StumbleUpon
  • Fark

Wednesday, January 2nd, 2008

Brand New Software Mysql 6.0, Libevent

Admin wrote: Currently in the 6.0 tree we have support for Libevent. This is one of those things I’ve been wanting to see
us do for years and it was finally completed a few weeks ago by Damien
Katz (aka CouchDB) with some help from Dmitri Lenev.

So what does this do? MySQL uses a 1:1 ratio for connections and
threads. Libevent allows us to pull threads into pools and use them
for connections. This is pretty awesome for 8way machines since
partially solves thread contention issues. Below is an example of
MyISAM doing large number of inserts with the number of users doing
inserts increasing (1-300 users). The graph shows the time taken for
each test run. Similar numbers show up when you run benchmarks with
Innodb (leave concurrent set to zero as you should normally do, this
will allow libevent to more effectively control the thread usage).
The green line shows the test running with 20 threads, while the blue
is unlimited. I do not have good rules of thumb yet for thread number
vs processors. The machine I used for this test is an 8way that I have
on loan from Intel. I will work out a similar test for Solaris once I
can get the code to compile there.

Pretty awesome :)
Libevent Picture.jpg


(Link)

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Furl
  • StumbleUpon
  • Fark

Tuesday, January 1st, 2008

Scripting Look What The Postman Brought

Today,  

The doorbell rang, I was almost to late .. but I still catched the post guy before he left..
He had a package

I knew what was in the package ..

but I was even more surprised when I opened the book..

Thnx a lot folks !!


(Link)

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Furl
  • StumbleUpon
  • Fark

Monday, December 31st, 2007

Brand New Tutorial Ipv6, Mysql, Yet More…

Admin wrote: I’ve refactored mysql so that I can enable IPV6 support. After some good feedback on the last release I modified everything to make dual stack support work (and got rid of the resolve locks in the process).

The tree is now public:
http://mysql.bkbits.net:8080/mysql-6.0-ipv6/

There are some issues with Windows that I need to resolve (which has more to do with broken Windows setups then problems in the code).

Instructions on how to build from Bitkeeper from here:
http://dev.mysql.com/doc/refman/6.0/en/installing-source-tree.html

I still need to change the family defines to allow the IPV6 pieces to work, but that is just a couple of lines. I wanted to get the refactoring out of the way before I did that.

The tree is an Alpha, so don’t even think about putting this into production environment (as always, I recommend people stick to GA releases for production usage).
(Link)

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Furl
  • StumbleUpon
  • Fark

Monday, December 31st, 2007

Source .net 3.5 Absurdity

Today,  I just uninstalled .Net 3.5 for some testing purposes. I can’t get Toad For MySQL 4.0beta to work properly with 3.5. The absurd thing is that it had to download 10MB of data to UNINSTALL the program.

WTF?
(Link)

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Furl
  • StumbleUpon
  • Fark

Sunday, December 30th, 2007

Brand New Networking Ruby On Rails New Aptitude

Today,  


web development with RoR

So, I joined the Ruby on Rails crowd. One year ago I got a complimentary book from O’Reilly, and only this week I got around to read it. I have wanted to explore Ruby on Rails for quite a while, and today I had my first taste.
I put the book on my desk, and I started following the examples on my Linux desktop.



A great architecture.



It started very well. Unlike many freehand architectures, Ruby On Rails forces you to do the right thing. Separating the programming logic from the interface is something that is recommended in all programming books, but Ruby on Rails imposes its goodness on you. If you want to take advantage of the quick framework, you need to follow the rules.
MVC


Ruby On Rails MVC architecture is not new. The geniality of this implementation is to make it easy.

Going uphill

After the theoretical part, it was show time. So I followed the tutorial. Well, I tried.
It looks like Ruby on Rails 2.0 has changed a few defaults. As a result, the vast majority of great tutorials in the web and on books are broken. No kidding.

Default database

The first obstacle was easy. By default, Rails now uses SQLite3 instead of MySQL.
The rationale given in the announcement is that SQLite3 is easier to use than MySQL. That may be true, provided that your application stays confined to your desktop, and perhaps to three or four users. When your application scales as to require more than one web server, you face a migration of a production environment. True, Ruby on Rails assists you in this task, but my personal feeling is that planning is better than patching.
This one was easy to spot. Many tutorials recommend editing the database configuration file, and I did it, only to find out that it was not what I expected. The online help in my Mac says that the default is still MySQL.

$ rails --version
Rails 2.0.2
$ rails –help
Usage: /usr/bin/rails /path/to/your/app [options]

Options:
-r, –ruby=path Path to the Ruby binary of your choice (otherwise scripts use env, dispatchers current path).
Default: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
-d, –database=name Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite2/sqlite3).
Default: mysql
-f, –freeze Freeze Rails in vendor/rails from the gems generating the skeleton
Default: false

Anyway, the solution is to start with

$ rails -d mysql project_name

And we are back in track. The tutorial can resume.

scaffolds

But it turned out that the backend database was not the only significant change. This one took me tied for about two hours.
Almost every tutorial shows you the joy of publishing with Rails, by creating a simple table, and having its contents listed on the web, with a simple editing form to insert new contents and modify existing ones. That is something that attracts developers to Rails, and I was eager to enjoy the quick glory of instant publishing.
It didn’t work. The tutorials all sing the same song:

  • generate a model
  • edit the model, adding the attributes
  • generate a controller
  • edit the controller, adding a scaffold line
  • run and marvel

It failed. It failed on Linux, and it failed on Mac OS X.
Then I reinstalled Rails on both boxes, and started from scratch. It failed again.
I thought that maybe, given that the new default database was SQLite3, using it could make a difference, so I tried that one as well. It failed on Mac OSX just as before, and it did not started at all on Linux, because SQLite3 was not installed (it was just an “apt-get” away, but that it’s beyond the point).
So I did what I should have done in the first place. I entered “ruby on rails scaffold” on a Google bar, and the first item gave me the answer. RoR 2.0 breaks compatibility with the past (and with the enthusiastic tutorials that are attracting users).
The song now is :

  • generate a scaffold with attributes
  • generate a controller
  • run and marvel.

Which is admittedly much easier and painless. Too bad that the whole world was trying the old syntax, which was easy enough to appeal.

Summing up

Well, I may have sounded a bit negative in my previous notes, but the truth is that, despite these shortcomings, Ruby on Rail has a great future, and I am going to try the examples from the rest of the book.
(Link)

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Furl
  • StumbleUpon
  • Fark

Saturday, December 29th, 2007

New Internet Mod_ndb 1.0 And 1.1

Admin wrote: A quick note on mod_ndb: the official 1.0 release, and the first beta of 1.1, are now available for download at mod-ndb.googlecode.com. Mod_ndb is an Apache web server module that provides a Web Services gateway into MySQL Cluster. Its documentation is at MySQL Forge.

Mod_ndb supports MySQL 5.0 and 5.1 along with Apache 1.3, 2.0, and 2.2, and it is distributed in source code form only ? you build it for your particular versions of Apache and MySQL. One nice improvement in 1.1 is that it is easier to build mod_ndb for Apache 2.0, as the build system no longer has any dependencies on the old version of apxs.


(Link)

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Furl
  • StumbleUpon
  • Fark

Friday, December 28th, 2007

New Networkings There’s Nothing Like A Machine Doing The Work For You.

Today,  So I was reading Nate’s PHP tip, and it got me thinking; he’s basically describing bayesian session validity checks - what an awesome idea![1]. Here are my list of possible ‘items’ to form the test:

  • Login IP address
  • Login location (gathered courtesy of GeoIP)
  • Operating System
  • Web Browser
  • Time of Day
  • Origin of requests (both HTTP_REFERER and REQUEST_URI)

I was thinking of how damn accurately you could identify some specific cases of fraud though:

  • “I only login from work” (time of day is always 9-5, location is always the same)


Each bit of information becomes more relevant the more frequently it occurs exclusively (or exclusively as part of a set). The only catch is that I would also need to identify the patterns that form sets:

  • “At work I use Windows+IE at home I use Mac+Safari”

(i.e. Login location is one of two places. If Windows was used from home, it’s not consistent with the pattern).

If I can identify the sets, then it might become frighteningly accurate. I can then classify a login attempt into one of three classes; Spam, Unsure and Not Spam. For the not spam, if it’s an open session it can continue unhindered. If I am unsure, I may ask them to log in again (which is only a minor inconvenience). If it’s spam, I want them to re authenticate and solve a CAPTCHA test. I want phishing to become more expensive.

[1] Although I know Google is already doing this with my Gmail.
(Link)

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Furl
  • StumbleUpon
  • Fark

Friday, December 28th, 2007

New Updates Storage Engine Idea, Tzdata

Today,  I recently ranted that Sun JRE installs /usr/java/jre*/lib/zi/, a nearly complete timezone database in it’s own java-ish format, instead of using the Olson database in ZIC format in /usr/share/zoneinfo/.

It turns out that MySQL does the same thing, it installs a set of MyISAM tables with the TZ database.

It won’t be too hard to write a read-only storage engine that reads the /usr/share/zoneinfo/ ZIC files, and presents tables that “look” just like the currently used tz tables, basically doing what mysql_tzinfo_to_sql does, only “live”.
(Link)

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Furl
  • StumbleUpon
  • Fark

Thursday, December 27th, 2007

New Scripting The Economist: Ubuntu Is The Source Of Linux’s Rise

Today,  

The Economist makes three technology predictions for 2008, two of which concern web surfing and the third of which concerns everyone, whether they surf the web or not. The Economist’s third prediction is that the technology world will open up:

The embrace of “openness” by firms that have grown fat on closed, proprietary technology is something we’ll see more of in 2008….

Pundits agree: neither Microsoft nor Apple can compete at the new price points being plumbed by companies looking to cut costs. With open-source software maturing fast, Linux, OpenOffice, Firefox, MySQL, Evolution, Pidgin and some 23,000 other Linux applications available for free seem more than ready to fill that gap. By some reckonings, Linux fans will soon outnumber Macintosh addicts. Linus Torvalds should be rightly proud.

What’s most interesting about its analysis, however, is where it sees the biggest impact for open source (Linux) and why (Ubuntu):


(Link)

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Furl
  • StumbleUpon
  • Fark

Wednesday, December 26th, 2007