Posts

Simulating Latency and Bandwidth Restrictions in WCF

Image
If you're developing WCF applications that will run over a WAN, VPN, or the public internet, then network bandwidth and latency is a concern. Messages take longer to transmit over these networks than over your local area network (LAN). As such, part of your development and testing needs to include testing the application over these typed of "slower" connection. To perform this testing there are two main options:  have a connection at your disposal, or simulate one.  Most of us will probably have to simulate one.  There are a few projects out there that are basically bridges, typically linux based, that you put between your client and server that allow you to simulate these slower connections. If you are a Java developer, you're probably familiar with JMeter. JMeter's approach doesn't involve a bridge, but rather simulates the latency at the client. I was chatting with Peter Lin, a friend, colleague, and JMeter committer, about it one night. After he mentio...

Automatically Close Braces in Visual Studio

If you're an Eclipse or Netbeans user, you'll be very familiar with this topic.  These IDEs automatically close braces, parenthesis, quotes, and brackets -- ( {},[],(),"",'' ) -- for you as you type in the code editors.  It may sound like laziness, but it can actually save you debug/troubleshooting time as it ensures (well, helps to ensure) that for every open you have a corresponding close. One complaint I've always had, along with many other people based on my Google searches, is that Microsoft Visual Studio does not have this functionality.  If you're like me and spend a lot if time in both the Java IDE's and Visual Studio, you probably find it very annoying that the editors don't behave quite the same.  It can really mess with your muscle memory and make you less productive. While there are a few very good commercial packages out there that provide this functionality (along with a host of other cool toys), I haven't been able to...

Open Source Efforts at Milestone

Even before I founded Milestone Technology Group, LLC, I was, and still am, a proponent of open source software, and often looked there first when architecting business solutions.  Because of this, open source is very much part of the Milestone's culture.  It would be hypocritical to say we're a proponent and not also provide back to the open source community.  So in my spare time, and under the umbrella of Milestone, I've started putting together some open source projects and pushing them out to the community via my account on sourceforge.net.  These projects will also be available from Milestone's web site in the near future.

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...