Jump to content

Archive for the ‘Open Source Tools’ Category


Oracle/Sun not off to a good start with open source

Thursday, July 29th, 2010 by Jim Mlodgenski

Hot off the heels of Oracle stopping the PostgreSQL build farm servers for Solaris, Oracle released an automatic update for Java that rebrands the company name from Sun to Oracle which had the cascading effect of breaking Eclipse.

While I don’t think this is some sort of coordinated plan by Larry to bring down open source in general, I think this is indicative of the pain of integrating Sun in to Oracle and we can expect more of this in the future. On the positive side, I think the reactions by the PostgreSQL and Eclipse communities really highlight the power of the open source process. In both cases, the communities had solutions quickly in the wake of the mess created by Oracle.

Oracle/Sun not off to a good start with open source



Scala PostgreSQL Access

Thursday, July 8th, 2010 by Jim Mlodgenski

Recently, I’ve been digging into Scala to understand how PostgreSQL would integrate inside of Scala code. Scala is an interesting language which runs on the JVM like Java but eliminates much of the Java boiler plate code increasing the productivity of developers. With many of the knowledgeable Java programmers advocating Scala and large success stories like Twitter becoming more common, there is a possibility that one day Scala will unseat Java and the dominate enterprise programming language in the future. Given this possibility, it is encouraging that PostgreSQL is respected in the Scala community, but unfortunately, what I’m finding, database persistence in general is still appears to be immature inside of Scala. There is an early module called DBC that attempts to provide database connectivity, but this initial attempt was lacking. Below is an example of running a simple query which I find very awkward:

object MainDBC {

  import scala.dbc._
  import scala.dbc.Syntax._
  import syntax.Statement._

  def main(args: Array[String]): Unit = {
    val db = database("jdbc:postgresql://localhost/scala","postgres","password")
    val res = db.executeStatement {
      (select fields (("pgbench_tellers.tid" of integer)
                  and ("pgbench_tellers.bid" of integer)
                  and ("pgbench_branches.bbalance" of integer))
         from "pgbench_tellers, pgbench_branches"
        where "pgbench_tellers.bid = pgbench_branches.bid")
    }

    println(" tid   bid   bbalance")
    println("----- ----- ----------")
    for(val i <- res) {
      for(val f <- i.fields) {
        val r = f.content.sqlString
        print(r + "      ".dropRight(r.length))
      }
      println()
    }
  }
}

There are a number of object layers available that may be much easier to use, but the nice thing about Scala running on the JVM is that you can leverage the low level JDBC interface and eliminate much of the awkwardness. Below is an example of the same query but using JDBC.

object MainJDBC {

  import java.sql.{Connection, DriverManager, ResultSet}

  def main(args: Array[String]): Unit = {
    classOf[org.postgresql.Driver]
    val db = DriverManager.getConnection("jdbc:postgresql://localhost/scala","postgres","password")
    val st = db.createStatement

    val res = st.executeQuery(
               "SELECT pgbench_tellers.tid, pgbench_tellers.bid, pgbench_branches.bbalance" +
               "  FROM pgbench_tellers, pgbench_branches " +
               " WHERE pgbench_tellers.bid = pgbench_branches.bid")

    println(" tid   bid   bbalance")
    println("----- ----- ----------")
    while (res.next) {
        for(val i <- 1 to res.getMetaData.getColumnCount) {
          val r = res.getInt(i).toString
          print(r + "      ".dropRight(r.length))
        }
        println
    }
    db.close
  }
}
Scala PostgreSQL Access



Give Me My Own Cloud

Thursday, February 25th, 2010 by Jim Mlodgenski

I’ve recently attended several Cloud Computing forums and panels, and the general feeling throughout most of the audience has been that the promise of Cloud Computing sounds great, but many organizations are still apprehensive about moving to a public cloud such as Amazon’s EC2. This is understandable given security concerns and just the general feeling of a lack of control, so the concept of private clouds  becomes a great solution. It allows organizations to use the power of Cloud Computing without ever leaving the friendly confines of their own data center. There are many products that enable this such as VMWare’s vShere and the open source product Eucalyptus with many more on the way. When you look at this architecturally, this really is the next generation of virtualization giving administrators more power to efficiently use their physical resources.

The other interesting trend was the types of applications organizations are considering for use in the cloud. While there is much talk about replatforming existing application onto Cloud Computing infrastructures, many organizations seem to people getting their feet wet with new applications. They seem to be fairly traditional applications and not leveraging the elasticity of the cloud and they are just leveraging the financial benefits of not needed to procure new hardware. This trend show a lot of great promise for PostgreSQL given that Oracle does not have a favorable licensing model in virtualized environments. While Oracle is expensive in traditional environments, much of the cost benefits are eroded when Oracle is needed in a cloud environment. This is leading many people to open source solutions and PostgreSQL is a natural fit for many Oracle users.

Give Me My Own Cloud



Automating Cloud Deployments

