Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

Using PostgreSQL: Software Architecture Overview

·

PostgreSQL Overview

No matter what you do, the chance is you need to store the data you serve to consumers, as well as to keep the data you receive from them. There’s hardly a system design that doesn’t involve a storage solution. Despite that almost every storage boils down to a file, the way you interact with the file differs dramatically between applications. In this post, we’ll consider a database, specifically PostgreSQL, that is the second most popular RDBMS solution that implements SQL on the market. There are several other popular solutions, e.g. MySQL (+ MariaDB), SQLite, or MSSQL; most of them have a similar set of basic commands due to the strictly standardized SQL but differ in types, implementation, and extra features added on top. In my experience, this additional sugar is very different and influences the decision of what database one should use.

You can run Postgres on your machine using Docker. You can also install it from sources, but I personally wouldn’t recomment doing so.

docker run --name "postgresql" -p 25432:5432 -e POSTGRES_USER=some_username -e POSTGRES_PASSWORD=some_password -e POSTGRES_DB=some_db_name -t -d postgres

Postgres is quite old but has significantly changed over the years (SQL changed). Due to widespread enterprise adoption, PostgreSQL receives enough attention to get trendy updates and extensions earlier than competitors (pgvector is a good example, a popular extension used in AI and machine learning). In my opinion, it is also quite heavy and isn’t the most performant RDBMS. The killer feature of Postgres is durability and predictability. The Write Ahead Logging (WAL) Postgres uses is different than MySQL’s WAL implementation (redo log). One of the biggest changes in PostgreSQL was the implementation of ACID (for instance, MySQL still isn’t ACID compliant).

PostgreSQL Role in Software Architecture

When it comes to PostgreSQL, Software Architecture views it as a data storage workhorse, something that isn’t supposed to respond in microseconds (like Redis) but can reliably keep an unknown amount of structured and unstructured data.

PostgreSQL Use Cases

PostgreSQL Capabilities

PostgreSQL Downsides