Free Newsletters

   All InfoWorld Newsletters
Strategic Developer | Martin Heller » TAG: Databases

May 06, 2008 | Comments: (0)

Rails, and now Java, in the cloud

I had a conversation today with David Abramowski, CEO of Morph Labs. We were supposed to talk about how Morph Application Platform, which uses Amazon EC2 and S3 for on-demand cloud computing and storage along with its own routing and provisioning infrastructure, compares with Google App Engine, which uses Google's own cloud infrastructure. That part of the conversation was short, though, because beyond the fact that they're both on-demand cloud computing platforms, the two have nothing in common. I was put in mind of Shakespeare sonnet 130, My mistress' eyes are nothing like the sun.

Google App Engine, as I've discussed previously, currently supports only Python for an implementation language and BigTable for a (join-less) database, with Django and a simpler Python Web framework developed at Google both on offer to structure a Web application. I can't yet speak to what deployment is like on Google App Engine, as I signed up too late to get into the beta.

Morph currently uses Ruby on Rails as its framework, and PostgreSQL as its database. Today's announcement at JavaOne was for a beta release of Morph Application Platform for Java, developed in collaboration with Webtide. Abramowski expects the beta to fill up in a couple of days.

I was actually more interested in the Ruby version of the Morph Application Platform than the Java beta for my own projects. I've signed up for a free developer account. I've run into a snag subscribing to the DevCenter service that will let me access an "AppSpace," but I imagine that will be fixed before long, and I'll be able to say something about the service first-hand. It almost has to be better than the Rails hosting experience I had at TextDrive, now called Joyent.

Meanwhile, two user quotes from the Morph Web site:

"Morph is a great service. Deployment is simple. I give them lots of points for ease of deployment. They can help you scale as they are using Amazon's services on the back end."

- Justin Ball from www.justinball.com

"Morph AppSpace is the best experience we've ever had for Rails deployment. We can scale to as many app servers as we want in minutes, and then scale back as demand changes. We are also happy about the effortless deployment and the amazing client support. The Morph guys were helpful before, during, and after. From now on, we'll be using Morph AppSpace in releasing all our new applications."

-Jim James, www.mytripscrapbook.com

Posted by Martin Heller on May 6, 2008 01:03 PM



March 18, 2008 | Comments: (0)

Alpha Five Platinum looks useful for enterprise development

I mentioned last Thursday that I'd had a visit and product demo from Richard Rabins of Alpha Software. I was initially hesitant to take this meeting at all, because I remembered Alpha Five from the 1980s: it was essentially an easy-to-use variation on dBase II. I couldn't imagine any of my readers being interested in a product that depends on DBF files, no matter how easy it is for the developer.

What changed my mind is that Alpha Five Platinum, a.k.a. Alpha Five Version 9, supports working with SQL databases from the desktop, using active-link tables. For that matter, it can perform heterogeneous joins, with the relations between the heterogeneous tables enforced on the client. It uses optimistic record locking when working with active-link tables to avoid holding unnecessary server locks, and has a query optimizer that decides what filtering and sorting can be done on the server.

The quick overview of the Alpha Five product, according to the company, is that it is "software for building desktop and web database applications - applications that include report writing, intelligent email, web connectivity, backend database access, data browsers and security." The company goes on to say:

Alpha Five is "beginner friendly." You can define and manage databases — and create complete applications without programming. With Alpha Five's Action Scripting, Genies, and point-and-click interface you focus on building your solution, not on the programming details.

Professional developers benefit from Alpha Five's Xbasic language. You can create user defined functions and integrate external software libraries. Thousands of functions are included.

My enthusiasm for learning yet another computer language was extremely limited, but Xbasic and Xdialog both turned out to be easy and well-documented. I was skeptical about the performance of the Alpha Five application server for Web applications, but it was perfectly fine in my limited tests -- and Alpha has introduced a clustered server for people who need extra performance, scalability, and reliability. I was skeptical about how Alpha Five could possibly support Web 2.0 applications and still be easy for developers, but its new Ajax support easily integrates with Xbasic.

I haven't done extensive development with Alpha Five Platinum at this point, but I have tested the beta enough to uncover a few small bugs in the newest demos, which the Alpha developers fixed overnight. On a weekend, yet.

I'd say at this point that the Alpha Five Platinum beta is good enough to be worth some evaluation time. Start with the older Alpha Five product overview to get a feel for the product; go on to the Alpha Five Platinum tour to find out about the new version; read about what's new to get the details; watch the videos embedded in the "what's new" material; read the blogs for Richard's inside tips; and sign up to download a beta trial.

Posted by Martin Heller on March 18, 2008 01:40 PM



