Home » Tag Archives: Databases

Tag Archives: Databases

Setting PostgreSQL psql Variable Based Upon Query Result

postgresql-logo

When using PostgreSQL‘s psql command-line tool to interact with a PostgreSQL database via operator interaction or script, it is not uncommon to want to set psql variables based on the results of a particular query. While PostgreSQL’s procedural language PL/pgSQL supports approaches such as SELECT INTO and assignment (:=) to set PL/pgSQL variables based on a query result, these approaches ...

Read More »

Procedure-Like Functions in PostgreSQL PL/pgSQL

postgresql-logo

PostgreSQL does not support stored procedures in the sense that a database such as Oracle does, but it does support stored functions. In this post, I look at a few tactics that can make the use of a stored function in PostgreSQL (stored function and its calling code both written in PL/pgSQL) feel like using a stored procedure. These simple ...

Read More »

Mysql versions prior to 5.7 do not fully support two phase commit

mysql-logo

While doing some tests for the recently released generic JCA adapter which is capable of binding remote calls to microservices (as well as other things) into JTA transactions, I discovered a bug in Mysql 5.6 which has been around for nearly ten years. The test scenario was a crash after the “prepare” phase of the XA transaction, after both the ...

Read More »

Extending PostgreSQL: Complex Number Data Type

postgresql-logo

A few years ago I discussed creating user-defined types using PL/java. (Introduction to PostgreSQL PL/Java, part 4: User Defined Types) Today I follow up on the comment that we would use a standard C-language PostgreSQL extension in practice. What is an extension? A PostgreSQL extension is nothing more than bundled SQL statements and an optional native library. SQL-only extensions contain ...

Read More »

Unleash the power of storing JSON in Postgres

json-logo

An article by Sarah Mei titled “Why you should never use MongoDB” discusses the issues you’ll run into if you try to use a NoSQL database when a relational database would be far superior. An example of this is when data that was thought to be in a silo needs to cross boundaries (what relational DBs are great at). Another ...

Read More »

The Evolution of Database Schemas using SQL + NoSQL

nosqlunit-logo

Part two of the two part series: Rethinking Database Design with Apache Drill In part one of this series, Drilling into Healthy Choices we explored using Drill to create Parquet tables as well as configuring Drill to read data formats that are not very standard. We also explored the USDA National Nutrient Database by writing some different queries in Drill. In part ...

Read More »

MySQL vs. MongoDB: Choosing a Data Management Solution

software-development-2-logo

Table Of Contents 1. Introduction 2. The dominance of RDBM systems 3. A new era of NoSQL movement 4. Tables vs Documents vs Graphs vs Key/Values 5. MySQL and MongoDB: Conscious Decision 5.1. Enforced Schema vs Schemaless 5.2. Normalization vs Duplication 5.3. Relations vs References 5.4. Transactions vs Atomic Updates 5.5. SQL vs JSON 5.6. Stored Procedures vs Scripting 5.7. ...

Read More »

Blue-Green Deployment With a Single Database

software-development-2-logo

A blue-green deployment is a way to have incremental updates to your production stack without downtime and without any complexity for properly handling rolling updates (including the rollback functionality) I don’t need to repeat this wonderful explanation or Martin Fowler’s original piece. But I’ll extend on them. A blue-green deployment is one where there is an “active” and a “spare” ...

Read More »

Discovering the Computer Science Behind Postgres Indexes

software-development-2-logo

This is the last in a series of Postgres posts that Pat Shaughnessy wrote based on his presentation at the Barcelona Ruby Conference. You can also watch the video recording of the presentation. The series was originally published on his personal blog, and we are republishing it on Codeship with his kind permission. You can also read posts one, two, ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.