When to Choose SQL and When to Choose NoSQL

Some people make architecture decisions purely based on the loudest consultant: https://twitter.com/gareth/status/778575385600688129 For most others, however, decisions are not as simple as this. For instance: When should we start evaluating NoSQL storage systems as an alternative to RDBMS? RDBMS as the hammer for all nails This question obviously assumes that you're starting out with an … Continue reading When to Choose SQL and When to Choose NoSQL

A Hidden jOOQ Gem: Foreach Loop Over ResultQuery

A recent question on Stack Overflow about jOOQ caught my attention. The question essentially asked: Why do both of these loops work? // With fetch() for (MyTableRecord rec : DSL .using(configuration) .selectFrom(MY_TABLE) .orderBy(MY_TABLE.COLUMN) .fetch()) { // fetch() here doThingsWithRecord(rec); } // Without fetch() for (MyTableRecord rec : DSL .using(configuration) .selectFrom(MY_TABLE) .orderBy(MY_TABLE.COLUMN)) { // No fetch() … Continue reading A Hidden jOOQ Gem: Foreach Loop Over ResultQuery

Avoid Using COUNT() in SQL When You Could Use EXISTS()

A while ago, I blogged about the importance of avoiding unnecessary COUNT(*) queries:https://blog.jooq.org/sql-tip-of-the-day-be-wary-of-select-count ... and how to replace them with equivalent EXISTS queries As I'm updating the SQL training to show also PostgreSQL performance characteristics in addition to Oracle, I really have to reiterate this topic. Please repeat after me: Thou shalt not use COUNT(*) … Continue reading Avoid Using COUNT() in SQL When You Could Use EXISTS()