Archive for the ‘MySQL’ category

Possible book project – open source search

March 9th, 2008

I’ve had a book project in the back of my mind for a bit.  Though there’s never enough hours in the day to get everything done I need to, I have one book I’m wrapping up in the next few days, and am seriously considering committing myself to this next one.  No publisher lined up yet or anything of that nature, but if I can’t find one I’d self publish through lulu.com.

The title obviously gives it away – I’m looking at doing a book on open source search products.  I was thinking of doing an entire book on SOLR last fall, but honestly I’m not sure there’s enough about SOLR to write an entire book – at least not without repeating a lot of the information already out there in tutorials and what not.  And I’m not sure that another deep in-depth technical book is necessary on something that’s moving so fast.  The idea was to give a moderately-deep (but not overly deep, if you can make that distinction) look at setting up and using a group of open source search projects out there.

  • Lucene is the leader in this space, without question.  It’s been around for quite a while, and keeps getting better with each release.  However, Lucene itself is very low-level, and Java only.  Many implementations of Lucene have sprung up, such as Lucene.Net and Lucy, as well as tools which build on Lucene like SOLR and Nutch.
  • PostgreSQL has full text search capabilities which I plan to explore in more detail.
  • MySQL has had a degree of full text search capabilities for years, and the Sphinx project has emerged over the last couple of years to provide even more functionality and speed.  I believe Sphinx is essentially standalone but can be coupled with MySQL or PostgreSQL – again, that’s research fodder for the book.

Are there other open source search projects that you’d be interested in seeing covered in a book?  Is this a topic you see any demand or interest in?  Whenever I see a gap in the book market, I always wonder if it’s because there’s no interest, or just that no one has filled the gap yet.  Usually something appears to fill that gap a few months after I notice it, but I’ve yet to see this gap filled after almost a year of thinking about it.

Feedback?

SQL Server driver for PHP5

February 9th, 2008

For anyone that has struggled with using PHP and MSSQL over the years, this one may come as some pleasant news (if you’re still in that situation).  Microsoft has put out a preview of “SQL Server 2005 Driver for PHP” back in October 2007 (yeah, I just found out this morning!).  Ehh… not as impressed as I thought I would be, in that it’s still only for PHP apps deployed on Windows.  This isn’t replacing freetds any time soon.  I guess I’m still wondering what the market for “PHP apps deployed on Windows talking to SQL Server” really is – most of the shared hosting accounts I’ve seen, even on Windows, offer MySQL or Access as the database. 

Scratch that – I’ve started to see SQL server as an option more recently (bit of a brain pause there a moment ago!).  This is perhaps a bit of a chicken/egg situation – if there’s a more stable driver, this may help hosting companies push SQL Server as their default DB option (perhaps eventually charging for a MySQL installation as an option?).

There’s a video of the team talking about the project here (but you’ll need silverlight to watch it!) and the team’s blog here.

Powered by ScribeFire.

Sun buys MySQL and other interesting tidbits

January 16th, 2008

Sun is acquiring MySQL


OK, well, I thought I’d be able to find a few more interesting tidbits, but these two are interesting enough to me for a Wednesday morning.  Obviously the Sun/MySQL thing is big – will they use the acronym SPAM for Solaris/PHP/Apache/MySQL?  I claim “first post” on inventing that acronym, although I’m sure I’m not the first.  Or perhaps Java Apache MySQL (“JAM”)?  Or maybe even MySQL Apache Sun (or Scripting) Java (“MASJ”)?  Pronounce MASJ as “message” spoken in the Deep South.

But seriously, given my current work with Open Source Risk Management (OSRM), I’m really curious as to what this will do for MySQL licensing.  Sun has a history of really bizarre licensing (‘Sun Community Source License’, anyone?), and making their licensing byzantine enough to require people to be more paranoid about Sun stuff than other projects.  I truly hope most of those issues are vestiges of a “pre Schwartz” time, and that going forward Sun will be much more direct and simple about their licensing terms.

Additionally, what might this do for MySQL/Java integration?  I don’t think there’s been much of anything there so far, but maybe we’ll see the ability to do in-db scripting in Java?  Integrate Lucene as another available storage engine?  At the very least, perhaps they’ll start bundling JDBC drivers directly with MySQL so you don’t need to go download them separately (though, IIRC, it’s IBM that owns JDBC stuff, not Sun).

phpBB is running on the Project Zero PHP interpreter (written in Java)
The ProjectZero team is moving along on their PHP interpreter.  I’ve been watching it here and there since middle of last year (well, perhaps September?)  I’m mixed on this, but in general I think it’s a good idea.  It may serve as a catalyst for some people to start straddling the PHP and Java worlds more directly, and may lead more people to Groovy as well.

Anyway, any thoughts from any of you out there on these two recent annonuncements?

GORM Goodness in PHP

January 10th, 2008

I’m working on a way to port the ‘magic’ goodness of GORM to PHP.  I’ve thought about it for awhile, but haven’t had much of a need to.  I’ve got a need for it now, so I’ve whipped up a basic prototype.  This will allow me to do things like:

$user->findAllByFirstname(“Mike”);

and automatically get an SQL statement like

“select * from user where firstname = ‘Mike’

If I get this working transparently enough, I may donate it to some framework project (Zend, Symfony, etc.)

Any thoughts on this from the community?

MySQL oddities in legacy project

December 22nd, 2007

