Andrej Koelewijn

  • Home
  • About
  • Departments
    • cloud
    • java
    • mobile
    • open standards
    • oracle
    • oss
    • other
    • soa
    • software development
    • tablet
    • Uncategorized
    • web
  • Subscribe via RSS

SQL is a DSL

October 27th, 2008  |  Published in oracle  |  9 Comments

Sometimes it seems like programmers will do everything to avoid SQL. At the same time DSLs (Domain Specific Languages) are very popular. If DSLs are so great, why are you trying to avoid SQL? Or procedural extensions to SQL? SQL is a DSL for dealing with relational data.

SQL was invented to deal with relational data, there aren’t many better, easier and faster ways to deal with large amounts of data stored in a relational database. Seriously, databases are made to handle large amounts of data. To sort it, to filter it, etc. Trying to do that in another language, or even worse, in another layer, makes no sense. It’s really expensive to move the data from the database into your middleware layer, and Java (or any other middleware language) isn’t really a good language to sort and filter large amount of data.

Procedural extensions to SQL, like for example Oracle’s pl/SQL, are even worse off. It seems like middleware programmers will do everything not to have to use a procedural language in the database. But fact is that pl/sql is a very good tool to write data heavy business logic in. There is no faster way to handle large amounts of data, then right there in the database. And there is no easier way to write data heavy procedural code than using a procedural extension to SQL. That is what pl/sql is: a DSL for writing data centric logic.

Added bonus: anything in the database is extremely reusable. Almost every language has a library which allows you to make use of relational databases. So, if you put it in the database, no matter what middleware or frontend language you’re going to use in the future, your data centric logic can be reused.

Share and Enjoy:
  • del.icio.us
  • Google Bookmarks
  • DZone
  • SphereIt
  • StumbleUpon
  • Technorati
  • LinkedIn
  • HackerNews
  • PDF
  • Digg
  • Facebook
  • FriendFeed
  • Posterous
  • Tumblr
  • Twitter
  • RSS

View Comments

Feed Trackback Address
  1. Igor says:

    October 27th, 2008 at 8:56 pm (#)

    I absolutely agree with you. For some reason SQL got a bad rap among Java developers. Apparently it’s not object-oriented enough.

    Existing frameworks promise to shield Java developers from SQL which is a shame and produces some monstrously inefficient applications.

    I believe that database and SQL queries and stored procedures are the most long-lived part of the application. Business logic that uses it would change more frequently and UI has the shortest live span.

    From this perspactive, I think the tools and developers that approach database design from Java side are doing it backwards.

  2. Toon says:

    October 30th, 2008 at 9:18 am (#)

    Well said. There is hope still.

  3. Jan says:

    November 20th, 2008 at 10:13 am (#)

    Off course you are right provided that a customer does have Oracle’s RDBMS to start of with. In a scenario where it is unclear or uncertain what the actual database platform will be – for instance for standard applications that want to provide functionality instead of just serving data – staying away for vender specific SQL (like non-standard JDBC types, and procedural extensions) is a good thing.

    In cases where the database *is* Oracle’s RDBMS I don’t have a problem using Oracle’s extensions like PL/SQL as long as it is only data related.

  4. Friendfeeds usage of mysql: schema-less :: Andrej Koelewijn says:

    April 6th, 2009 at 9:44 pm (#)

    [...] into a middleware language is any better than locking yourself into a database language. Afterall, why not use a data oriented DSL for data related tasks? Share and [...]

  5. William Vambenepe’s blog » Blog Archive » “Federationing” says:

    April 7th, 2009 at 9:50 am (#)

    [...] level (i.e. in the same physical store, with shared access control, accessible using a well-known DSL for data manipulation…). Metamodel transformation and model bridging are costly (in accuracy, maintenance, [...]

  6. Robert Young says:

    April 20th, 2009 at 5:51 pm (#)

    Java, web, KiddieKoders are stupid. full stop. They write COBOL, in lower case, and are convinced they are doing something new and different. They iterate through a lump of data just as COBOL coders do through a copybook. They should be strung up by their heels and flogged.

  7. SQL Tutorials says:

    May 1st, 2009 at 3:33 am (#)

    Does anyone know if there is another language or set of commands beside SQL for talking with databases?

    I’m working on a project and am doing some research thanks

  8. SQL Tutorials says:

    May 1st, 2009 at 3:56 am (#)

    You know, the thing about SQL is, that there is virtually nothing that can replace it.

    Does anyone know if a substitute exists for sql? I mean besides MS SQL and Oracle and all that jazz. Thanks.

  9. akoelewijn says:

    May 1st, 2009 at 6:13 am (#)

    This article mentions some alternative query languages: Web and Semantic Web Query Languages: A Survey .

Leave a Response

blog comments powered by Disqus

Tags

bi bpel camel cep css dsl esb esper google governance grails groovy gtalk html5 innovation internet ipad ivy java javascript jaxrs jersey jigsaw jquery linkeddata linux maven middleware mule noiv openoffice openweb oracle osgi oss plsql rdbms rest soa sql sun tablet web 2.0 xmpp yql

Archives

  • August 2010
  • June 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Recent Posts

  • Nice Java Decompiler tool: JD
  • VMware Player: The virtual machine is busy.
  • Adding a maven repository for installing features to ServiceMix
  • Upgrade Apache Camel in ServiceMix to version 2.3.0
  • A composite Rest service using Apache Camel

Categories

  • cloud
  • java
  • mobile
  • open standards
  • oracle
  • oss
  • other
  • soa
  • software development
  • tablet
  • Uncategorized
  • web

Recent Comments

  • Buddhika on Using google talk from java example
  • Anonymous on A composite Rest service using Apache Camel
  • Guest on How to find true cause of com.sun.star.uno.RuntimeException?
  • Absent Code attribute in method that is not native or abstract « Gooder Code - web development blog, php, java, asp.net, html, javascript on Absent Code attribute in method that is not native or abstract
  • Rmfume on Oracle best thing that could happen to JavaFX?
Buzz
andrkoel: RT @monkchips: James Governor's Monkchips » Day of The Dead: Web Drives Strong Demand for Java Skills http://monk.ly/d4UlND
59 minutes ago, comment
andrkoel: RT @monkchips: In which my business partner @sogrady explains Why You Should Pay Attention to Node.Js http://monk.ly/a4aGIP serverside # ...
7 hours ago, comment
andrkoel: RT @stilkov: http://bit.ly/cDdqgl - AWS Identity and Access Management — I'd hate to have to compete against Amazon's Cloud offerings
13 hours ago, comment
andrkoel: Twitter for ipad is nice, but i still think i need a tool to summarize all info, something like feedly or flipboard is the future
8:36 AM Sep 02, 2010, comment
andrkoel: Trying out the new twitter for ipad... Curious how the panels work.
8:32 AM Sep 02, 2010, comment
 


©2010 Andrej Koelewijn
Powered by WordPress using the Gridline Lite theme by Graph Paper Press.