Monday, February 1st, 2010 by Jim Mlodgenski

One of the promises of Cloud Computing is the ease of spinning up new instances and adding them to an existing application allowing for elasticity, but actually doing that in practice is anything but simple. Increasing the complexity would be adding another dimension of wanting to accomplish this across multiple cloud vendors. This is important for some SAAS vendors that want redundancy or just for organizations wanting to avoid vendor lock-in. An open source project by Red Hat called DeltaCloud shows the promise of on day allowing this, but the functionality of actually configuring a running instance is not addressed. RightScale has a number of Ruby Gems that addresses the same problem as DeltaCloud, but again, it falls short on configuring a running instance. These two projects will probably progress together since DeltaCloud actually uses the RightScale Gems under the covers.  A project that handles configuring running instances well is Cloud Tools which powers Cloud Foundry for SpringSource. Cloud Tools provides a simple way to configure running instances in complex deployments which even includes setting up replication between 2 database servers. The downside is that it only works for Amazon’s EC2. Since all of the projects are open, jamming them together could be a powerful combination and may be necessary as cloud deployments become more complex across providers.

Automating Cloud Deployments



More SQL Injection Attacks

Friday, December 4th, 2009 by Jim Mlodgenski

This summer had some high profile hacks using SQL Injection attacks, but apparently this has not spurred a focus on locking down those holes in other websites. Last month, hackers where able to cause power outages in Brazil by using a SQL Injection attack. And just this week, the Wall St Journal was hacked.

These attacks will lead to more technological innovation in the ever growing security arms race. Just yesterday, GreenSQL released a new version of their database firewall that supports PostgreSQL. While database firewall technology is an effective tool in preventing SQL Injection attacks, it may not be a viable option in many situations. Many application rely heavily on the performance and scalability of the database engine and adding a layer of complex processing between the application and database has its drawbacks. The innovation still needs to progress before SQL Injection attacks become a lot less common place in the wild world of the internet.

More SQL Injection Attacks



How to Install Postgres Binaries (in One Click)

Tuesday, November 3rd, 2009 by Scott Mead

In the Linux world, many people have come to rely on (for better or worse) their distribution package management. Personally, I feel that until this is fixed, Linux will never be a mainstream desktop OS. The problem with using your OS package manager for installing Postgres is that there are no real consistency guidelines from vendor to vendor. How do we get around this problem? Simple!

(more …)

How to Install Postgres Binaries (in One Click)



Ccache Usage

Friday, August 21st, 2009 by Bruce Momjian

I have heard good things discussed for the past few years about using ccache to speed compiles of Postgres. I finally got time to test it and saw my Postgres compile times drop from three minutes to one minute. Supposedly ccache always produces the same result as a normal compile (including any compiler warnings), so I plan to use it from now on.

Ccache Usage



Quick and Powerful Database with OpenOffice.org and Postgres

Sunday, July 26th, 2009 by Scott Mead

Unless you’ve been living under a rock for the past 3 years, you’ve heard of OpenOffice.org.  Like most people, I’ve used the software a few times to edit some documents and haven’t really given much thought to it.  During one of my last plane trips, I decided that the small database I keep (in PostgreSQL) needed a facelift, err, well, a face actually.  I built the database completely on the CLI with the postgres ‘psql’ utility and all my access to it is via the CLI.  This is nice, but I figured that there had to be something easier.  I fired up OO.org and started a ‘New Database’ just to see what was possible.  The first screen up gives us the option:

Connect to existing DB via JDBC

I was immediately beside myself with excitement, if OpenOffice base had the ability to draw forms like MS Access, and will let me hook it up to my existing postgres DB, then I may be done with an interface before the flight deck signals ‘initial approach’.

(more…)

Quick and Powerful Database with OpenOffice.org and Postgres



Reverse Engineering

Thursday, July 23rd, 2009 by Jim Mlodgenski

Recently, I have been digging into JPA to get a better understanding of how Hibernate and Toplink implement the API. Instead of hand coding all of the entities and the controllers, I tried using the reverse engineering facility in Netbeans 6.7 to get started. This was fantastic when working with a single table, but as soon as I tried a more complex schema it was not magic any more. I used an existing schema that was essentially a star schema with a single fact table and about 10 dimension tables. The issue was not the number of tables but rather the foreign key constraints relating all of the tables. The result was that the resulting code had multiple mappings for the key columns in each dimension table. This was easy to fix by simply deleting some lines of code, which took only a few minutes.  Overall, it was pretty impressive that one could generate a web based, AJAX enabled CRUD application in less than 10 minutes. This is an appealing aspect of layering a JPA implementation over a database, but the resulting application is far from a scalable use of database resources. In many cases, that is irrelevant and the time saving outweighs the extra database overhead, but when writing an application that needs to scale going old school and writing the SQL directly will give better results.

Reverse Engineering



Connect
About the Bloggers
Search

You are currently browsing the archives for the Open Source Tools category.