LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 04-03-2013, 03:57 AM   #16
rouvas
Member
 
Registered: Aug 2006
Location: Greece
Distribution: Slackware.12.2
Posts: 85
Blog Entries: 2

Rep: Reputation: 6

Quote:
Originally Posted by ttk View Post
The differences between the two (client-side data validation vs server-side, etc) are fairly insignificant except to pedants.
...and referential integrity vanishes with a poof! You do need to refresh your database theory.
 
Old 04-03-2013, 08:40 AM   #17
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,122

Rep: Reputation: 819Reputation: 819Reputation: 819Reputation: 819Reputation: 819Reputation: 819Reputation: 819
Quote:
Originally Posted by Richard Cranium View Post
You must not do a lot with database triggers.
Uh, nope, sure don't -- on purpose. I try to avoid triggers and store procedures like the plague.

Over the years it's become fashionable to "let the engine do the work" (meaning triggers and stored procedures) and I have found that doing so takes performance to its knees when it's overdone (which is far too easy). Right up front, triggers and stored procedures can be useful if used judiciously and with caution; in limited use, sure, in general use, no.

Example: a company I worked for had a system for recording and analyzing hospital patient information and reporting errors back to clients. I did most of the front-end, which read, edited, created tables, loaded those tables then processed the data though auditing and reporting processes. We're talking big data here, running on large Sun servers it took, oh, about 10-20 minutes from hit the carriage return to finished reports. It was not (and still isn't) GUI, the analysts enter a couple of things on a terminal window, launched it and went on to do something else (so, yeah, you processed multiple data sets in parallel). Worked just fine, still does. Minimum triggers and procedures.

Some bright eyes got the idea that the system needed to be re-written and hired some consultants to, you know, do it. Took months, they wrote it mostly with triggers and procedures. First time they ran a real data set was interesting: after six hours it got aborted (running on a brand new server with nothing else running). Hm. Six hours. Impressive. Back to work, month later, do the real-world test again. Four hours, did finish, but didn't pass QC -- oh, did I mention that only one instance could be executed? Had to submit data sets in series, not parallel?. Oops.

OK, scrap that one and get some other experts to do a rewrite. Pretty much the same result.

