MySQL Gets Functions in Java
Java Coward writes "Eric Herman and MySQL's Brian "Krow" Aker have released code to allow the DBMS MySQL to run Java natively inside of the database. The code allows users to write functions inside of the database that can be then used in SELECT/INSERT/UPDATE statements. So when will someone do Ruby?"
I wonder how this affects performance especially compared to regular user defined functions? (Available in later releases of MySQL). This is indeed an interesting twist. It certainly can help speed up development of large projects (java works well in a large/many programmer env.) Like a lot of other tools, it remains to be seen how people put this to use. Too often people learn one thing, and like the saying goes, when all you have is a hammer, every problem looks like a nail. Lets see where this goes shall we?
"Science is about ego as much as it is about discovery and truth " - I said it, so sue me.
The above interface allows you to use MySQL via Ruby. What's required here is the converse.
An Indian-American Hindu committed to non-violent thought/speech/action alarmed by the global explosion of radical Islam
I don't know why everybody wants to keep distance from Java. It is a very nice language implementing the very well the OOP paradigm.
The 'lusers' may not use this new feature but Java programmers will and hopefully will enjoy it.
I hope this isn't a "Hey wouldn't it be really neat!" feature. The last time that happened, someone at MS thought executable email would really neat.
One line blog. I hear that they're called Twitters now.
I used Java stored procedures a lot back when I was working at a .com. For someone who's already using Java its a lot easier than learning each database vendors proprietary language. It's also good for keeping MySQL feature competitive with open source dbs, since Java stored prcedures have already been implemented for PostgreSQL
Did you not think about that post? Sounds like you just dislike Java so much that hearing it in the same sentance as MySQL makes you cringe.
1) Java isn't going to slow down any queries unless you use Java functions.
2) What do you care that someone else isn't smart enough to write good software?
3) MySQL as it stands has no other way to really embed functions easily, and it's actually more effecient to run code on the server and transfer data back afterwords.
Karma Clown
The ability to write stored procedures in Java has been in Oracle for some time but I still cannot figure out why anyone would do that.
Java is a nice programming language. Go write web apps, middleware, network software, desktop apps with it but not stored procedures.
Is mySQL process going to start the whole new JVM on every hit? Or VM is going to run separately and it is bridged somehow (God, not over the network)?
Now if you ask me, even stored procedures in general become more and more evil.
And in our age of $50 2Ghz CPUs and Gigabit ehternet the performance is no longer an issue.
To me, a database is a collection of tables and indexes with referencial integrity, failover and redundancy. It should do just one thing and do it well. Attempts to add features like that seem to be just a marketing thing by their new commercial overlords.
If you have have a second system to run as a slave that may work. In quite a few realworld(tm) situations you don't have that luxury.
There needs to be someway of doing online back ups of MySQL with out spending money.
Java is not well supported. Linux, solaris, windows, on x86 or sparc. That's about all that falls in the "well supported" category, maybe macosx. Other OS's and/or architectures have old, broken, or just plain don't have jdks. Maybe if Sun didn't insist on trying to control java in every way, and made it open, then it would really be something. But as is, its just as portable as C#.
The /. crowd keeps hoping Java will go away. They don't want to learn it.
But it doesn't go away.
I have noticed that there are several technologies that are held in high regard outside of the Linux/Free Software that are despised within it.
One is Object Oriented programming. By extension, C++, Java, and UML also fit into this category.
I wonder how many folks who bash these things have ever actually bothered to learn them?
It is easier to say that XYZ is "bloated and ugly" than to say "I never learned these things so I can't say how useful they are."
I also see a lot of "Anyone that does not agree with me is a stupid, clueless, MCSE."
Name calling is a sign of weak arguments.
The article is about Java running on the server, behind the scenes. It doesn't "look" like anything.
I believe server side java is the most common usage of Java. Portability is less of an issue because you control the server environment.
You can support non-Unix users and still use Unix/Linux for your server.
"We can't solve problems by using the same kind of thinking we used when we created them." -- Albert Einstein
Java is not my first choice in languages to support in a database language. PL would have at least been more adaptable.
Unfortunately with the Enterprise Popularity of Java, thanks to a strong Marketing Campaign by Sun Microsystems, MySQL is following the Corporate line of supporting Java regardless. This is a fine example of what may be a mis-direction of the MySQL developers being pushed into a Support the Corporate Enterprise stuff rather then doing good code on a good platform.
There doesn't need to be a free way of doing everything. Shell out the $$$$ you cheap fuck. Something that saves your job should not be free!
No, a stripped-down version of PHP, python, etc would be far better than java.
Does the LAMP crowd write code in java? nope.
Do the DBAs write code in java? nope.
Does the java crowd use mysql? nope (if you're going to the cost of developing apps in java, it makes more sense to use postgresql if not oracle, db2, etc).
In java you can abstract the data persistence thru a variety of encasulation techniques. All of which creates such a mess than everyone's scrambling these days to figure out how to simplify it. Sounds like a mess to introduce deeper into the database.
And portability? Do you really think that java functions created for mysql will port *seamlessly* to postgresql, db2, or oracle? No way. And if they don't - why don't you simply write the functions in a tiny, simplistic language that everyone can use easily?
"PHP Dev David Sklar implemented this over a year ago: http://www.sklar.com/page/article/myphp"
Cool. Very cool. But those execution times are pretty bad. You certainly would want to plan carefully how you used this.
--Richard
Oracle has had this functionality since 8.x. Java is *very* fast inside of Oracle, and is more efficient than PL/SQL in a few cases. Again, OSS is playing catch up.
SO? Oracle has lots of features that MySQL lacks. The point of the post isn't that this is some wonderful new feature never before seen in the world, only that it's new to MySQL.
Oh, and one of the fabulous features that Oracle has over MySQL is the price. I mean, who wouldn't prefer to spend many thousands of dollars? This is obviously another area where OSS needs to start playing catch-up.