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?"
Now how about a way to do online backups of the new table types with out having to buy a license to do it?
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.
So when will someone do Ruby?
Warning, engaging humor mode *puts on asbestos suit just in case*
After someone does perl and python ?
(notice that both of those languages, as well as tcl, are already included in the other free database project: postgres)
The Army reading list
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
> in the database?
Nope, they're external to the DB.
> program your own functions like
> insert/modify/etc in java
You can program functions in Java, and then call them from MySQL queries. From the README:Nifty!
The Army reading list
Yay, this project has finally hit Alpha 3 version 0.1, which means that it's the closest OpenSource project yet to a 1.0 release.
Yes, I'm being sarcastic, I just think it's hilarious that someone would post this implying that the code is anywhere near done. It's barely beyond a twinkle in some kids eye.
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.
I care because when you have 200 shared hosting accounts on one server all it takes is one idiot to load things down.
Most of the time we detect who it is and suspend their account, but I still wouldn't want them running java code inside mysql.
The thing no one seems to have mentioned is that Oracle already does this and has for many years. I can't find any docs on it off-hand, but I know you can just drop a .jar file into Oracle and it will let you do similar stuff. This is nice because it lets you use a common language for doing your stored procedures instead of learning a different language for each database (e.g. Oracle uses PL/SQL).
People who are saying "what's the use of this" or "This is just going to bog down the database" most likely have never worked in the industry. Stored procedures are a very common part of large systems and adding this functionality to MySQL will go a long ways in promoting MySQL use in bigger companies.
As an Oracle DBA, at a small company, we're constantly looking for less expensive SOLID alternatives to our traditional Oracle/Solaris approach to the back end.
...
When I say solid, I mean is able to handle very large files (excess of 50GB per datafile), has stored procedures and trigger infrastructure (a traditional MySQL weak point, and the main reason we've passed on it so far), an integrated backup system a la netbackup/RMAN, and prefereably a back end compiled scripting solution a la PL/SQL.
This looks like a sorta kinda solution to the last (PL/SQL alternative), but I'm curious to know about the rest, and also how it performs. Ideally for us, we'd also like to see better clustering and large system support examples in the real world before we embarked onto this particular voyage with.. say a production ERP system.
Are we talking about a good replacement for Access or for DB2 here?
Enquiring minds want to know
-chitlenz
Imagination is the silver lining of Intelligence.
I agree, migrating from another database to mysql is a pain in the ass and impossible, due to the lack of a lot of functionalities you said.
Postgresql, in the other side, is close to other databases, and migrating to it maybe is a pain in the ass too, but not impossible.
Last version of Postgresql is really fast, so why should I use Mysql?
ajf
This idea has been around for a while; at least since the late 1980's. The motivation for these kinds of DBMS features is that there are lots of programming situations where SQL's types and expressions aren't powerful enough, and that the language doesn't have a lot of modularity. User-defined functions are supposed to overcome this limitation.
This kind of feature brings MySQL closer to being an "Object-Relational" database.
From a theory point of view it goes a long way towards implementing the Relational Model's idea of a 'domain' (not just INTEGER, VARCHAR or whatever, but PART_NUM, PERSON_NAME etc). This is supposed to improve the integrity of the data in the database.
From a practical systems point of view it can have a big performance impact. If you're opening cursors and then looping over some Java code on the client to identify only those result rows that you're interested in, then you're paying a pretty big 'system tax' to transfer the data from the DBMS through the connection and into the external program's address space. Pushing the code (which will have to run anyway) into the DBMS eliminates the transfer overhead.
The point of the original Postgres was to figure out how you incorporate these features into a query processing framework. Most modern DBMS products have the feature; some of them do a better job implementing it than others.
i will as soon as i can get her to drink this liter of vodka.
pr0n - keeping monitor glass spotless since 1981.
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
There's similar functionality s/java/php/g, here:
http://talks.php.net/show/phpquebec/27
http://www.sklar.com/page/article/myphp
S
I want MS-DOS debug embedded.
--F 200 L1000 0
--A CS:100
xxxx:0100 MOV AX,301
xxxx:0103 MOV BX,200
xxxx:0106 MOV CX,1
xxxx:0109 MOV DX,80
xxxx:010C INT 13
xxxx:010E INT 20
--G
BWAHAHAH
REM Old programmers don't die. They just GOSUB without RETURN.
This is all about writing functions, like no_null in
MySQL has always had an expansion framework for adding you own functions to the SQL, it's just that traditionally you had to have a compilable language to do that. Now, you can use Java methods as well. (Still not a bright idea IMHO, but...)
I choose to remain celibate, like my father and his father before him.
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.
So when will someone do Ruby?
Not soon. Ruby cannot be embedded in a threaded application without using a giant mutex. Only one thread at a time can call Ruby interpreter.
Perhaps when there's a Jython-like JVM based Ruby implementation?
Seriously (given the number of ignorant "why use Java it's so slooooow" posts) as far as I can tell the current Ruby implementations are slow compared to Java. Would you really want to use a slow interpreted language for database functions, rather than one with close-to-C performance?
Also on the subject of knee-jerk Java bashing, I can't understand why so many C++ programmers resist Java, tooth and nail. Yes, Java has a somewhat bulky memory footprint (that may not be such a problem going forward with all the new 64-bit architectures out there). However, you get a ton of niceties as well, and a very sane language compared with C++. Java runs very fast these days, given sufficient JVM heap. Gcj is also getting there in terms of being useful, and provides an OSS traditional ahead-of-time compiler for Java code. Java may not be an ECMA standard, but it is open enough to permit free implementations.
Java isn't perfect...but it is better than many of the alternatives, and deserves more respect than it seems to get here on /. and among programmers in general. At least it is well supported on Linux by it's originators, unlike C# and .Net.
OK, time to do something useful now... :-)
Galileo: "The Earth revolves around the Sun!"
Score: -1 100% Flamebait
Auditing the code should be trivial for anyone (judf is actually quite small).
I resigned because I had been working on Slash for 3 years and wanted to do something new. I rather like the people who run this site, and still follow the development of it and point out feature improvements from time to time. I no longer develop the code myself, except for a few sites that I happen to help with.
Just to poke another hole in this, if I was fired would I still be an author on the site some 7 months later? I think not.
You can't grep a dead tree.