13.07.2015 Views

Software Engineering for Internet Applications - Student Community

Software Engineering for Internet Applications - Student Community

Software Engineering for Internet Applications - Student Community

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

OraclePerlnamed XYZ" without the programmer having to know howmany disk drives the computer has or what companymanufactured those drives. Examples of operating systemsare Unix and Windows XP. Examples of things that try to beoperating systems but mostly fail to fulfill the "coexistpeacefully" condition are Windows 98 and the MacintoshOS.Oracle is the most popular relational database managementsystem (RDBMS). It was developed by Larry Ellison'sOracle Corporation in the late 1970s.Perl is a scripting language developed by Larry Wall in 1986to make his Unix sysadmin job a little easier. It unifies abunch of capabilities from disparate older Unix tools. LikeUnix, Perl is perhaps best described as "ugly but fast anduseful". Perl is free, has particularly powerful stringprocessing operators, and quickly developed a largefollowing and there<strong>for</strong>e library <strong>for</strong> CGI scripting. For moreinfo, see www.perl.com or www.perl.org.Historical Note: Lisp programmers <strong>for</strong>ced to look at Perlcode would usually say "if there were any justice in thisworld, the guys who wrote this would go to jail." In a rarecase of Lisp programmers getting their wish, in 1995 IntelCorporation persuaded local authorities to send RandalSchwartz, author of Learning Perl (O'Reilly 2001), to the BigHouse <strong>for</strong> 90 days (plus 5 years of probation, 480 hours ofcommunity service, and $68,000 of "restitution" to Intel).Sadly, however, it seems that Schwartz's official crime wasnot corrupting young minds with Perl syntax and semantics.Most Unix sysadmins periodically run a program called"crack" that tries to guess user passwords. When crack issuccessful, the sysadmins send out email saying "yourpassword has been cracked; please change it to somethingharder to guess." Obviously they do not need the passwordssince they have root access to all the boxes and can readany of the data contained on them. At a university, you getpaid about $50,000/year <strong>for</strong> doing this. In Oregon if you dothis <strong>for</strong> a multi-billion dollar company that has recentlydonated $100,000 to the local law en<strong>for</strong>cement authorities,you've committed a crime. Seehttp://www.lightlink.com/spacenka/<strong>for</strong>s/ <strong>for</strong> more on State ofOregon v. Randal Schwartz.12:45PM1:30PMusage summary arrives at User --#356712; Oracle reaches intorollback segment and pulls out"joe@foobar.com" <strong>for</strong> the report,since that's what the value was at12:30 PMusage summary report completes --"joe@yahoo.com"How would this play out in Microsoft SQL Server? When you'rereading, you take read locks on the in<strong>for</strong>mation that you're about toread. Nobody can write until you release them. When you're writing,you take write locks on the in<strong>for</strong>mation that you're about to update.Nobody can read or write until you release the locks. In the precedingexample, User #356712 would submit his request <strong>for</strong> the addresschange at 12:30 PM. The thread on the Web server would beblocked waiting <strong>for</strong> the read locks to clear. How long would it wait? Afull hour with a spinning/waving "browser still receiving in<strong>for</strong>mation"icon in the upper right corner of the browser window. If you'rethoughtful you can program around this locking architecture in SQLServer but most <strong>Internet</strong> service operators would rather just installOracle than train their programmers to think more carefully aboutconcurrency.The open-source purist's only realistic choice <strong>for</strong> an RDBMS isPostgreSQL, available from www.postgresql.org. In some ways,PostgreSQL has more advanced features than any commercialRDBMS and it has an Oracle-style multi-version concurrency system.PostgreSQL is easy to install and administer but is not used byoperators of large services because there is no way to build a trulymassive PostgreSQL installation or one that can tolerate hardwarefailures.Most of the SQL examples in this book will use Oracle syntax. This ispartly because Oracle is the world's most popular RDBMS but mostlybecause Oracle is what we had running at MIT when we startedworking in this area back in 1994 and there<strong>for</strong>e we have whole filesystems full of Oracle code. Problem set supplements (see end ofchapter) may contain translations <strong>for</strong> ANSI SQL databases such asMicrosoft SQL Server and PostgreSQL.32227

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!