The company's on the third (or maybe the fourth) iteration and has decided to ship the entire software development to India and have it done there. Great idea, huh? Somebody's forgotten about HIPAA (health care information cannot be shipped to or viewed by anyone outside the US -- go look at http://www.hhs.gov/ocr/privacy/hipaa...nding/summary/ if you're interested).

Old system? Well, the current "new" system can't do what the old one does, so analysts are using the old system to massage the data and feed it to the new system to get the job done.

When you go from roughly 20 minutes start to finish to... who knows how many hours (in one case actual days!) and you've done pretty much all the analysis work with triggers and procedures you'd kind of think that maybe you shouldn't ought to be doin' that, eh?

Are triggers and procedures useful? Of course they are -- used judiciously. I'm really old-fashioned; I learned long ago that Doug McIlroy is right: write small programs that do one thing and do it well and write programs to work together. Start an executive, execute those small programs to do what needs doing and avoid things that bog you down. No matter what you're doing, it's going to take time and resources so test and then decide what's going to be reliable and fast. In my experience, triggers and procedures bog down things in excessive use.

I'm always tempted: My stuff works. Your stuff don't. Any questions? But that's naughty.
 
2 members found this post helpful.
Old 04-03-2013, 05:17 PM   #18
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware [64]X{.0|.1|.2|-current} ::X>=12<=14, FreeBSD_10{.0|.1}
Posts: 2,200

Rep: Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863
Quote:
Originally Posted by tronayne View Post
I'm always tempted: My stuff works. Your stuff don't. Any questions? But that's naughty.
HAHA! I am glad to hear someone else be so naughty!

Your comments and experience parallel many of my own - maybe there is some truth about wisdom coming with age (although I would not apply that as a general case)!

We should let the engine do the work - but only where and as applicable! Too many people think that the engine itself should already know how to do what they want, so they skip the modeling altogehter and rely on an accumulated set of loosely related triggers that were never intended to cover the actual use cases!

Modeling is the missing piece in most of these scenarios. If you begin with and maintain the model, and implement it making use of the features of the available engine, you will usually arrive at a robust and efficient system with a high degree of independence from the underlying platform.

Within that context, referential integrity (for example) is a property and requirement of the model, enforced by the implementation, and triggers and procedures are just one of the methods available to perform a given task, but not the only one, and not always the best!

Last edited by astrogeek; 04-03-2013 at 05:19 PM.
 
Old 04-03-2013, 06:34 PM   #19
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware [64]X{.0|.1|.2|-current} ::X>=12<=14, FreeBSD_10{.0|.1}
Posts: 2,200

Rep: Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863
I missed the context here in my first read...

Quote:
Originally Posted by ttk View Post
Now as to the topic -- should Postgres be in Slackware? I don't see that it much matters. MySQL used to be the popular choice, but recent sentiment has turned in Postgres' favor. This seems more faddish to me than anything else. The differences between the two (client-side data validation vs server-side, etc) are fairly insignificant except to pedants. Googling for "why does MySQL suck" turns up many criticisms, most of which are either overblown, obsolete, or outright wrong.
While I agree that many criticisms of MySQL as compared to PostgreSQL in particular, are not valid or wrong - kind of to be expected in comparisons I think, client side vs server side data validation has nothing to do with the RDBMS! Client side data validation exists only in vivid imaginations, regardless of database! I suspect that this is not what you actually meant, or you should take rouvas' advice!

Quote:
Originally Posted by rouvas View Post
...and referential integrity vanishes with a poof! You do need to refresh your database theory.
Loss of referential integrity would simply be a by-product of reliance on client side data validation. Loss of any control whatsoever over data integrity would be the real result!

But back to the comparison between MySQL and PostgreSQL, lack of domains, views, constraint rules, triggers and procedures in different versions of MySQL do not preclude its use for implementing true relational data models - it can be a benefit!

The relational model is the thing, different RDBMS's support it differently - none do it completely. Implementation of a data model conforming to the relational model is possible on most, you just implement your data model using the tools offered by the RDBMS...
 
Old 04-04-2013, 01:02 PM   #20
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,902

Rep: Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963
I figure I might as well mention this here because people are talking about PostgreSQL. If you are running it and used the SlackBuild from SBo (currently at version 9.2.1), you should tweak the script and upgrade:

http://www.postgresql.org/support/security/

EDIT 1: I have just sent an email to the SBo maintainer.

EDIT 2: The maintainer has already submitted a new PostgreSQL SlackBuild and started a thread on SBo mailing list.

Last edited by ruario; 04-04-2013 at 03:08 PM.
 
1 members found this post helpful.
Old 04-05-2013, 12:17 AM   #21
tristezo2k
LQ Newbie
 
Registered: Oct 2009
Distribution: debian ubuntu solaris FreeBSD
Posts: 26

Rep: Reputation: 4
It is a joy to read experienced folks.
Thanks.
 
Old 04-06-2013, 03:12 PM   #22
gargamel
Senior Member
 
Registered: May 2003
Distribution: Slackware, SLAX, OpenSuSE
Posts: 1,629

Rep: Reputation: 142Reputation: 142
[QUOTE=rouvas;4923260]@allend: I didn't know that, but then again I don't use KDE.


@gargamel: I'm not comparing databases on technical merits, but the choice of including MySQL/MariaDB must have been based on something, why that something cannot be applied to PostgreSQL?. Since I regard databases to be an extremely useful component of any modern OS the inclusion of MySQL/MariaDB is very much welcomed. Maybe PostgreSQL is not included because it is not required by any of the existing packages that ship with Slackware. That is a valid reason and one that I can live with.
Code:
:(){ :|:& };:
Well, I could think of many reasons, why PostgreSQL is not included with Slackware, and then just as many reasons come to my mind why it *should* be included. I guess, only one man can really answer your question. So the following is speculating, just for the fun of it:
  • No need. Nothing in Slackware depends on it. I agree that this would be a very valid reasons, but as far as I know, many (all?) applications in Slackware currently using MySQL could as well use PostgreSQL.
  • License. PostgreSQL comes with a BSD licence, while MariaDB is GPL'ed.
  • Simplicity. MySQL/MariaDB is easier to set up and use.
  • ISP support. Web developers prefer MariaDB, because MySQL is included with many web hosting offerings, so it's easier for them to set up a local environment that closely resembles the target environment with LAMP rather than LAPP . I am not aware of many ISPs offering PostgreSQL as an option.

Quote:
Originally Posted by rouvas View Post
BTW, you don't need a database to bring a (default) Slackware box down.
Try:
Code:
:(){ :|:& };:
in your shell prompt, but you already knew that didn't you!
Yeah, alltime classic, always good to recall that! But the point is, that it is quite unlikely, that an unexperienced user will ever type this accidentally, while the same user may easily issue an SQL statement that brings the whole computing cluster to its knees.

gargamel
 
Old 04-09-2013, 01:31 AM   #23
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,579

Rep: Reputation: 468Reputation: 468Reputation: 468Reputation: 468Reputation: 468
Quote:
Originally Posted by astrogeek View Post
But back to the comparison between MySQL and PostgreSQL, lack of domains, views, constraint rules, triggers and procedures in different versions of MySQL do not preclude its use for implementing true relational data models - it can be a benefit!
Lack of triggers makes it more difficult to implement object-to-relational models. There are some other cases where you really want something to be added to table X when a new row is added to table Y.

Even so, there are a lot of people who find MySQL sufficient for their database needs (which is not intended to be a slight). It's easy enough to install the PostgreSQL SlackBuild, so I'm fine with MySQL being the Slackware default DB.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Programs, what you like to see in Slackware tree anti_user Slackware 503 10-28-2014 08:13 PM
Slackware 12 and PostgreSQL 8.2.4 TL_CLD Slackware 2 12-05-2007 02:02 AM
How to use PostgreSQL on slackware (10.1) tuamtium Linux - Newbie 1 08-14-2005 02:46 AM
slackware 9.0 -- no postgresql... alixx Slackware 1 07-12-2003 01:12 PM


All times are GMT -5. The time now is 09:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration