<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>Keith's Web Blog RSS Feed</title>
<language>en-us</language>
<link>http://www.keithwatanabe.net/index.php</link>
<description>Keith Watanabe's Website</description>
<item>
<title>Adding a user to a db</title>
<link>http://www.keithwatanabe.net/blogs/2006/1/23/7acfbd969d591c0cf8addfb419c8f1fe.html</link>
<description><![CDATA[http://dev.mysql.com/doc/refman/5.0/en/adding-users.html

grant all privileges on <database>.<table> to <USER>@<HOST> identified by 'password' with grant option]]></description>
<pubDate>Mon, 23 Jan 2006 09:58:15 -0700</pubDate>
<guid>http://www.keithwatanabe.net/blogs/2006/1/23/7acfbd969d591c0cf8addfb419c8f1fe.html</guid>
</item>
<item>
<title>skip-innodb option</title>
<link>http://www.keithwatanabe.net/blogs/2007/4/7/744847df83bb0bd620e5671804235231.html</link>
<description><![CDATA[there's a little option in the my.cnf file for a Fedora installation of Mysql that is not well documented.  that option, skip-innodb, allows you to use the innodb engine.  if you comment it out, you can use the innodb engine for your tables.]]></description>
<pubDate>Sat, 07 Apr 2007 10:57:04 -0600</pubDate>
<guid>http://www.keithwatanabe.net/blogs/2007/4/7/744847df83bb0bd620e5671804235231.html</guid>
</item>
<item>
<title>An Interesting Week For Technology: Mysql Gets Bought By Sun, BEA Goes to Oracle</title>
<link>http://www.keithwatanabe.net/blogs/2008/1/18/80f29da35a46d812db5e154b7417537e.html</link>
<description><![CDATA[It wasn't that big of a surprise to me when Oracle purchased BEA.  It's been said that BEA has been looking for a buyer for sometime now as Open Source has challenged their position on the application server market.  In some ways, this is a natural pairing, considering that a lot of the companies who use BEA also use Oracle (because they have the money).  It'll certainly be scary in some ways for companies that employ both solutions since Oracle moves in to slowly control the application server market, but at the same time I figure that those companies probably can afford that type of solution.<br />
<br />
However, I think Sun buying out Mysql is a horrible move.  It's a good <strong><em>finacncial</em></strong> move for Sun, considering that Mysql probably is the most popular RDBMS out there.  However, in the past 10 years, I haven't been all that impressed by Sun's track record.  I'm certain that anyone who's read this blog would note that I have a particular thing against Sun's so-called vision (which is just marketing-speak for throwing things against the wall and seeing if they stick).  And I've been extremely vocal against Jonathon Schwartz as Sun's latest CEO.  Right now, he's been credited as someone who has resurrected Sun after McNealy's departure and that this move was all due to him.  That said, I think they're going to bungle Mysql and it's going to hurt the Open Source community in the long term.<br />
<br />
First, doesn't Sun already have Ingress?  Why not support that?  Does Sun's move in buying Mysql imply that they'll let Mysql rot?  Will they continue to commit to allowing Mysql to be Open Source and free for most cases?  Or will they simply start enforcing new licensing policies that have the potential for decimating a good portion of the web?<br />
<br />
I'm sure that many other Open Source developers and companies who rely on Mysql probably have similar contemplations with regards to this move.  Or perhaps a better word is <strong>fear</strong>.  <br />
<br />
The interesting part about the move was that Oracle's move came the same day.  Coincidence perhaps?  Sun's goal with J2EE was to always attempt to move customers away from RDBMS and onto hardware (their hardware!) solutions by creating the notion of a middleware platform.  Oracle's move with BEA shows me that Oracle wants to completely dominate the enterprise market and high and mid level tiers.  With Mysql in Sun's court, it's clearly a threat to Oracle's position on the business application market.  Sun could theoretically move to completely supporting a Java Open Source version of the application stack with Mysql + Tomcat + Hibernate.  If they continue the current licensing with that stack, Oracle will find themselves in an even more limited situation, considering they are one of the most expensive software companies around.<br />
<br />
From there, we have to look at the rest of the market for this.  Obviously, we have LAMP which just isn't owned by anyone.  That's the purest form of Open Source available and probably the most dominant.  You have Microsoft's .NET + SQL Server bundle.  Then you have Redhat + JBoss/J2EE + LAMP and support for Postres.  IBM with Websphere + DB2 and major support for Suse and Redhat.  Then Sun with Sun hardware, Mysql + massive Java support.  And now Oracle with Oracle + WebLogic.<br />
<br />
Some part of me thinks that Sun's purchase of Mysql is for their grid computing project.  Maybe have a massively distributed, rental system like N-1 that contains an application stack that they support.  So companies will never have to worry about support again in terms of reliable system administrators, DBAs, and production support.  Instead, companies will just need to focus on development utilizing a well priced fee for their services.  In other words, a highly trustworthy hosting service focused on providing Java solutions.  They probably could integrate many enterprise features like their user management tool Liberty.<br />
<br />
If Sun takes this route to computing, then it would actually not be a bad idea.  I've proposed that Yahoo (and Google to some extent) should provide similar services, in evaluating their level of expertise on web scalability matters.  In Sun's case, the cost for them would be low since they don't have to worry about purchasing hardware nor licenses as everything is internal.  In some ways, I would consider this move to be something like enterprise hosting.  In this vision, large firms could rent out space from Sun's data center where the entire application stack is provided.  Sun would provide all the support and the firms would migrate their applications onto such a platform with Sun's help.  In house staff could be eliminated or moved into Sun as an agreement.<br />
<br />
Anyway, if this is the vision for Sun, I think it would be a good business move overall.  It depends on whether or not they're wiling to focus on it and take such a huge gamble that companies would want a service like this.  Also, it would be scary in some ways.]]></description>
<pubDate>Fri, 18 Jan 2008 20:40:02 -0700</pubDate>
<guid>http://www.keithwatanabe.net/blogs/2008/1/18/80f29da35a46d812db5e154b7417537e.html</guid>
</item>
<item>
<title>Cool Stuff At Work</title>
<link>http://www.keithwatanabe.net/blogs/2008/1/18/bbfc930bbc61b9295616c74a8329d3c1.html</link>
<description><![CDATA[One noticeable thing about my blog recently is that I rarely complain about my job anymore.  In fact, I don't think I've complained once since joining.  That's because the actual type of work that I'm doing is a lot of fun.  Ignoring the little people games people like to play in companies, I think this is one of the more intellectually challenging and fun jobs I've had in a while.<br />
<br />
To start off, having overall 8 years now in the IT business, I have to say that I'm at the peak of my abilities and still going stronger day by day.  Before I used to be a little intimidated in doing something simple like setting up an application server because the documentation was an unreadable mess.  These days, everything comes fairly quickly with reading a good tutorial online, some hands on practice then the actual implementation.<br />
<br />
Besides, improving my programming skills, I also try to improve my other skills like system administration.  For instance, this week I got a chance to really work with <strong>NFS</strong>, <strong>IPTables/Firewalls</strong>, and more of the security aspects of <strong>Mysql</strong>.  And just yesterday I got my first chance at exploring <strong>mod_proxy</strong> because of a technical difficulty we're having with one of our servers.  This is actually some fun stuff, especially considering that I've worked very little with these technologies.<br />
<br />
Things never go as envisioned but that's the times where you really learn your stuff, especially after conquering a particularly impossible seeming problem.  For instance, the last two days I was experimenting with getting a remote connection setup with Mysql.  We're going to be doing a three layer architecture with a proxy server + application/web server + database backend (actually, it's even more complicated than that since we'll also be doing some NFS stuff, but more on that another day).  So I needed to get the application server to be able to connect to Mysql remotely.  First, I had to try it on a development/testing server.  I've always said that networks are probably one of the most unreliable and confusing pieces of a computer around and it's hard to figure out what to do when you get a failure.  In this case, I had to really dig into the way Mysql was setup from an administrative point of view.  But I soon ran into problems when I did everything <a href="http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html">one tutorial</a> mentioned and still couldn't do a simple test remote login with the mysql client.<br />
<br />
Fortunately, I'm not the only one with similar problems.  I found that the last issue was that <strong>iptables</strong> had been blocking almost all traffic.  So I had to configure iptables under <strong>/etc/sysconfig/iptables</strong> and add a few rules to get port 3306 open and allow UDP and TCP traffic to come in.  This <a href="http://www.cyberciti.biz/tips/linux-iptables-18-allow-mysql-server-incoming-request.html">nice tutorial</a> shows how to handle this situation.  After restarting iptables, I was able to login.  I had to bang my head against the wall for a few hours, but those are the times when you <em>literally</em> beat the knowledge into your skull.  After such times you really never forget such lessons.<br />
<br />
I hope to be able to do more stuff like this at work.  I really want to get my hands dirty with <strong>LDAP</strong> next.  Although we only have a few machines, I like the idea of having centralized, unified login information.  After I fix up my home system, I'm going to give LDAP a try.  Also, I'm really looking forward to working with mod_proxy.  I've worked with similar tools before in using the ajp/Coyote Connector for Apache to Tomcat.  But this time, I'm going to be configuring a reverse proxy.<br />
<br />
There's always more barriers to breakdown with technology and this is the stuff that I really like.<br />]]></description>
<pubDate>Fri, 18 Jan 2008 21:04:04 -0700</pubDate>
<guid>http://www.keithwatanabe.net/blogs/2008/1/18/bbfc930bbc61b9295616c74a8329d3c1.html</guid>
</item>
<item>
<title>Massive Log Files</title>
<link>http://www.keithwatanabe.net/blogs/2008/3/29/ab18e01982fa54768fb407d42446d015.html</link>
<description><![CDATA[I had my first opportunity to do some work on extremely large log files.  Actually, at work I'm running a batch script that is importing data and I'm quite certain it's still not finished.  The thing is that I'm attempting to do some log analysis using Mysql.  I managed to put one client's logs, which reached over 4 million rows worth of data for a span of nearly three months.  The real test was in my current client where just a few days implied at least a gig's worth of data.<br />
<br />
But through this experience, I learned quite a bit from both the Mysql side and PHP.  First, PHP <strong><em>really</em></strong> needs a threading model.  I cannot emphasize this enough.  Most people probably are happy just to do some multi-tasking version of threads, but that's not &quot;true&quot; threads and you really are hacking a model together.  I've seen fake threading packages here and there, but nothing that warrants trying it out.  I'm starting to see why Java and other languages with threads natively built into them are considered superior in this regard.<br />
<br />
Second, global variables are not necessarily an evil.  What!?!?!??!?!?!  Blasphemer!  Actually, using global variables on a few scenarios saved my butt because passing them by value in a function's method calls inflated my memory usage to double the capacity.  In those cases, I was loading up massive arrays of information where I needed to re-index some information before loading it into the database.  Here's a situation where global variables are actually a GREAT thing because you want to save memory.  The key here is that I know which variables are considered global so I can control from a program flow perspective whether or not these variables would have any side effects in the end.<br />
<br />
On the other hand, I found objects to be evil.  I was using the Zend Framework's models to load part of my data into memory.  When you load a rowset using the Zend Framework, you actually are committing yourself to building up VERY fat objects into memory.  On small data sets, this doesn't really matter.  Most websites on the front end probably don't have to bother with such details.  However, when you're loading several hundred rows, it REALLY matters.  Fortunately, the rowset object allows you to convert the data into pure arrays.  By doing this, I was able to cut memory usage in half.  This was a critical step because I had to bump up the memory allocation to near 2gb and the script was going into swap.<br />
<br />
From the Mysql side, I'm learned a thing or two about indexing.  Most people probably just know about indexes from foreign keys, unique columns or surrogate keys (i.e. sequences).  But indexes can be used in more ways to boost up your queries.  Here, I was creating an equivalent log file table using with month and day columns.  Quite often a person might want to check out the number of unique hits per month, or even for a day.  On a data set of say 10 million rows, this can take roughly 20 seconds.  Putting an index on day or month can cut the time in half.<br />
<br />
One thing I was doing in designing the database was structuring it similar to how dimensional modeling works.  Mostly, just one off join tables (I believe these are called the dimensions) from the fact table which was the log table itself.  I had several large fact tables requiring me to do up to six table joins at a table.  Not deep table joins, but just connecting them to lookup type tables.  I tried creating a view to see if I could optimize the select speed.  Turns out that the view took longer than a regular query.  The reason here is that I would use some filter prior to joining up the tables.  The view had no such filter and would grab the entire data set in a joint format before allowing you to run your filters.<br />
<br />
Overall, the experience has been very cool because the typical highest number of rows I'd work with might be a few hundred thousand.  Here, I'm working with several million, so learning to optimize my code and queries allow me to get a much better feeling for how optimal programming works.]]></description>
<pubDate>Sat, 29 Mar 2008 01:30:15 -0600</pubDate>
<guid>http://www.keithwatanabe.net/blogs/2008/3/29/ab18e01982fa54768fb407d42446d015.html</guid>
</item>
</channel>
</rss>