I recently inherited a project.  My primary goal is to make it portable to the extent that it can run on another webserver setup.  This is a PHP4/LAMP system, but the people I’m getting it from didn’t write it themselves, and can’t spend the time to dig in to it and make it able to run on other systems.  Sort of a long story, but the crux of it is is that I’m having to do some cleanup.  I’m going to make this run under PHP5.2, but I’m looking at some things in the database dump, and they scare me.

One table has three columns which slightly freaked me out.  One column’s name is “DROP DATE”.  I KNOW you can get around using ‘reserved’ words by escaping the  column names, but the fact that this was written by someone who named a column ‘drop date’, using a space *and* two reserved words in a column name doesn’t inspire me with much confidence.  Another column’s name is “fall/spring/winter” – the slashes freak me out there, and the last one is “# users”.  Again with the space, and a pound sign as the first character – I don’t think I’ve seen so many weirdly named columns in one project.  I’m not even through reviewing the entire db schema yet, but these are enough to make me really cautious about the rest of the project already, and I’m barely in to it.

A table named ‘delete’ – just found that one too.  Sheesh…

PHP on mobile devices

December 20th, 2007

I heard about this last week, which is an article about running PHP on Symbian mobile devices.  Haven’t seen much in the press about this, possibly because it’s not a full release, but just an announcement.  The crux of the article is that someone has ported Apache, MySQL and PHP to the Symbian E90.  They’re calling this “PAMP” – Personal Apache MySQL PHP.  Being able to run a browser on the phone and connect to local AMP apps might herald a new age in mobile app development, or perhaps not.  Palm was the primary game in town for awhile, but I found that to be too difficult (I’m not a C developer).  Windows Mobile seems to be the primary mobile platform right now, for quick app development and widespread deployment.  Apple’s iPhone and this new PAMP might be a next wave in mobile development.  What do you think?

Codemash free admission drawing giveaway

December 6th, 2007

The codemash organizers have graciously donated a free pass to the upcoming Codemash conference to be given away to one lucky webdevradio.com listener.  To enter in to the drawing, listen to the codemash episode interview podcast on webdevradio with Jim Holmes, follow the instructions, and hope your name is drawn.

Latest podcast up

November 26th, 2007

I put up a new webdevradio podcast last week, day after Thanksgiving (or was it the day before?  I forget now).  Anyway, I’ve turned on the comments – apparently there was a bug that was stopping it from working – and am inviting more feedback and audio comments from listeners.  The podcast is short this time (15 minutes) but I specifically invite comments on two topics.  I get a lot of questions on these two, so I opened up the floor instead of just spouting off.

1.  For someone just getting in to web development, what should they study/focus on?  LAMP?  Java?  .NET?  Rails?  Flash?  What would you recommend and why?

2.  What are some good resources for learning advanced PHP, and more specifically good PHP OO practices?

There’ve been a few good responses already at http://www.webdevradio.com, but more are always appreciated, either text or audio (just upload an mp3 file!)

Thanks!

Raleigh web job market

October 25th, 2007

If you’re in the Raleigh area and are looking for a job in the web development market, give me a holler – I’ve had recruiters calling night and day.  AND they’re not all calling with the same position.  That used to happen once in a while – I’d have calls from three recruiters that were all trying to fill the same position.  You could tell – easily – by the wording of the position description.

“Night and day” is a slight exaggeration, but I’ve had more contacts in the past 3 months than the previous 6 before that.  Talking with both recruiters and employers directly, there seems to be at least an overall *slight* shortage of good qualified workers in the area.  There may be a bigger shortage of people in certain areas, and less in others, but on the whole it seems there’s more work than workers right now.  I have info on people who need LAMP/PHP, Java and .Net people for either full time, contract or part time work.

I don’t know if there’s just an issue with fiscal years rolling over and new budgets happening, or if there’s some other explanation, but I’ve noticed a very large amount of activity going on here.  I just hope the positions get filled, because long term, if not, that would mean employers would look elsewhere to set up shop, expand and hire.

MySQL using two timestamps for created/updated values

October 24th, 2007

I’ve seen this on and off for years, but never have it handy. So, here’s a quick demo:

mysql> create table sample ( timeUpdated TIMESTAMP, timeCreated TIMESTAMP, val INT );
Query OK, 0 rows affected (0.24 sec)

mysql> insert into sample (timeUpdated, timeCreated, val) values (NULL,NULL,1);
Query OK, 1 row affected (0.00 sec)

mysql> select * from sample;
+———————+———————+——+
| timeUpdated | timeCreated | val |
+———————+———————+——+
| 2007-10-24 15:25:03 | 2007-10-24 15:25:03 | 1 |
+———————+———————+——+
1 row in set (0.00 sec)

mysql> update sample set val=val+1;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

mysql> select * from sample;
+———————+———————+——+
| timeUpdated | timeCreated | val |
+———————+———————+——+
| 2007-10-24 15:25:23 | 2007-10-24 15:25:03 | 2 |
+———————+———————+——+
1 row in set (0.00 sec)

The basic idea is that by forcing NULLs in to the TIMESTAMP columns, they’ll both be triggered to use the current timestamp value. But when you don’t reference them, only the first TIMESTAMP column will be updated, and if you define it as the ‘last updated’ column, you’re good to go.

There are also ways to handle this via triggers, and loads of ways to handle this sort of logic in your app layer. I think the grails GORM layer will automatically add dateCreated and dateUpdated values behind the scenes, so if all your data is controlled by GORM, you’re set to go. If it doesn’t do it now I believe it was talked about being added soon.