The hi/lo algorithm

Introduction In my previous post I talked about various database identifier strategies, you need to be aware of when designing the database model. We concluded that database sequences are very convenient because they are both flexible and efficient for most use cases. But even with cached sequences, the application requires a database round-trip for every new the sequence value. If your applications demand a high number of insert operations per transaction, the sequence allocation may be optimized with a hi/lo algorithm. The hi/lo algorithm The hi/lo algorithms split the sequences domain into… Read More

A beginner’s guide to natural and surrogate database keys

Types of primary keys All database tables must have one primary key column. The primary key uniquely identifies a row within a table therefore it’s bound by the following constraints: UNIQUE NOT NULL IMMUTABLE When choosing a primary key we must take into consideration the following aspects: the primary key may be used for joining other tables through a foreign key relationship the primary key usually has an associated default index, so the more compact the data type the less space the index will take a simple key performs better than a… Read More

What I learned at Topconf Bucharest

Introduction I’ve got back from Topconf Romania 2014, a developer to developer conference that emerged in Tallinn and for the first time this year it was also held in Bucharest. As an architect, I assumed I’d be after technical speeches but I got really impressed by some management related presentations as well. Lessons learned A conference is a great learning experience. New technologies are being advertised and software paradigms get dissected and questioned by both the speakers and the attendees. There were some great ideas I came back with and I’ll share… Read More

A beginner’s guide to Hibernate Types

The basic mapping concepts When learning Hibernate, many like to jump to Parent – Child associations without mastering the object relation mapping basics. It’s very important to understand the basic mapping rules for individual Entities before starting modelling Entity associations. Hibernate types A Hibernate type is a bridge between an SQL type and a Java primitive/Object type.

The minimal configuration for testing Hibernate

Introduction In my previous post I announced my intention of creating a personal Hibernate course. The first thing to start with is a minimal testing configuration. You only need Hibernate In a real production environment you won’t use Hibernate alone, as you may integrate it in a Java EE or Spring container. For testing Hibernate features you don’t need a full-blown framework stack, you can simply rely on Hibernate flexible configuration options.

New Video Course