This is the third post in the series of the blog posts I am writing about NuoDB. NuoDB is very innovative and easy-to-use product. I can clearly see how one can scale-out NuoDB with so much ease and confidence. In my very first blog post we discussed how we can install NuoDB (link), and in my second post I discussed how we can manage the NuoDB database transaction engines and storage managers with a few clicks (link).
Note: You can Download NuoDB from here.
In this post, we will learn how we can use the Explorer feature of NuoDB to do various SQL operations. NuoDB has a browser-based Explorer, which is very powerful and has many of the features any IDE would normally have. Let us see how it works in the following step-by-step tutorial.
Let us go to the NuoDBNuoDB Console by typing the following URL in your browser: http://localhost:8080/
It will bring you to the QuickStart screen. Make sure that you have created the sample database. If you have not created sample database, click on Create Database and create it successfully.
Now go to the NuoDB Explorer by clicking on the main tab, and it will ask you for your domain username and password. Enter the username as a domain and password as a bird. Alternatively you can also enter username as a quickstart and password as a quickstart.
Once you enter the password you will be able to see the databases. In our example we have installed the Sample Database hence you will see the Test database in our Database Hierarchy screen.
When you click on database it will ask for the database login. Note that Database Login is different from Domain login and you will have to enter your database login over here. In our case the database username is dba and password is goalie.
Once you enter a valid username and password it will display your database. Further expand your database and you will notice various objects in your database.
Once you explore various objects, select any database and click on Open.
When you click on execute, it will display the SQL script to select the data from the table. The autogenerated script displays entire result set from the database.
The NuoDB Explorer is very powerful and makes the life of developers very easy. If you click on List SQL Statements it will list all the available SQL statements right away in Query Editor. You can see the popup window in following image.
Here is the cool thing for geeks. You can even click on Query Plan and it will display the text based query plan as well. In case of a SELECT, the query plan will be much simpler, however, when we write complex queries it will be very interesting. We can use the query plan tab for performance tuning of the database.
Here is another feature, when we click on List Tables in NuoDB Explorer. It lists all the available tables in the query editor. This is very helpful when we are writing a long complex query.
Here is a relatively complex example I have built using Inner Join syntax. Right below I have displayed the Query Plan. The query plan displays all the little details related to the query.
Well, we just wrote multi-table query and executed it against the NuoDB database. You can use the NuoDB Admin section and do various analyses of the query and its performance.
NuoDB is a distributed database built on a patented emergent architecture with full support for SQL and ACID guarantees. It allows you to add Transaction Engine processes to a running system to improve the performance of your system. You can also add a second Storage Engine to your running system for redundancy purposes. Conversely, you can shut down processes when you don’t need the extra database resources.
NuoDB also provides developers and administrators with a single intuitive interface for centrally monitoring deployments.
If you have read my blog posts and have not tried out NuoDB, I strongly suggest that you download it today and catch up with the learnings with me. Trust me though the product is very powerful, it is extremely easy to learn and use.
Reference: Pinal Dave (http://blog.sqlauthority.com)