Home » Tag Archives: Databases (page 3)

Tag Archives: Databases

The downside of version-less optimistic locking

software-development-2-logo

Introduction In my previous post I demonstrated how you can scale optimistic locking through write-concerns splitting. Version-less optimistic locking is one lesser-known Hibernate feature. In this post I’ll explain both the good and the bad parts of this approach.         Version-less optimistic locking Optimistic locking is commonly associated with a logical or physical clocking sequence, for both ...

Read More »

Use MySQL’s Strict Mode on all new Projects!

software-development-2-logo

MySQL is a database that has been bending the SQL standard in ways that make it hard to move off MySQL. What may appear to be a clever technique for vendor lockin (or maybe just oversight of the standard) can be quite annoying in understanding the real meaning of the SQL language. One such example is MySQL’s interpretation of how ...

Read More »

Don’t Migrate to MariaDB just yet. MySQL is Back!

software-development-2-logo

Now that I have your attention, I’d like to invite you to a critical review of where we’re at in the MySQL vs. MariaDB debate. Around one month ago, I visited Oracle Open World 2014, and I’ve met with Morgan Tocker, the MySQL community manager at Oracle to learn about where MySQL is heading. Who “is” MySQL An interesting learning ...

Read More »

An entity modelling strategy for scaling optimistic locking

software-development-2-logo

Introduction Application-level repeatable reads are suitable for preventing lost updates in web conversations. Enabling entity-level optimistic locking is fairly easy. You just have to mark one logical-clock property (usually an integer counter) with the JPA @Version annotation and Hibernate takes care of the rest.           The catch Optimistic locking discards all incoming changes that are relative ...

Read More »

Logical vs physical clock optimistic locking

software-development-2-logo

Introduction In my previous post I demonstrated why optimistic locking is the only viable solution for application-level transactions. Optimistic locking requires a version column that can be represented as: a physical clock (a timestamp value taken from the system clock) a logical clock (an incrementing numeric value) This article will demonstrate why logical clocks are better suited for optimistic locking ...

Read More »

Using Your RDBMS for Messaging is Totally OK

software-development-2-logo

Controversial database topics are a guaranteed success on reddit, because everyone has an opinion on those topics. More importantly, many people have a dogmatic opinion, which always triggers more debate than pragmatism. So, recently, I posted a link to an older article titled The Database As Queue Anti-Pattern by Mike Hadlow, and it got decent results on /r/programming: Mike’s post ...

Read More »

Preventing lost updates in long conversations

software-development-2-logo

Introduction All database statements are executed within the context of a physical transaction, even when we don’t explicitly declare transaction boundaries (BEGIN/COMMIT/ROLLBACK). Data integrity is enforced by the ACID properties of database transactions. Logical vs Physical transactions An logical transaction is an application-level unit of work that may span over multiple physical (database) transactions. Holding the database connection open throughout ...

Read More »

A beginner’s guide to database locking and the lost update phenomena

software-development-2-logo

Introduction A database is highly concurrent system. There’s always a chance of update conflicts, like when two concurring transactions try to update the same record. If there would be only one database transaction at any time then all operations would be executed sequentially. The challenge comes when multiple transactions try to update the same database rows as we still have ...

Read More »

Awesome SQL Trick: Constraints on Views

software-development-2-logo

CHECK constraints are already pretty great when you want to sanitize your data. But there are some limitations to CHECK constraints, including the fact that they are applied to the table itself, when sometimes, you want to specify constraints that only apply in certain situations. This can be done with the SQL standard WITH CHECK OPTION clause, which is implemented ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close