Java / Tomcat / Virtualization

I was talking about Virtualized Linux/BSD distribution with Java and Tomcat

And, I am glad to discover that it is there.

I notice eApps.com before I made the previous blogs on December. However, until recently, they get to the price point that is very interesting: $20 a month.

For the price, I got my own virtual server, and we setup to run as many domain name as I want. To my surprise, it meets almost all my criteria. The HD footprint was about 63M with core linux, jdk and jre, iptables, tomcat, mail, ftp, mysql, ssh and various software. Additional software can be installed with simply checking a checkox. To my surprise, they also provide the XFree86 X11 Libraries. I tested that the JRE is able to utilize it. I was able to run a swing app on the virtual server and display the swing app on my home desktop.

The performance is rather unacceptable for interactive UI applications. I don’t except I need any kind of UI performance from a hosted server anyway. It also consider slow for shell, or ftp operations. However, it seems to work reasonably well for serving webpage.

The management software of eApps is provided by SWsoft. The control panel, HSPComplete is very intuitive. The Virtual server infrastructure, obviously also licensed from SWsoft.

eApps rocks! In term of features, it certainly beat my expectation. Highly recommended!

[Update June 24, 06] I update to the $30 plan, the performance of eApps are getting pretty good. Not sure if it is because of the plan upgrade, or is it because their ongoing performance improvment in general.


Tag: , ,

HSQL and Memory Database

The quest continues on HSQL.

Creating a new database was a snap. Simply obtained a connection by passing in the jdbc string appending the filename at the end. The database files was created related to the "working directory". (ie, jdbc:hsqldb:file:db)

I wrote the database table schema in SQL. The SQL syntax was pretty standard. It was also nice that they support IDENTITY for a field for primary on sequence.

The doc explains clearly how to use its SQL tools interactively or non-inteactively. Tables were created without any problem. Restarting the non-inteactive sqltool still saw the tables I created.

However, when it came to the next steps: making samples, the behaviour was unexpected. The row that inserted disappeared after restarted. The table was created as "MEMORY" type by default. After reading the doc, it should be fine. The whole data set was kept in memory, but unlike TEMP type, the data was persisted and reconstructed when the database is restarted. However, launching the sqltool again and I find no row with select all. Twisting the table to CACHED or TEXT type didn't help. After a couple of hours, I still didn't get further.

Ok, tight schedule, the next inline would be Derby from Apache.

Tag: , ,

HSQL and Read Uncommitted

As a database person, the second step is to design database schema. I am going to push much to the database. The JSP will be a thin presentation layer to present different views of the database.

The initial deployment will not require high volume. But, I expect it will in the future. After a brief sketch of ER diagram, I am start picking a test database.

I came across HSQL, the Java embedded database a few times when I was working on Castor JDO. So, it was my first choice. The User Guide is very good. Clean, direct, and straightforward without any marketing talk. Small download and its claims good performance.

As I was reading it, I found myself a little bit disappointed to
the transaction support
. It supports only at READ_UNCOMMITTED level, the level 0, which means if user want to guarantee data integrity it has to access data in more restricted way or to do quite a lot of works themselves.

Whether it matters depends on application. To ensure data integrity with weak isolation from the database can be quite challenged, as the complexity of the database schema grows. However, stronger isolation will incur performance disadvantage and decrease concurrencies. It might not be feasible for high-volume app.

I would start with stronger isolation first and have the database do more work for me. I would also want the flexibility to turn by changing the isolation level. So, I know I will need to switch before my web app is deployed to the real world.

Tag: ,

Web Project

After years of working on very backend components (O/R mapper, clustering framework), I recently started a web project of my own.

Of course, I picked the Java camp. JSP Servlet, Tomcat, Eclipse WTP is my technologies, container, and developer tool. I expect to incorporate other J2EE technologies later. But, it is always good to start simple and only with what you need.

I first coded up some login logic. For my application, it is important to roll my own. I am going to reuse authentication done by other, such as Microsoft Passport, AOL Screen name, or Yahoo when it is available.

The main verdict with login logic is that I need redirection a lot. Learned the different between a few HTTP response 30x. I hit a bug in IE that if it is redirected by HTTP 302 (moved temporarily), and then is redirected back (with user input) by HTTP 301 (moved permanently), the URL in the “Address” is not updated correctly and is still pointing to the temporary address.

Yahoo’s own login doesn’t seem to suffer the problem. I need to learn its workaround. :-)

Tag:
,