MySQL Gets Functions in Java 318
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. (Score:5, Interesting)
Krow (Score:1, Interesting)
Rumor has it that he was fired (or was going to be, so he "resigned"). I'd wait a couple weeks to make sure no backdoors are found.
JMS? (Score:1, Interesting)
Re:mysql (Score:3, Interesting)
I would say that it is definitely one of Java's advantages. I think this feature is useful from the perspective that more small applications will be written by developers that may not be skilled with SQL coding. Many open source projects start out with one developer, and that single developer might not have an arsenal of skills. That is where this sort of thing helps out, that single developer will now be able to use his/her favorite host-language (if Java is his/her favorite host-language) to solve a SQL problem that he/she may not be capable of solving with SQL. Later on, if/when the project grows, the embedded Java may get removed, but at least something had been released, and the concept gets proven.
Where is MySQL anyways? (Score:5, Interesting)
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
Re:give me a break (Score:3, Interesting)
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?
Why you would do this . . (Score:3, Interesting)
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.
Re:Where is MySQL anyways? (Score:5, Interesting)
I have been doing Oracle work for 12 years and find Postgres easy to learn and quite powerful.
Certainly ref integrity, triggers and PL/SQL like stored procedures are all there.
I currently have 80GB PostgreSQL database as a backend for pretty busy websites and it holds well.
THIS is not a solution, just a proof of concept. I looked at the code and it is not even thread-safe.
Re:Keep this out. (Score:3, Interesting)
I work in such a company, as an application programmer. Where I work, it's not up to the DBA to make things run faster - if an application is too slow, it's our problem. True, we can call on the various other people to help us in tracking down the cause of the problem, working out what needs to be done to improve the situation, etc, but ultimately it's our responsibility. It may be that the solution is to increase the spec of the machine(s), or upgrade the network, but we'd still be very much involved in coming to that decision.
So, as a counter example - from my position as a programmer, I'd be rather upset if my otherwise well-performing code is crippled by an underspecced machine or poorly-configured database. I trust the people responsible to do their jobs properly, though.
Slammer anyone? (Score:2, Interesting)
That was spread (as I recall) because of default passwords not being changed on sample databases. I know lots of people that dont change their default MySql root password. (I tellem but WTF, its their bandwidth...)
Seems like they are trying bring MySql in direct competition with M$SQL server... ( as a spreader of worms )
Re:Java in the DB - very, very bad idea (Score:5, Interesting)
Of course there exist myriad reasons why one would prefer to standardize on a common language for DB SPs. Java, in this regard, is the most mature alternative at present. Even the notoriously skeptical Thomas Kyte and the pontificating Steven Feuerstein see the validity of Java in the database at the SP level.
Of course, *we* can all keep fighting amongst ourselves about such things while Visual Basic and C(flat) become the only languages we have to chose from for everything we endeavor to do.
Re:Where is MySQL anyways? (Score:5, Interesting)
As far as 'enterprise level' features, MySQL is still missing Stored Procedures, easy 2-way replication, and clustering (there are many projects out there that add these features, but none of them are included in the main branch AFAIK). They keep getting closer with each release, though.
No, it's not ready to take on Oracle yet, but for mid-size shops (we regularly have 30-50 concurrent users all day from various remote locations), it's a great product. Slashdot runs it, and they seem to be able to handle quite a bit of a load. It's proven itself to me, but then again, I've never played with Oracle or DB2. It has a very active developer base, so things are changing all the time.
PostgreSQL has more enterprise features, but it's not used as much as MySQL. It seems pretty solid, though. We toyed with a bit, but my boss decided to go with MySQL mainly because he had heard of it before.
and here is a great reasons not to (Score:3, Interesting)
keep in mind that since we've mostly dropped the idea of writing all business logic in stored procedures, they're primarily being used these days for very simple procedures. Nothing fancy - convert an ip from a string to an integer, etc. You don't need *or want* a big language for this. Nor should you sweat too much that it is proprietary - who cares when you can learn the basics of the language in 5 minutes.
Re:Obligatory comment/troll (Score:2, Interesting)
Spoken like a true linux zealot with absolutely no foundation in relational data management.
Do you realize that referential integrity is a fairly new feature in MySQL? Do you understand the reasoning behind a transaction based DBMS? How about the simple normal forms layed out by Boyce and Codd?
Anyone who's done any extensive DB work will tell you how lacking MySQL is. I *love* linux, its the only OS I run at home, and I follow the progress of the MySQL project with an almost religious fervor. I can't *WAIT* until it can compete in a production environment
Ruby? (Score:4, Interesting)
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... :-)