Which Database to Start With?

When people ask me how to learn to use a database or how to write SQL queries, I tell them to pick a database system and immerse themselves in it. In fact that advice goes for a lot of software technologies: just immerse yourself in a language, as programming tutorials are easy to come by these days. On the other hand, when people ask me which database software to use, I tend to give pause. Most of the time, I recommend MySQL for beginners since it tends to be the most light-weight system to install and use, but I know it’s not often the easiest to understand. With the advent of new light-weight database editions of often heavier products, perhaps it’s time I reconsider the issue.

1. MySQL: Free, lightweight, and readily available

MySQL stands out as the easiest for users to start with, in part because most people can get access to a MySQL database without having to setup anything. Most, if not all, hosting companies that offer database support do so in the form of a MySQL database. The only disadvantage with hosting solutions is that users lose the ability to run local applications on the database, often relying on phpMyAdmin for all database changes. I recommend anyone serious about learning MySQL download and install it themselves, as there are plenty of installation platforms supported.

The good: Free. Easy to download and/or find an existing database to work with. Somewhat easy to install. Lots of free tools available. Good documentation.
The bad: If the installation or auto-configuration breaks, user is left spending hours diagnosing the problems. The MySQL GUI tools, while nice, have to be downloaded separately from the server. Limited support. Clustering and support of large transaction systems is not uncommon. Also, it can be buggy and unpredictable at times, as I’ve seen in practice.

2. Oracle: Heavy and Powerful

Oracle is one of the oldest database systems and stands out as a powerhouse among databases given its vast support for advanced clustering, memory management, and query optimization. If you need something robust, powerful, and able to support millions or billions of transactions a day, it’s the best there is. Oracle needs to be licensed for a production environment, although developers can download a free limited-use version which is good for building an application.

The good: Powerful. Can do some really cool things for those that appreciate it. Extremely scalable.
The bad: Often large and time-consuming installation. Least user friendly of all the database systems, although it’s gotten better over the last few years. Not free. Not a wide variety of tools, free or otherwise, to manipulate the database.

3. Microsoft SQL Server: Easy to use administration interface, often powerful

Microsoft SQL Server has matured greatly over the last 10 years into a decent rival of Oracle. I like MS SQL Server in that it hides a lot of the underlying configuration information from the user. On the other hand, I dislike MS SQL server in that it hides a lot of the underlying configuration information from the user. Double-edged sword, I know. Like Oracle, you need a license if you want to use it in a production environment.

The good: Easy to set up new databases and administer them. Best for those who have no idea how to administer a database. New express editions can be used for free.
The bad: Over-simplifies a lot for advanced users, making it harder to optimize. Not free. Developer edition has nominal cost, although it probably should be free.

Other Databases

This article is not meant to be the end-all for database software discussion, but a beginning guide of the big three database systems for those who are not well-versed in the area. To cover every possible database software, such as PostgreSQL or DB2, as well as countless others, would take a book or two. Most students starting out just need to find a single database and start ‘playing’ with it until they get the hang of it, rather than an exhaustive discussion of which database is best.

Non-standard Databases

Some of you may be more familiar with embedded databases such HSQLDB, SQLite, or Derby than the ones I have mentioned. Rarely do I see beginners using embedded databases, so perhaps I’ll write an article about such systems down the road. Also, I have not purposely not mentioned Microsoft Access as a learning database, simply because I don’t consider it standard database software, but rather a glorified Excel spreadsheet. Most of teaching someone how to use a regular database after using Access, is convincing them all databases are not like Access.

My favorite database? If I’m teaching or writing a relatively simple web-application, MySQL. If someone else is paying for the license and the application is large enough, Oracle.

JavaOne Wrap up: See you next year?

As I sit here listening to my final JavaOne presentation there’s one question that has lingered on everyone’s mind this week: Will there be a JavaOne next year? In case you’ve been living in a cave (or a basement coding), Oracle has purchased Sun, the creators and maintainers of the Java programming language, and Oracle has a history of rebranding and reorganizing companies it has acquired.

Despite Larry Ellison, the CEO of Oracle, appearing on stage at the key note address, I and other attendees such as Tim Bray, can’t help get the feeling this will be the last JavaOne. Let me state right now I do not have any solid facts either way; Sun and Oracle have been purposely tight-lipped about it. This article is more about the current climate of the conference from a developer perspective and some wrap up thoughts.

For starters, the most consistent comments I’ve heard all week from alumni that have attended the conference for years, is that the conference is significantly diminished in size this year. Perhaps its the state of the economy or perhaps its the state of trade shows in the industry as a whole, but one way or another, attendance and vendor presence feels trickled down at best, deserted at worst. In fact, as one attendee pointed out this morning, Sun filled many of the Pavilion booths with its own company products. Whether it was the Sun Cloud, Sun Open Solaris, the Sun Java Store, Sun’s Duke awards, Sun’s Drizzle, etc, it felt like nearly half the booths were populated with Sun employees. That’s not to say there weren’t some good vendors and demos (JBoss, Intel, Microsoft, BlackBerry … Apple still missing in action), but it definitely felt like many vendors chose to skip the show. Given Java’s open community roots, its quite possible Oracle will keep the JavaOne showing going, if only to keep the community pleased, but its hard to say for sure. I guess we’ll have to all wait and see.

