Managing and Using MySQL: Second Edition
Managing and Using MySQL: 2nd Edition assumes that the reader has a little knowledge of databases, although some of the commands are difficult to get your head around until you have a database to test them on. Sample commands, and output for them are shown in the book, but a sample database isn't shown until chapter 9. MySQL took me through 'MySQL land' with the greatest of ease. Aside from the lack of a test database in the beginning, everything was very well laid out. It started with the basics, and worked up to full implementation and administration.
Part I introduces the reader to MySQL. It begins with a nice history, design elements, features and what you would want to use MySQL with. Nicely detailed instructions for downloading, and installing the current version. Information is provided for Unix, and Windows systems, with examples for FreeBSD 4 and Windows 2000. Basic SQL commands are presented, with sample queries and relevant results.
Part II introduces the reader to tuning, securing and designing the database. Several pitfalls are described, along with instructions for avoiding them. The realm of tuning is divided into application tuning, database tuning, and operating system/hardware tuning. Security is discussed from all aspects, but a database that has security concerns will need extensive testing and evaluation. Database design starts with the design on paper, with both the theoretical, and practical aspects. Once the paper design is drawn out, MySQL assists the reader through the actual making of the database.
Part III describes integrating the database into your favorite programming/scripting language. In the opening paragraph of chapter 12, The C API, the author states: "In this book, we examine several different programming languages: Python, Java, Perl, PHP and C. Among these languages, C is by far the most challenging." The information was presented in a way that readers who are new to C would have small difficulties with, and that intermediate and advanced users would find quite useful. The authors presented enough information, that I was able to write programs that interfaced with MySQL in less than 10 minutes. Perl scripts are presented in the same way. Knowledge of the language you will be integrating MySQL into is necessary, but the book presents and explains the rest of the information.
Part IV is the reference portion of the book. All great books that teach contain a reference section, and this book is no exception. The basic SQL syntax and command set are described, as well as the data types, numeric, string, date, and complex. Operations and functions are explained, as well as their order preference. The PHP API, the C API, and the Python DB-API are also fleshed out in nice detail.
Overall, the authors have an excellent introduction to SQL databases, and MySQL. Full examples are included for each topic, with full explanations. The only things I would change, would be to have a sample database in the beginning of the book, and to have a copy of that database online.
Table of Contents
Part I (Chapters 1 - 4) Introduction
1 MySQL
2 Installation
3 SQL According to MySQL
4 Database Administration
Part II (Chapters 5 - 7) MySQL Administration
5 Performance Turning
6 Security
7 Database Design
Part III (Chapters 8 - 14) MySQL Programming
8 Database Applications
9 Perl
10 Python
11 PHP
12 C API
13 Java
14 Extending MySQL
Part IV (Chapters 15 - 20) MySQL Reference
15 SQL Syntax for MySQL
16 MySQL Data Types
17 Operations and Functions
18 MySQL PHP API Reference
19 C Reference
20 The Python DB-API
Index
You can purchase Managing and Using MySQL: Second Edition from bn.com. Slashdot welcomes readers' book reviews -- to submit yours, read the book review guidelines, then visit the submission page.
MySQL would be ALOT better if it supported stored procedures and those sorts of things.
*shrug, but what do I know.
but I use webmin
Right, MySQL story. To save everyone else the trouble, I'll go first.
MySQL rocks!!
No it doesn't, PostgreSQL rocks!
MySQL is faster.
No it's not.
Yes it is.
Use Oracle if you want a serious database.
I run a top-5 US bank with MySQL on a P166MMX and it runs great why do you need Oracle?
MySQL doesn't have transactions yet!
Yes it does
No it doesn't
PostgreSQL rocks!
No MySQL rocks!
Read on for Geekboy's review..., which he describes as "the only thing you / need/ to make a usable database."
Yeah, until the third edition....
There is no reasonable defense against an idiot with an agenda
:wq
Does anyone know of good references that cover the security of web applications from the ground up? This is good that they appear to devote some time to security from the mysql side, but typically security flaws in web applications tend to be in the communication between the front-end and the database, or in the front-end itself. What books if any cover the entire process for security?
I've been reading about 100 pages a night of this book and its awesome. Personally I'm using it for web applications and if anyone of you are doing the same, also pick up Web Database Applications with PHP & MySQL (ISBN: 0-596-00041-3). Complimenting each other in the very best way.
Every time I read an O'Reilly book it reminds me of why they're the only thing in my book case (of the computer nerdish-tech know how sort).
Awesome stuff.
Get paid to code OSS
I was disappointed to read that the C++ API to MySQL is not discussed. While the C API could no doubt be utilized, most professional developers aren't going to consider a database in the enterprise if it won't gracefully interface with existing object-oriented code.
Other than that, this sounds like a great book. I am very interested in MySQL, which must be a good database system, since it's what slashdot uses. I've always associated slashdot with stability and relyability.
Karma: Good (despite my invention of the Karma: sig)
There's plenty of documentation out there for MySQL. Seems like the last thing we need is another MySQL book.
How about a PostgreSQL book? I stopped using MySQL awhile ago for my high traffic site, as its lack of features (subqueries, views, triggers) proved insufficient. Postgres rocks!
Yeah, I know there's support for subselects in the 4.1 dev tree, and I know there are workarounds for both SPs and subselects. I don't want workarounds, I want the damn feature!
Oh well, I guess I should be happy that they finally support transactions, sort of.
http://www.anse.de/mysqlfront/ This is hands down the easiest tool for constructing databases. I use mysql for keeping track of millions of records, and this tool has proven stable. It is an "Enterprise Manager" like gui that could make a pointy haired boss a mysql guru in no time. My .02
"On a long enough timeline, the survival rate for everyone drops to zero."
Yes, try the Open Web Application Security Project. They released a very informative paper on building secure webapps, and it's free.
(I'm not affiliated with them in any way)
Petru
Managing and Using MySQL: 2nd Edition assumes that the reader through the actual making of the language you will be integrating MySQL into is necessary, but the book presents and explains the rest of the information.
Part IV is the reference portion of the book, but a sample database in the beginning, everything was very well laid out. It started with the greatest of ease. Aside from the mysql side, but typically security flaws in web applications and if anyone of you are doing the same, also pick up Web Database Applications with PHP & MySQL (ISBN: 0-596-00041-3).
Aside from the ground up? This is good that they appear to devote some time to security from the mysql side, but typically security flaws in web applications from the lack of a test database in the book, but a database to test them on.
It begins with a nice history, design elements, features and what you would want to use MySQL with. Nicely detailed instructions for downloading, and installing the current version. Information is provided for Unix, and Windows 2000.
Part II introduces the reader has a little knowledge of databases, through the actual making of the language you will be integrating MySQL into is necessary, but the book presents and explains the rest of the bookm although some of the book, and to have a database to test them on.
All great books that teach contain a reference section, and this book and its awesome. Personally I'm using it for web applications and if anyone of you are doing the same, Complimenting each other in the beginning of the commands are difficult to get your head around until you have a database to test them on (of the computer nerdish-tech know how sort).
While at a conference a few weeks back, I spent an interesting evening with a grain of salt.
MySQL is great, I love it. I recently taught myself how to use it along with Apache and PHP. One thing that I haven't found yet for MySQL that there should be is some software that would allow a less advanced user to still get the power and functionality of a database system. Basically something like the Microsoft Access front-end (because I have to admit that the microsoft access interface is simple enough that it allows people who don't know much about databases to utilitize them), but using MySQL as a database backend.
Just out of curiosity, why are you bitching about this when there is a far superior alternative?
MySQL needs to just go away.
www.cgisecurity.com/lib
www.sqlsecurity.com
You can't even mention MySQL without the know-it-alls coming out of the woodwork. You'd think the mere mention of MySQL offends their sense of personal or national pride or something. If MySQL isn't your taste, doesn't meet your needs, isn't robust enough, whatever, then don't use it. Use PostreSQL or another RDBMS. Why people continue to begrudge other's use of MySQL is beyond me...
-B
Ash and Hickory, straight-grained and true, make excellent bludgeons, dandy for the cudgeling of vegetarians.
One thing to note is that PostgreSQL is free for proprietary applications; while MySQL must be licensed since it is GPLed. Besides, you can
now write your triggers in perl or python with
PostgreSQL; which IMHO, is damn cool. Besides
being very stable, good performace, etc.
I thought it was just me at first, but do any books that get a rating that is not 9 get posted? I went to the book section and checked out the most recent reviews. Of the last nine books reviewed, eight of them got a nine, and the other got five stars (out of five I assume). The two book reviews before that (both in the Java meets XP subject) got 7's.
I would like to see someone review a book that isn't very good, and tell us why. It almost seems that these great book reviews are being pushed so someone can make some bucks through an affiliate program.
Come play Heroes of Might and Magic Mini online.
MySQL 3.23 supports procedure since the old days it integrated BDB table handlers. Most people would use InnoDB for that nowadays as it seems it's a bit better supported.
Yea, until MySQL AB decides they don't want to do business with you anymore. Then your commercial version becomes GPL'd and they take you to court. NuSphere licensed MySQL from MySQL AB and look where it got them.
Sound? Correct? Well-thought-out? Standardized? Scaleable?
Not so much.
Thanks,
--
Matt
Although they changed the name, the first edition of this book was not worth purchasing. The honourable Mr. Paul Dubois will be putting out his own O'Reilly book in October entitled "MySQL Cookbook".
saints-in-hell
If you need to use it in a proprietary application, you can purchase a non-GPL'd version from MySQL AB.
If I have a propriatary app that uses MySQL or PostgreSQL - is the database server part of my app as far as the GPL is concerned?
My gut reaction is no, due to the fact that you're communicating via SQL over a port and not via function calls. Also, the database is not statically linked - this seems to have been the litmus test for other GPL questions. In addition, the database server can, of course, be on a saparate computer.
If I'm wrong, please enlighten me!
Moneyed corporations, non-working 'poor' and criminal prisoners are turning productive citizens into tax-slaves.
...and still no comments relating to the actual review ...
Its like using COBOL. Who uses it .. honestly, really anymore?
PostG baby.... come on. IF you don't have to money to use Oracle, use PG. Evolution has to move on past old and slug systems
- anon
With that criteria, wouldn't cat, awk, and grep be all you'd need?
Unless you're worrying about the ACID properties that most people use as the minimum criteria for a database. Oh, wait. SQL doesn't have any of those.
Forward, retransmit, or republish anything I say here. Just don't misquote me.
SELECT * FROM trolls WHERE IQ > 70; Error: 0 rows returned
It didn't have transactions, and the only way to get them now is to use InnoDB (this is NOT used by default), which isn't completely integrated. InnoDB and BDB are taken from other projects, and would be better on their own.
MySQL developers have made claims that transactions and rollbacks are a bad thing! I kid you not.
They claimed one could have atomicity without rollback. Okay, so what do you do if a SQL statement which is part of a (user emulated) "transaction" fails. You are stuck halfway through, or else you might have to do a SQL statement that undoes what you did (good luck). And if that SQL statement fails, you are hosed.
MySQL does not (by default) support Atomicity, Consistancy, Isolation and Durability (ACID).
Their developers appear to not know the meaning of these terms.
MySQL isn't truly open source.
MySQL isn't a real database, it is a SQL interface to a file system. MySQL isn't much better than using flat files, and due to the complexity, is often worse.
PostgreSQL has none of these problems. And the performance is much better than the old versions.
Only use MySQL if you don't care about your data. Yeah, it might be fine for a web counter where if it gets hosed, big deal.
If you care about your data and need a REAL database which is actually Open Source, use PostgreSQL.
See this article:
Why Not MySQL.
Just because it CAN be done, doesn't mean it should!
When MySQL made no bones about it, before they tacked on a lot of bandaids to make it LOOK as if it supported transactions, before they decided to pretend they weren't just a simple DB with a hacked up SQL front end -- they were a great, simple, lightweight, read-mostly DB.
But then they got defensive, tried to claim that transactions weren't really necessary or even useful, tacked on transactions anyway, added other gorp to make it look like they could compete with PostgreSQL (the ACID free source DB), and that's when I lost all respect for them.
It was bad enough they made all their own little extensions to SQL (timestamps in a row automatically update even if not part of the update statement, etc). At least they had the lightweight speed king crown. Now I won't touch it, because they are going to slow it down with all this tacked on overhead. I simply don't believe that stuff can be added on afterwards while retaining the speed it was famous for. Those fancy features have to be designed in from the start, not riveted on afterwards. They are going to lose the niche they have all to themselves, by trying to compete in the ACID world, with established polished competitors. They will lose what they have by trying to grab what they can't win.
Infuriate left and right
Smack j00 sux0r. LOLOLOL!!!!!
I'm was working on a project where all of the work flow was handled on the DB side in stored procs instead of in EJBs. This made debugging a pain b/c you have to have a DBA do things out side of your normal build process and testing is harder because you have events happening outside of your control. If people would just learn to use DBs to store information and code to do the logic (sorry PL/SQL isn't gonna cut it) systems would be rolled out faster and with less bugs.
For those who use MySQL or other database systems with PHP, I highly recommend using the ADOdb Database Library for PHP. It's feature-rich, robust, and has a smaller and smaller footprint with nearly every successive version. I use it all over the place, and it's very very handy. Sure, there are other abstraction libraries out there, but this one takes the cake, IMO. Check out all the supported database drivers!
I only post comments when someone on the internet is wrong.
The PostgreSQL team themselves have excellent docs available in a variety of online and printable formats.
Dead tree stuff, Addison-Wesley publishes a great book, O'Reilly has a decent book, and Sam's has one that I haven't read yet.
With the Addison-Wesley book (by Bruce Momjian, a regular on the PostgreSQL mailing lists) and the PostgreSQL team's docs, I went from little SQL and PostgreSQL knowledge, to being somewhat proficient in a few months.
I am new at creating databases and maintaining them. Using MySQL with online tutorials was very easy. I implemented a PHP-MYSQL web page to parse server logs, and it works great in my company.
However, the administration teams quickly found out about the PHP-MYSQL solution and instantly turned it down saying that the tools are not 'standard'. They want something on a commercial DB (Oracle, Sybase) and a 'supported' language (perl/java).
So, I have to rewrite everything using the commercial products. I agree that you cannot have many different products to support (its a headache). But, when an open source solution is implemented and turned down because its not 'commercial' is a problem often faced.
-mlr
If you'll be so kind as to just read through innodb.com, you'll note that InnoDB was Heikki Tuuri's project at the University of Helsinki, and he has since founded a company to develop InnoDB specifically as a part of MySQL. So, why would InnoDB be better on its own?
Also, did you forget that PostgreSQL was initially a project at Berkeley? Is there something wrong with using code from other projects? If you think there is, perhaps you don't understand what open source and free software are...
Got a url where we can read this?
Now that's actually something I agree with. Although there are ways to work around it.
Download the mysql-max build and BAM! there it is...
Those are some harsh words. Care to back that up with some evidence?
So.... The GPL isn't open source?
What is and what is not a "real database" is quite a subjective and personal opinion. Considering that every single database out there messes up the SQL "standard" in some way or another, are any of them a "real database"?
When PostgreSQL has a replication system as nice as MySQL's, and can then scale easily, I'll check it out. And, no, pgreplicator is not good enough [yet].
Or read some documentation and learn how to use it properly just like thousands of other people do. This site that you have posted your opinions on relies heavily on MySQL, are you going to now demand that Slashdot switch over to PostgreSQL to make you feel better about your views on open source databases?
Straight from the article: "NOTE: This Document was written in May 2000. Thus, it is outdated and does not represent the latest data concerning MySQL. I will attempt to find time to rewrite this with more current information soon (August 10th, 2001)"It's quite useless to point people to an article that is entirely obsolete. Perhaps you also need to update your view of MySQL. Take another look at it. It really can't hurt. Yes, MySQL is missing a few things that would make it more convenient to use for "hardcore" database users (who like PostgreSQL), but they are working on it. Version 4 adds transactions/rollback, etc. Instead of keeping your perceptions fixed in 1998, open your eyes, visit mysql.com, download the damn thing and check it out. Then stop spreading misinformation.
Gabriel Ricard
As just having gone thru an upgrade to version 7... I can safely say DB2 on the mainframe blows! Unicode support... they're working on that... Concurrency issues out the wang...
I'll take Oracle 9i on UNIX any day.
At Amazon: Managing and Using MySQL (2nd Edition), $27.97.
Currently only one review, which rated it a 2 out of 5 stars.
Free shipping on orders over $49.
-Pete
(above link is an affiliate link...)
Soccer Goal Plans
I thought it was just me at first, but do any books that get a rating that is not 9 get posted?
Yes, it is because of inflation. It used to be that all books got a rating of 8.5.
Why don't you run Adabas, DB2 or Oracle on the linux boxes then? Doesn't seem that hard to me.
DFossmeister
No Not Again! Its whats for dinner.
If you want to learn about databases in general, rather than learning about a specific database, you might try C. J. Date's book, An Introduction to Database Systems (get it used - and don't worry about those stupid whiners who gave it low ratings, they just don't want to think carefully and precisely about data storage). I would suggest reading this (it's a bit challenging, but people on this website are generally pretty bright and up to a challenge, right?) and then merely perusing a specific database manual.
It seems much more consistent with the way computer science is taught in college: learn the timeless knowledge FIRST, and then the stuff that goes obsolete becomes trivial to learn.
Just a suggestion.
It's A LOT not ALOT.
I mean, thats a good one. With comedy like that, you'll have no trouble finding a three session deal with FOX.
What, you wern't joking? Oh, well then would you like to try your hand at re-writting the two enterprise Telecoms applications that I work on, so that they don't use stored procedures? Our Oracle developers are awfully stressed at the moment, and could do with some light entertainmant...
The awnser to this debate is as simple as ever the best SQL Server is this one sorry but someone had to do it
I regularly hear the comment the MySQL lacks features on purpose, because it occupies a niche that does not require those features. It is a "lightweight" database and it supposedly fills that role well.
I have never been able to tell which niche MySQL is supposed to occupy. Is there really a niche where it doesn't matter if the database is corrupted? Is there really any niche where it doesn't matter if transactional integrity isn't maintained? MySQL does not provide any recovery functionality!
I can understand the point in lightweight software. But ACID features and transactions are at the very core of what constitutes a database; they are not "bloatware features" like the microsoft paperclip. Having a database without data integrity is like having a word processor which can't save files. It doesn't matter how lightweight it is.
Dude, MySQL is dying.
Point to Point Carrier pidgeon protocol.
These books are:
- PostgreSQL: Introduction and Concepts by Bruce Momjian
- Practical PostgreSQL by John Worsley and Joshua Drake
Both of these books are pretty good. They do have a lot of overlap, but they also present things from different perspectives, and provide some different information. I'd strongly recommend skimming through them both.If you're interested in a larger listing of (dead tree) books that are available, you can find a list here.
Topher
Nice troll. Of course there is no such niche. However, not all database applications require full ATOMicity and constraints in order to maintain their integrity. Most web applications are of this nature. For these kinds of applications, MySQL blows away other database engines.
But ACID features and transactions are at the very core of what constitutes a database;
No, they are not. The basic feature of a database is that it structures and stores your data for later retrieval. Transactions are tools that assist in maintaining database integrity; they are not database integrity itself. (And, by the way, MySQL supports transactions).
However, not all database applications require full ATOMicity and constraints in order to maintain their integrity. Most web applications are of this nature. For these kinds of applications, MySQL blows away other database engines
What? Most web applications do not require full atomicity and constraints to maintain their integrity? Every application requires full ATOMicity and constraints to maintain its integrity. Integrity cannot be maintained otherwise. If you are updating the data ever, full ATOMicity is required.
The basic feature of a database is that it structures and stores your data for later retrieval.
Something that stores data and retrieves it later, is called a "file." A database has a query language and failure resilience. MySQL only marginally supports SQL and does not support resilience.
Transactions are tools that assist in maintaining database integrity; they are not database integrity itself. (And, by the way, MySQL supports transactions).
Transactions are not "tools to assist" in maintaining database integrity. They are absolutely required to maintain integrity if you ever update the database.
Nice troll.
If you consider a complaint about the lack of ACIDity a "troll," then you know nothing whatsoever about databases.
Not intending to be a troll or anything. But I have heard in the past that MySQL will lose a very small fraction of it's data due to it's underlying technology ( ISAM?? or something ).
Is that still true? or has that been fixed?
Based on upvotes, Ageism is the only "-ism" Slashdotters care about and think isn't SJW
It seems to depend on how the application is presented to the customer. If you ship an application which works against "any database engine", and suggest to the customer that he might like to consider downloading and using MySQL, then you don't need a commercial licence.
If on the other hand you want to present your customer with a single install, and don't necessarily even need him to know that a tiny part of your application is an embedded database engine, then you do need a commercial licence.
There are large segments of various markets where a customer would be ever so slightly pissed off to find out after installing your application that he'd only got part of it and that he needed to fiddle around downloading and installing all sorts of other crap from other places before he had something that would actually run.
If you are updating the data ever, full ATOMicity is required.
Actually, I amend this. ATOMicity is not required if there is only one user who ever updates the data, and the database is backed up beforehand.
< waits for laughter > ummm... its a joke
< more silence > ummm... you see... he spelled PostgreSQL wrong... and postre means dessert in Spanish
< embarrased look > and Saturday Night Live did a thing about a floor wax that was also a dessert topping... a long time ago
< sigh > I guess I was reaching... never mind
< shuffles away >
Move on. There's nothing to see here.
I have never been able to tell which niche MySQL is supposed to occupy. Is there really a niche where it doesn't matter if the database is corrupted? Is there really any niche where it doesn't matter if transactional integrity isn't maintained? MySQL does not provide any recovery functionality!
MySQL is Nr. 1 within the "el cheapo" niche.
Its "everything goes" software if you do not have any budget.
Even years ago, lots of Webproviders offered Webpages with PHP+MySQL for some pocket money. You couldnt find that with PostgreSQL or MS SQL Server or similar systems. Today it is more or less the same.
I mean Data is not safe and is never safe and it wont be any saver if you have no knowledge. But getting into PHP+MySQL is easy, so you can get MySQL knowledge easy and can use it well. Not everybody can invest in experienced Database admins + Sysadmins + Programmers + Maintainers + OS/Software/Hardware.
See it this way, if you make polls on Webpages and a search engine and a Forum and stuff like that, the data has no value at all. Would you care about that data? In case you would lost some, you could install new or replay an old backup set!
Here are 3 big advantages for Beginners:
PhpMyAdmin - Idiot proof Admin-Interface to MySQL, you upload it and you run it, no SQL knowledge needed to create/delete/move a database. Good part, it became so popular that PostgreSQL benefits from PhpPgAdmin now.
New Riders, Title: MySQL, Editor: Paul Du Bois.
It makes a perfect MySQL Handbook. If I would run that MySQL company, I would license it and add it into every sold copy of MySQL.
Foxserv - WAMP for idiots, unzip and go.
I mean what more can one expect? You will need anything "save stuff" only and only if you are going to do something that you will switch on today and you want it running reliable for a long time.
Such a thing can only be archived with system and brains. I say you need so many stuff to develeop and run a Database reliable with no downtimes that you would not believe it yourself. 1 perfect Database = 1 Million USD per year.
1 MySQL Database = 1060 USD per year. 1000 USD for the amateur contractor and 5 USD/Month for the Webserver.
This is mySQL's whack-ass handicap. How the F do you insert XML in this mofo?
So, if your data model only requires an update against a single table at a time, why do you require ACIDity?
Almost no one uses fully ACID transactions. They are simply too costly. Most people use some form of optimistic concurrency to get around the costs of long-lived transactions. If you are issuing a single update/delete/insert against a single table as part of your transaction, then using MySQL without transaction support and optimistic concurrency checks is not distinguishable from doing the same thing in a database with transaction support.
And, yes, there are entire problem domains--namely most dynamic web sites--in which this form of transaction rules. MySQL is faster than any other database for these kinds of operations and makes the most sense.
And, by the way, MySQL DOES support transactions.
Wel, I like your two (especially, the one about the monitor being nicer -- I hate PostgreSQL's CLI). There are more advantages:
Anyway, there's a whole list of pros as well as cons over at MySQL's site. However, that list let out the most important thing to consider when choosing any technology: Is it the right tool for the job? Most of the time MySQL has been just fine for my needs.
-B
Ash and Hickory, straight-grained and true, make excellent bludgeons, dandy for the cudgeling of vegetarians.
Not quite. Even if only one user is updating the database at a time, if they do more than one insert/update/delete that need to be done together or not at all, then you still need transactions.
Most applications that use databases have at least one context in which more than a single table is updated at a time. You are describing a very niche usage of databases. Besides, even if only one insert is done into a single table, it is still possible to get data corruption without transactions. If your write ends up done over more than one page, then you need transactions. Also, it is possible that a page split will occur during insert or update, thus what you think is a single write ends up being multiple writes. You do not control this.
I am describing most content-oriented web sites (like /.) with dynamically driven content coming from a database. This is indeed a niche, but it is a big ass niche.
Furthermore, if most of your operations are read operations and you have a couple of multi-table writes (and thus require transactions), there are in fact ways to maintain database consistency without transactions.
Besides, even if only one insert is done into a single table, it is still possible to get data corruption without transactions. If your write ends up done over more than one page, then you need transactions. Also, it is possible that a page split will occur during insert or update, thus what you think is a single write ends up being multiple writes. You do not control this.
No, but most MySQL table types protect against this situation.
I bought this book thinking it would be a great resource for an administrator using MySQL in a production environment - My mistake. It is true that MySQL is in use by a lot of large businesses and websites, but this book does not cover issues relevant to those implementations. If you are a programmer (even a very inexperienced one) and want to learn more about using MySQL, buy this book. If you have experience with MySQL and are thinking about using it in a heavy traffic production application, this book is useless to you. Stick to the docs on the MySQL site.
You are correct that it is better to minimize the data IO needs of an application. And stored procedures will definitely resolve this issue. The problem is that you have to use a stored-procedure language to take advantage of SPs :)
I have mostly suffered with PL/SQL (courtesy of Oracle) and I dread having to work with it. The syntax is awkward. The error messages aren't very good. And since PL/SQL is proprietary I cannot port my code without significant work.
If your app is multitier then you can always stick the business logic server on the same machine as the DB to save network IO. And you get to write your business logic in any language you want.
Dude where's MySQL?
Here are some alternative lyrics to the song YMCA that I came up with:
q l.htmlr eign_Key s.html
Verse:
Transactions, no they're not in the spec
Procedures, and let's not forget
Triggers, Monty says we must not let
Foreign keys into the feature set
Chorus:
This lightweight database...
MY - S - Q - L It has the tables locked
MY - S - Q - L
Well it's fast and it's free, but you surely must see
it doesn't pro-vide a-tom-icity
MY - S - Q - L It's not relational
MY - S - Q - L
You can do a SELECT but it's less than perfect
You can't gar-un-tee in-tegrity.
Works cited:
http://openacs.org/philosophy/why-not-mys
http://www.mysql.com/doc/A/N/ANSI_diff_Fo
http://www.pgro.uk7.net/innodb1.htm
Sheesh... have you even seen the average web application?
Most of them don't even index their search columns or check their return codes. Look around -- see all of the counters, polls, message boards, Slash clones, and more? It's not hurting them much. They don't use the tools they have; do you really believe they'd use data integrity tools if they had them? Of course not.
As long as it works properly in normal circumstances and fails gracefully in exceptional events, that's 'good enough' for 99+% of the tasks out there. No, it's not enough for eTrade, but there are other tools for them.
If you had to pick only one book for each of the following technologies, which would you pick for someone who has taken a Linux 1 class, a Unix 1 class, and has a basic understanding of the command line, DOS, Linux, Unix, etc. (I have several web sites running on Apache currently serving static pages, have been able to edit/configure the Apache config file, and have compiled my own kernel, but haven't been able to get virtual hosting to work, and using an old computer as a diskless terminal is a little beyond my capabilities right now, as examples of my abilities):
These are the technologies I need to purchase one (and only one for now) book.
MySQL
PostgreSQL (downloaded an online book a while ago, any other suggestions)
PHP (I have Sam's 24 hour PHP book)
Perl (I have Programming Perl 2nd edition, a little too technical for me right now)
Apache
Any suggestions would be greatly appreciated. Thanks.
logical dat corruption dut to lack of transactions
HUGE
Excellent. We'll show the pathetic CLIT who's boss!
Eat it and eat it hard, CLIT!
The CLIT showed their lameness by not getting first post. Don't make it worse for them.
There have been several intelligent replies to this post already, but no concise summary, and there may still be people out there confused about the issue.
Stored Proceedures are a method of associating functionality with a database in such a way that the database server itself manages the operation of the code. The proceedures may be invoked manually via an SQL statement, or automatically via a trigger.
It is a given that any moderately advanced database application will have some operations which by design need to be close to the data, from the managerial and I/O views.
The salient question is whether a particular design is best served by putting the database server in charge of the proceedures, or by running them in a layer above the database. This upper layer may in fact be on the same machine, and it may be the only object which has direct access to the database. In this case, it would appear to other applications to be the same either way. They make a request, and "stuff happens" that they don't need to worry about.
At this point the answer to the question depends on very specific design requirements of the database and the upper layer. There is no general right answer! In any a "mission critical" enviornment stored proceedures may be prefered because changes to the data structures and code may be tied together more easily. In a "low end" environment, the benefits may be negligable.
I will go out on a limb and propose that if you don't know if you need them, you don't need them. I will also suggest that if you think you "can't" do without them you are probably wrong.
This entire discussion comes down to The Right Tool For The Job, and There's More Than One Way To Do It. It's an important discussion, but no more important than Which Programming Language(s), Which Standard Library, CORBA vs SOAP vs COM, or even UDP vs TCP.
Anyone with a personal stake in the discussion is needlessly burning energy on what often comes down to Academic Wanking.
Thankyoupleasedrivethrough.
I have been using MySQL longer than MS SQL Server, and trust me, I'm forced to use MS SQL Server at work; for my own projects, MySQL is my choice. It's just so damn easy, efficient and not filled with filler like MS SQL.
That's my two cents.
"MySql and PERL for the Web" by Paul DuBois. You can have an Apache/Perl/MySql application up and running with the bare minimum experience. Although that may be dangerous. http://www.kitebird.com/mysql-perl/
pronoblem
smack.addict wrote: 'Nice troll. Of course there is no such niche. However, not all database applications require full ATOMicity and constraints in order to maintain their integrity. Most web applications are of this nature. For these kinds of applications, MySQL blows away other database engine'
Squeaking of Trolling George, shouldn't you let folks know up front when you're posting messages about your own book?
http://slashdot.org/~smack.addict/
http://www.imaginary.com/~george
http://safari.oreilly.com/main.asp?bookname=msql2