February 17, 2008 | Comments: (0)

LINQPad Webinar 2/20

Readers of this blog might be interested in an upcoming O'Reilly Webinar on LINQPad. From the official announcement:
bird"Writing LINQ Queries with LINQPad — Happening Wednesday, February 20th at 2:00pm PST. In this webinar, Joseph Albahari, author of C# 3.0 in a Nutshell, the LINQ Pocket Reference, and the upcoming C# 3.0 Pocket Reference, provides an introduction and brief tutorial to LINQPad, the querying tool that's sweeping the .NET world. This is a must-attend webinar for anyone working in C# 3.0 and .NET Framework 3.5. Learn more."

Posted by Martin Heller on February 17, 2008 02:41 PM



January 30, 2008 | Comments: (0)

A Working Distinct LINQ Query in C#

As I mentioned Monday and in my Visual Studio 2008 review, I've been struggling with the finer points of LINQ queries. In a talkback comment to my review, "CSharper" pointed me at one solution to finding the LINQ equivalent of a SQL "SELECT DISTINCT" query: tack on a LINQ .Distinct() method call to the query, which needs to be enclosed in parentheses.

That worked, but it destroyed the sort order created by a previous orderby clause. Obviously, I also had to learn to use the LINQ .OrderBy() method so that I could apply the sort after the sift. That was a little harder, since .OrderBy() takes a lambda expression, and I wasn't yet familiar with that new C# syntax.

Nevertheless, I got it working. It isn't beautiful, but this is really version 1.0 of LINQ.

var qAV = (from ai in db.AppInfos
   join acai in db.AppCatAIs on ai.Prodid equals acai.Prodid
   join ac in db.AppCategories on acai.acatid equals ac.acatid
   where ac.Category == category1 || ac.Category == category2
   select ai)
     .Distinct()
     .OrderBy(n => n.ProductName);

Posted by Martin Heller on January 30, 2008 08:18 AM



January 28, 2008 | Comments: (0)

LINQ Queries Follow-up

When I was writing my review of Visual Studio 2008, I built a little console application that generated JavaScript data structures from a SQL Server 2000 database in C#, using LINQ to SQL. As I mentioned in the review, I never did figure out how to write the LINQ equivalent of a SQL "SELECT DISTINCT" query.

In reading the LINQ section of C# 3.0 in a Nutshell*, I have come to realize that the LINQ code I wrote for that little project was basically SQL translated literally to LINQ. I might have done it quite differently if I had been thinking directly in LINQ.

Here's the meat of the program:

using(pcpDataClasses1DataContext db=new pcpDataClasses1DataContext())
{
    //Generate AVInfo
    string category1 = "AntiVirus";
    string category2 = "AntiSpyware";
    bool init = false;
    var qAV = from ai in db.AppInfos
              join acai in db.AppCatAIs on ai.Prodid equals acai.Prodid
              join ac in db.AppCategories on acai.acatid equals ac.acatid
              where ac.Category == category1 || ac.Category== category2
              orderby ai.ProductName
              select ai;
    //Beginning of JS structure
    Console.WriteLine("var AMInfo = [");
    //Per-item entries
    string fmt = "{{\nProdid: {0},\nName: \"{1}\",\nInst: [ {2} ],\nRoot: \"{3}\",\nSigs: \"{4}\",\nInit: {5},\nNeedRoot: {6}\n}}";
    foreach (AppInfo a in qAV)
    {
        if (init)
            Console.Write(",");
        Console.WriteLine(fmt, a.Prodid, a.ProductName, a.InstPattern, a.Root, a.Sigs,
            String.IsNullOrEmpty(a.InitMethod) ? "null" : a.InitMethod, a.NeedRoot.ToString().ToLower());
        if (!init)
            init = true;
    }
    //finish it off
    Console.WriteLine("]");
}

The O-R diagram for the database tables being queried is here.

How would you rewrite this to (1) emit only distinct items, and (2) be more like idiomatic LINQ and less like translated SQL?

 


*In my posting on Books for Learning C# 3.0 I said that I didn't yet have a copy of the C# 3.0 Nutshell book. I'm embarrassed to admit that I did have it: it was hiding in a big stack of books.

Posted by Martin Heller on January 28, 2008 08:39 AM



October 18, 2007 | Comments: (0)

Creating and Using a Data Access Layer with Visual Studio 2005

Every time I do this I have to figure it out again. (Sometimes I empathize with HAL, when he is being dismantled at the end of 2001: "My mind is going, Dave. I can feel it.") I'm blogging this as much for myself as for anyone else it might help.