Some wrap up notes about the show:

1. Java FX: One of the two big buzz words from the show was definitely JavaFX, which is sort of like a 3D/advanced graphics version of Swing that is theoretically easier to use. I say “theoretically” because I have been hard pressed to find one attendee who’s used it in a production system. Also, from what I’ve heard from other attendees the mantra “JavaFX is the future of Java UI” is a bell they’ve been ringing for 2+ years now with little coming to fruition. Sun demo-ed an easy-to-use JavaFX builder tool but the tool will not be released until end of the year at the earliest. My take on it, shared by other members of the conference I’ve spoken with, is that Sun has been so slow to get JavaFX out the door, other technologies are already light years ahead and currently used in production systems.

2. Cloud Computing: The other big buzz word of the show was cloud computing. Sun, like Google, Amazon and a dozen other companies, has started its own cloud computing system for running and storing your applications, and you couldn’t trip over a booth this year without seeing the word cloud somewhere. For those not familiar with cloud computing, its really just a fancy word for a set of virtualized servers, in which the developer knows nothing of the underlying hardware. Turns out this website has existed ‘in a cloud’ for years; who knew? The cloud topics were actually interesting since the hardware has finally caught up such that virtualization isn’t as costly as it once was so I look forward to more advances in cloud computing.

3. The Java Store: One of the more disappointing presentations was unveiling of The Java store. For starters, it felt derivative right off the bat, following Apple’s iPhone store, BlackBerry’s Store, Verizon’s Store,… the list goes on and on. Second, at its launch there’s no way to charge users for applications, everything’s free and the pricing model is undecided. How does Sun expect to encourage developers to contribute their own time if they have no idea how they will be reimbursed? They should have thought that out and implemented a pricing model in the very first version of the store, beta or otherwise.

Third, the beta was far from impressive. I had to sign up for a beta account, wait to be approved to access it (why do you need approval to use it if everything is free?), and using it was painful. I received 6-8 pop-up “Are you sure?” and “Do you trust X?” questions while installing, using the store, and installing the applications. Lastly, this is the first program on a Mac where dragging and dropping the application icon to the trash can does not actually uninstall it. The application icon you see is just a complicated link to the files that have been downloaded to your classpath. In other words, you have to use the Java Store to uninstall applications. This is another area where they need to make it simple and easy to use, else no one’s going to use it.

4. Join us and write apps for free! As I traveled from booth to booth, one of the most consistent sentiments from each company, whether it be mobile device makers such as Sprint and Blackberry, cloud operators such as Sun, copier device makers such as Ricoh, or even ‘smart pens’ makers such as Livescribe, was: We have Java APIs now, come write applications for us!. While its clear Apple’s iPhone developer community success has changed the way companies find developers, I couldn’t help but wondering where they think tons of developers are just going to come aboard and write applications for them for free. Some do have solid pricing models for developers getting paid, but for the most part I think they are hoping developers magically materialize, at least on paper, so they can put on the appearance of staying competitive with Apple. I’m sure the next 2 years will be rampant with these stores failing or succeeding. For example, BlackBerry has had public APIs to develop on their mobile for years, and the quality of the software in the community, up until recently, has been awful.

Final Thoughts
If this entry seems critical of JavaOne, it’s only that I worry for the future. Make no mistake, I loved the JavaOne conference. I had a wonderful time, met a lot of really cool people, and expanded my knowledge of a lot of technologies and languages. The community is one of a kind, and everyone here is really top notch. Where else can you have conversations about serialization and cross-site scripting over breakfast? Thanks to everyone I met, the presenters in particular, and I hope to see you all next year!

Live from JavaOne: JCA Spec Enhancements

Live from the JavaOne conference, I’m currently attending a session on JCA specification 1.6 enhancements. According to the specification team, the goal of the new version of the spec is to simplify writing resource adapters (RAs) for those who have not written them in the past or may be new to the specification. In this article, I highlight some of the important new features.

1. New Annotation: @Connector
An alternative for creating XML information, this can now be done simply in the annotation.

2. New Annotation: @ConfigProperty
Complicated in previous versions, the new 1.6 spec will allow for automatic discovery of config properties to ease development of connectors.

3. New Annotation: @Activation
They’ve replaced activation interface required with simple annotation property as follows:

@Activation()
public class MyActivationSpec {
   // Use of bean validation annotations to express validation requirements
   @Size(min=5,max=5)
   private int length;
    // other methods...
}

Generic Work Context
They updated the concept of work context to accomplish tasks. A resource adapter submits a job request to the work manager, which then creates a work plan to complete the request, such as setting the proper transaction request. Backwards compatible with existing JCA 1.5 connector work solution.

More Information
This article is briefer than previous ones, in part because the slides were fast and flowing during the talk. Hopefully, I’ll update the information when the official slides are published.