Posts

Setting Up a Reporting Database

Image
Using a live OLTP database for complex reporting has a significant performance impact on the OLTP application.  A common architectural design is to have a separate reporting database from your application's OLTP database. Before I get into reporting database options, a critical area to look at is tuning the queries for the reports.  You should start there before introducing a more complex and costly environment.  Just because a query is fast on a 10GB DB doesn't mean it will be on a 100GB DB. Assuming you've fine-tuned the queries and database, let's take a look at ways to create a reporting database. I've used several approaches in the past, each with great success.  Like anything else, there are different solutions that fit different scenarios.  I list a few here, but instead of breaking out pro's vs con's, which are subjective, I'll simply list the caveats to using each. There are several things to consider when choosing a reporting database s...

Apple and Mac OS X for Developers

Well, I did it.  I made the leap from the PC world to Mac.  Not that it was a far leap; I've been using Fedora as my primary OS since 2005.  The decision for me wasn't so much the "Apple sex-appeal" or even the OS, but more the engineering--it was the only i7 laptop I test drove (and I tried many) that didn't cook my wrists and could last an entire 8 hour business trip on battery. Anyway, I thought it would be worth while to start a blog mini-series on my experiences as developer, architect, and business owner with Mac. The new toy: 15" Macbook Pro (April 2010) High-Res Anti-Glare screen Intel Core i7 @ 2.66 GHz 4 GB RAM 500GB 5400RPM Hard Disk Mac OS X 10.6.3 Software: Eclipse 3.6 Netbeans 6.9 Mono 2.6 Monodevelop 2.4 Oracle SQL Developer 2.1 MySQL 5.1 JBoss 5.1 with the Metro Web Services stack Concept Draw Office Open Office 3.2 Subversion Client RapidSVN Ode to Microsoft Windows As most any developer who has left the Windows world w...

Singleton vs. Static Class

I'm often asked “Why create a Singleton when a Static Class does the same thing?”.  Well, while using a Singleton vs a Static Class may seem to be the “same thing”, they are quite different.  There are pros and cons to both, and each has it's place in an application.  To understand the difference, let's first take a look at memory allocation.  Then we’ll look at memory implications, state and synchronization, and some caveats as to the use and behavior of the two. Stack and Heap There are two major types of memory allocation within the .Net CLR and Java VM--the stack and the heap.  The stack is just that—an organized stack of frames.  Think of it as a stack of blocks and you can only access the block at the top of the stack—the active frame .  Each thread gets it's own stack.  The heap is a disorganized “pile” of “things” that can be quickly accessed from anywhere in the pile.  Under the hood, .Net and Java handle these memory areas differe...

Breaking the Row Size Limit in SQL Server

Microsoft SQL Server, as of version 9.0 (2005), allows you to cheat the max row size limit of 8K. If we have a row of variable length data types (ie. varchar), the total byte count can be more than 8K. SQL Server will magically spill the data over to the next page. Cool right? Well... yes and no. Cool if your hands are tied and it gets you out of a jam. Not cool if you care about database performance and scalability. Having a row span more than one page (in Oracle we call them blocks), results in page (or block) chaining. The overhead involved in block chaining can cause some significant performance hits depending on how often it happens, size of the table, fragmentation, etc. This goes for most any popular RDBMS. Let's look at Oracle (no point in just picking on SQL Server). Oracle allows a 64K max row size (and that's a hard limit... no loosy goosy there). However, block size is determined by the value of the db_block_size init parameter set during database cre...

Reflecting on Reflection

I was approached by a developer suggesting a reflection routine for taking values from a data transfer object and populating a business entity and vice versa. He argued that writing a TransferObjectAssembler for each DTO was too time consuming, and would be better suited with a reflection routine. My response was no, not a good practice. But why? It seemed clean enough. It was fairly straight forward code for the particular implementation scenario he was looking at. So, why not? It would certainly save a few million lines of code. But what are we really saving? And at what cost? It's no secret--reflection is slooooowwwww. At least in comparison to explicit design-time coding. Case in point: I helped out with a code review of a similar implementation where reflection was being used to create a generic routine to "convert" DTOs to business entities and vice-versa. While the DTOs were quite large, they were not ridiculously complex, and very typical of the particul...

JBoss SOAP error with Java 6.

Error message "setProperty must be overridden by all subclasses of SOAPMessage". After reading this Jira issue, I followed the steps mentioned in "JBoss5.0.0GA Installation_And_Getting_Started_Guide.pdf - section 5.4 Java6 Note" and copy below jar files from the JBOSS_HOME/client directory to the JBOSS_HOME/lib/endorsed jbossws-native-saaj.jar jbossws-native-jaxrpc.jar jbossws-native-jaxws.jar jbossws-native-jaxws-ext.jar and thats it !! https://jira.jboss.org/jira/browse/JBWS-1439

Installing Any Executable as a Windws Service

I'll clean this up later, but in short: Download SrvAny.exe as part of the Windows server resource kit here: http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en Run: InstSrv.exe yourservicename "d:\pathtosrvany\svrany.exe" Edit the registry entry for the newly created service and add a "Parameters" key called "Application". Set the value to the full path of your executable.