Here is the magic spell you need:

  1. Create a Class Library project in your solution in the supported language of your choice. I like C#, but Visual Basic .NET also works. I usually end the project name with DAL so that I can remember what it is.
  2. Delete the Class1.cs (or .vb) source file that is created automatically.
  3. Right-click on the project and add a new DataSet item. The design surface for an XSD file will open.
  4. Open a data connection to the database you're wrapping.
  5. Select each table you want to use and drag it to the design surface.
  6. Build the data access layer project.
  7. Add a reference to the data access layer project to your UI project. It doesn't really matter whether the UI project is a Windows Forms application, an ASP.NET application, a console application, or a Windows Presentation Foundation application.
  8. Add a using (or Imports) statement for the table adapters of the data access layer to your UI project. IntelliSense will help out if you added the reference properly.

Now you can instantiate the table adapters in your code and call the appropriate pre-generated methods for whatever CRUD operations you need. If you need other operations, you can go back to the DAL and add them: right click at the bottom of the table in the DataSet diagram and add a query.

Posted by Martin Heller on October 18, 2007 08:06 AM



October 11, 2007 | Comments: (0)

Entier DB Enables Advanced Search on Devices

One of the many vendor meetings I postponed from ESC and took later over the telephone was one with Collin Bruce of Hitachi Embedded Systems. His basic pitch is that the Entier embedded database can enable a new level of search capability on converged devices.

What's a converged device? The undistinguished cell phone sitting on my desk, for one: it's a phone, it's a camera, it's a video recorder, it's a sound recorder, it's a music player, it's a Web browser, it's a GPS, it's a rat poison, it's a toothpaste... OK, the last two were just to see if you were paying attention.

Now, the fact is that most current cell phones, smart phones, and connected PDAs don't do very well when it comes to searching. My cell phone organizes my music by genre, artist, album, and song, which is fine if I want to listen to Bohemian Rhapsody from A Night at the Opera by Queen, but not fine if all I can remember about what I want to hear is how it sounds and that it's one of the gorgeous arias I keep hearing in unexpected contexts.

