|
May
23
2009
Adventures In Application Databases – H2 Saga BeginsPosted by Don Hass in development, software, webI ran into the need to change a project I am working on from keeping a ton of java objects in the air due to real-time calculations and performance. Didn’t need (or want) full database that would need to be maintained by a database group. Every time the application was restarted, the entire thing would be reloaded based on other sources (other databases of data — all different db’s, data and transformation needed). The transformation requires each base source to have different set of transformations and calculations performed on them. Also since the sources have different real-time intervals there needed to be different levels or transformation going on. Of course if I was a dba, I would be saying this should all be done in some huge db iron and storing it into some jumbo sized tables and all could be done with scripts, triggers, etc. But I am not a dba, I like my logic in code, not a database. That is just who I am. I love Java and like to see what my code is doing to the data and db are used to store and get things for me, period. Just wasn’t going down that road. We can agree to disagree or not. Ruled out in like 5 seconds that the use of flat files to store the calculated data would just not work. I had to have the ability to retrieve the data fast (wanted hash maps or trees in memory, but that quickly ran out of steam due to quantity of data). I also wanted to keep everything in the single app (single deployed war) at the end of the day. Makes support easier in the long run. One point to look at instead of 12! So I came up with a list of what I wanted:
I had narrowed my list down to three choices I was entertaining (your experience might be different): They probably would all get the job down. But I tried to narrow it down by my criteria by doing a little reading (Google + reviews + blogs + groups complaining about stuff + did I like what I saw):
So it really came down to how easy “did it appear” for me to get this started, embedded and actually working, using it in actual live code all in the same day. For me it had to be H2. There were quite a few reasons other than meeting my 6 requirements above. I also liked that it had an active change log which every month appeared to have forward progress and making the project better. Open source projects are either constantly evolving and or dead. Get worried when a project hasn’t had commits or quite a bit of progress in months, 6 months, last year, etc. Code is never perfect, it can always be better. Don’t leave it there to just die. I have to admit that venturing down the H2 path in the first day of use has turned out to be a great choice. Love the embedded console you get by including 1 (one, yes one) jar in your project which you were going to do anyways since that is the only lib required. Edit your apps web.xml and bang. That is supporting your dev project front and back. I can see it will come in handy trouble shooting the application both during development and even possibly productional since we are talking ever changing live data. Integrated really quickly with Cayenne. I have cayenne actually building the schema from its own XML each and every time the app starts up. Talk about reuse and single place for describing the model. ORM creates the model, creates the Java classes and now builds me my schema in my temp db. That is a win, win, win situation folks. No SQL monkey business, period! With a little more code (I mean little) I have it dropping everything (entire schema) and db temp files when it shuts down (all through a single listener config in the web.xml). I love when things are simple and just work. Kudos to Thomas for creating such a great db that works right out of the gate. Simplest Java library I think I have ever used. I plan to write up some of the things I find interesting in the coming month or two (along with some other Wicket and Cayenne stuff I have mocked up, but not typed into here). Here are some of those ideas I have already worked through turned out beautifully (eluded to above)!
It should be noted that H2 is developed by Thomas Mueller who was the creator of HSQLDB (H2 can be seen as HSQLDB2, just better and it even said that it could merge back into HSQLDB)… anyhow. H2 +1 in my book. I have to say that Verizon FIOS is one of the best moves we have made. Switching from Comcast to FIOS is like night and day. These are our personal experience so far and YMMV.
The last one I have to admit I was shocked about. I have always had my own firewall and network gear, but Verizon has really done a nice job on their router (but that is another post). Internet speed:
The tech that showed up to install the service was awesome. Really nice guy that called before showing up to tell me when he would be there (was 1 minute early from when he said he would be there). Did everything that I had ordered in a very timely matter and it all just worked! Took under 3 hours for us to get all new Internet and two TV receivers. All working better than expected. Just sweet! More to come. |




Entries (RSS)