(The aria I was hearing in my head is in fact Ombra mai fu from Xerxes by Handel, sometimes known as Handel's Largo, even though it isn't notated at largo; I have a fine performance on my phone's music player by the late, great mezzo-soprano Lorraine Hunt Lieberson, published on her album of Handel Arias. The other gorgeous aria I keep hearing in unexpected contexts, including commercials on TV, is O mio babbino caro from Gianni Schicchi by Puccini.)

My cell phone can find me a sushi restaurant in my zip code a number of ways, among which the most convenient (and least graphical) is probably to text "sushi 01810" to Google. It can't easily find me the name of the Italian restaurant that's a couple blocks off the highway on my way from here to Cambridge unless I remember the restaurant name, the street address, or at least the town it's in, and it certainly has no idea how to coordinate the route it gives me to a location to what else is on that route.

According to Bruce of Hitachi, Entier can do all that, and more. Entier started out as a project Hitachi did for Nissan to supply an embedded database for cars; it was released in the U.S. market just over a year ago. At this point, Entier can do a full-text search of a substantial database on a mobile handset in under a second, and has extensions to SQL that let it answer questions like "find me a song that sounds like late–era Beatles" or "find me a sushi restaurant within two blocks of the current GPS route".

What's new in the current release of Entier is a level-locking mechanism to support efficient database access from multiple processes; a database partitioning scheme; a binary update utility; and improved complex word search. These augment the existing spatial search, conceptual search, incremental text search, and alias search features of the database.

There's a moderately obnoxious but informative flash demo about Entier here.

Posted by Martin Heller on October 11, 2007 12:12 PM



May 16, 2007 | Comments: (0)

Type Editing in Freebase

Editing the Patent Type in Freebase

When I wrote about Metaweb and Freebase on March 21st, I thought that my long-term interest in this technology would be centered on the Metaweb API. In real life, what happened is that I got interested in structuring types in Freebase that would map to other public databases, with the aim of making it easier for people to find what they need in those databases.

The first example that came to my mind was the US Patent database, which is something that people working with intellectual property and technology transfer use extensively. Thomson Delphion has made a commercial business out of adding value to the USPTO databases. A subset of Delphion's functionality can be used with a free subscription, but some of the most useful features require a paid subscription. http://www.freepatentsonline.com/ is another site along the same lines. It struck me that Freebase could be used to implement something similar.

With an eye on the structure of the USPTO databases, I created a set of related types in Freebase that could hold just enough information about a patent to be searchable; my thought was that once a user found something interesting, he could follow a link into the full patent text and figures on the USPTO site. In the figure above, the bold black text represents property names, and the blue text gives the type of a property. For example, I created an Inventor type that is a kind of Person, and a Patent Assignee type that is a kind of Company, University, or Institution. The Suggested Properties at the bottom of the design are automatic back links from other types: for example, Patents have Inventors, and Inventors have Patents.

All of this took a few hours of online time, after several days of mulling it over. To test my design, I have manually copied and pasted an example from the USPTO database, and it seems to make sense. Now, for this to be useful, Freebase would have to create a public set of types around patents (based on my design, or on a design of their own) and then undertake to bulk load the patent database and schedule periodic updates.

Freebase is still in the Alpha phase, however, and I suspect that they'll go after lower-hanging fruit first. Still, the possibility is there, and I'll be interested to see how it plays out.

I do have a few unused Freebase invitations, which are earmarked for "data fanatics." If that describes you, please drop me a note, either as a comment to this post or as an email to martin_heller@infoworld.com.

Posted by Martin Heller on May 16, 2007 06:46 AM



March 21, 2007 | Comments: (0)

Freebase, the Semantic Web, and the Metaweb Query API

AsFreebase alpha Welcome page I discussed in my article on the Semantic Web for our Crackpot Tech feature on February 19th, the standard Web was originally designed for document distribution, and has yet to realize its full potential for distributing data. The Semantic Web is an effort to relate information by classifying it and linking the classifications.

Some of the efforts related to the Semantic Web concentrate on ontologies, or systems of classification. As useful as ontologies can be, they often seem dry and academic to me.

Once ontologies are turned into database schemas, they often make more sense, at least to me. And once the database is implemented and the application built, it all falls into place.

Imagine my delight, then, to find that the new Freebase site is something like a modifiable database already integrated with a Web application, or as the Freebase.com FAQ puts it:

Freebase.com is home to a global knowledge base: a structured, searchable, writeable and editable database built by a community of contributors, and open to everyone.  It could be described as a data commons.

How is that different from Wikipedia? There's a FAQ for that, too:

It's an apple versus an orange: each is deliciously different. Wikipedia is an encyclopedia with information arranged in the form of articles. Freebase is more of an almanac, organized like a database, and readable by people or software. Wikipedia and Freebase both appeal to people who love to use and organize information. In fact, many of the founding contributors to Freebase are also active in the Wikipedia community. Whenever Freebase and Wikipedia cover the same topic, Freebase will link to the Wikipedia article to make it easy for users to access the best of both sites.

The Freebase type system is basically a flexible, editable ontology. For example, in the computer domain are types about computer hardware, software, computer science and theory, for example Programming Language. If you're browsing the Programming Language type, you can filter the 94 currently listed languages by the properties of the type: Name, Parent Language, Language Paradigms, Influenced By, Influenced, Dialects, Language Designers.

If I type "Gui" into the Language Designers filter entry, I get a drop-down completion of Guido van Rossum, along with a pop-up entry about Guido of type Programming Language Designer. If I filter by his name, I of course get an entry for Python (in this case, a description based on a Wikipedia article), which has the type Software as well as the type Programming Language.

Get it?

There's more. Freebase has an open API, the Metaweb Query API. Here's a sample read query, broken into two lines so that you can see it all:

http://www.freebase.com/api/service/mqlread?queries={"albums":{"query":{
"type":"/music/artist","name":"The Police","album":[]}}}

If you have a Freebase account and have used it on the browser running the query, this will most likely return a JSON-format response giving a list of albums by The Police, which you can save as a text file and view with an editor. Otherwise, it will probably give you an Error 401. It will not give you back articles about police in law enforcement, because we have restricted the queried record type to musical artists and asked to be given a list of albums.

Now, getting back a text file is not exactly stimulating stuff, but this API can easily be turned into an application using some fairly simple code like the freely available JavaScript for parsing JSON format. It would not necessarily have to be an application that interrogates Freebase. And there, eventually, is how Metaweb, the company behind Freebase, expects to make its money: by licensing commercial applications using its technology.

Want to give it a try? It's currently still in Alpha test, and by invitation only. You can try entering your email address at Freebase.com; I don't know how quickly you'll get a response. On the other hand, if you know someone who has Freebase invitations to give out, you can probably get on in a matter of minutes.

At this point, I have five invitations to give out. They will go to people I actually know, so please don't ask me for one if we haven't already met.

Posted by Martin Heller on March 21, 2007 06:00 AM



Technology White Papers

 

InfoWorld Technology Marketplace

» Technology White Papers Library

Technology White Papers by Topic

Technology White Papers E-mail Alert

Find out when the latest white paper is available:
 
 
» BUY A LINK NOW

Sponsored Technology Links