mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2026-09-24 15:00:31 +08:00
chore: sync content to repo (#10154)
Co-authored-by: nilbuild <4921183+nilbuild@users.noreply.github.com>
This commit is contained in:
co-authored by
nilbuild
parent
256fae338b
commit
9040ea6557
@@ -6,4 +6,4 @@ Visit the following resources to learn more:
|
||||
|
||||
- [@article@What is ACID Compliant Database?](https://retool.com/blog/whats-an-acid-compliant-database/)
|
||||
- [@article@What is ACID Compliance?: Atomicity, Consistency, Isolation](https://fauna.com/blog/what-is-acid-compliance-atomicity-consistency-isolation)
|
||||
- [@video@ACID Explained: Atomic, Consistent, Isolated & Durable](https://www.youtube.com/watch?v=yaQ5YMWkxq4)
|
||||
- [@video@ACID Explained: Atomic, Consistent, Isolated & Durable](https://www.youtube.com/watch?v=yaQ5YMWkxq4)
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
|
||||
PostgreSQL provides various extensions to enhance its features and functionalities. Extensions are optional packages that can be loaded into your PostgreSQL database to provide additional functionality like new data types or functions. Using extensions can be a powerful way to add new features to your PostgreSQL database and customize your database's functionality according to your needs.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@PostgreSQL Extensions](https://www.postgresql.org/download/products/6-postgresql-extensions/)
|
||||
- [@official@Create Extension](https://www.postgresql.org/docs/current/sql-createextension.html)
|
||||
- [@official@Create Extension](https://www.postgresql.org/docs/current/sql-createextension.html)
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
Aggregate functions in PostgreSQL perform calculations on a set of rows and return a single value, such as `SUM()`, `AVG()`, `COUNT()`, `MAX()`, and `MIN()`. Window functions, on the other hand, calculate values across a set of table rows related to the current row while preserving the row structure. Common window functions include `ROW_NUMBER()`, `RANK()`, `DENSE_RANK()`, `NTILE()`, `LAG()`, and `LEAD()`. These functions are crucial for data analysis, enabling complex queries and insights by summarizing and comparing data effectively.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@Data Processing With PostgreSQL Window Functions](https://www.timescale.com/learn/postgresql-window-functions)
|
||||
- [@article@Why & How to Use Window Functions to Aggregate Data in Postgres](https://coderpad.io/blog/development/window-functions-aggregate-data-postgres/)
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
Ansible is a widely used open-source configuration management and provisioning tool that helps automate many tasks for managing servers, databases, and applications. It uses a simple, human-readable language called YAML to define automation scripts, known as “playbooks”. By using Ansible playbooks and PostgreSQL modules, you can automate repetitive tasks, ensure consistent configurations, and reduce human error.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Ansible](https://www.ansible.com/)
|
||||
- [@opensource@ansible/ansible](https://github.com/ansible/ansible)
|
||||
- [@article@Ansible Tutorial for Beginners: Ultimate Playbook & Examples](https://spacelift.io/blog/ansible-tutorial)
|
||||
- [@article@Ansible Tutorial for Beginners: Ultimate Playbook & Examples](https://spacelift.io/blog/ansible-tutorial)
|
||||
+1
-1
@@ -2,6 +2,6 @@
|
||||
|
||||
PostgreSQL supports various languages for providing server-side scripting and developing custom functions, triggers, and stored procedures. When choosing a language, consider factors such as the complexity of the task, the need for a database connection, and the trade-off between learning a new language and leveraging existing skills.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Procedural Languages](https://www.postgresql.org/docs/current/external-pl.html)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Attributes in the relational model are the columns of a table, representing the properties or characteristics of the entity described by the table. Each attribute has a domain, defining the possible values it can take, such as integer, text, or date. Attributes play a crucial role in defining the schema of a relation (table) and are used to store and manipulate data. They are fundamental in maintaining data integrity, enforcing constraints, and enabling the relational operations that form the basis of SQL queries.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@What is a Relational Model?](https://www.guru99.com/relational-data-model-dbms.html)
|
||||
- [@article@Relational Model in DBMS](https://www.scaler.com/topics/dbms/relational-model-in-dbms/)
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
|
||||
PostgreSQL supports various authentication models to control access, including trust (no password, for secure environments), password-based (md5 and scram-sha-256 for hashed passwords), GSSAPI and SSPI (Kerberos for secure single sign-on), LDAP (centralized user management), certificate-based (SSL certificates for strong authentication), PAM (leveraging OS-managed authentication), Ident (verifying OS user names), and RADIUS (centralized authentication via RADIUS servers). These methods are configured in the `pg_hba.conf` file, specifying the appropriate authentication method for different combinations of databases, users, and client addresses, ensuring flexible and secure access control.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Authentication Methods](https://www.postgresql.org/docs/current/auth-methods.html)
|
||||
- [@article@An Introduction to Authorization and Authentication in PostgreSQL](https://www.prisma.io/dataguide/postgresql/authentication-and-authorization/intro-to-authn-and-authz)
|
||||
- [@article@An Introduction to Authorization and Authentication in PostgreSQL](https://www.prisma.io/dataguide/postgresql/authentication-and-authorization/intro-to-authn-and-authz)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Awk is a versatile text processing tool that is widely used for various data manipulation, log analysis, and text reporting tasks. It is especially suitable for working with structured text data, such as data in columns. Awk can easily extract specific fields or perform calculations on them, making it an ideal choice for log analysis.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@Awk](https://www.grymoire.com/Unix/Awk.html)
|
||||
- [@article@Awk Command in Linux/Unix](https://www.digitalocean.com/community/tutorials/awk-command-linux-unix)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
B-Tree (short for Balanced Tree) is the default index type in PostgreSQL, and it's designed to work efficiently with a broad range of queries. A B-Tree is a data structure that enables fast search, insertion, and deletion of elements in a sorted order. B-Tree indexes are the most commonly used index type in PostgreSQL – versatile, efficient, and well-suited for various query types.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@B-Tree](https://www.postgresql.org/docs/current/indexes-types.html#INDEXES-TYPES-BTREE)
|
||||
- [@video@B-Tree Indexes](https://www.youtube.com/watch?v=NI9wYuVIYcA&t=109s)
|
||||
+15
-12
@@ -2,25 +2,28 @@
|
||||
|
||||
It's not enough to just take backups; you must also ensure that your backups are valid and restorable. A corrupt or incomplete backup can lead to data loss or downtime during a crisis. Therefore, it's essential to follow best practices and validate your PostgreSQL backups periodically.
|
||||
|
||||
## Key Validation Procedures
|
||||
Key Validation Procedures
|
||||
-------------------------
|
||||
|
||||
Here are the critical backup validation procedures you should follow:
|
||||
|
||||
- **Restore Test**: Regularly perform a restore test using your backups to ensure that the backup files can be used for a successful restoration of your PostgreSQL database. This process can be automated using scripts and scheduled tasks.
|
||||
* **Restore Test**: Regularly perform a restore test using your backups to ensure that the backup files can be used for a successful restoration of your PostgreSQL database. This process can be automated using scripts and scheduled tasks.
|
||||
|
||||
* **Checksum Verification**: Use checksums during the backup process to validate the backed-up data. Checksums can help detect errors caused by corruption or data tampering. PostgreSQL provides built-in checksum support, which can be enabled at the database level.
|
||||
|
||||
* **File-Level Validation**: Compare the files in your backup with the source files in your PostgreSQL database. This will ensure that your backup contains all the necessary files and that their content matches the original data.
|
||||
|
||||
* **Backup Logs Monitoring**: Monitor and analyze the logs generated during your PostgreSQL backup process. Pay close attention to any warnings, errors, or unusual messages. Investigate and resolve any issues to maintain the integrity of your backups.
|
||||
|
||||
* **Automated Testing**: Set up automated tests to simulate a disaster recovery scenario and see if your backup can restore the database fully. This will not only validate your backups but also test the overall reliability of your recovery plan.
|
||||
|
||||
|
||||
- **Checksum Verification**: Use checksums during the backup process to validate the backed-up data. Checksums can help detect errors caused by corruption or data tampering. PostgreSQL provides built-in checksum support, which can be enabled at the database level.
|
||||
|
||||
- **File-Level Validation**: Compare the files in your backup with the source files in your PostgreSQL database. This will ensure that your backup contains all the necessary files and that their content matches the original data.
|
||||
|
||||
- **Backup Logs Monitoring**: Monitor and analyze the logs generated during your PostgreSQL backup process. Pay close attention to any warnings, errors, or unusual messages. Investigate and resolve any issues to maintain the integrity of your backups.
|
||||
|
||||
- **Automated Testing**: Set up automated tests to simulate a disaster recovery scenario and see if your backup can restore the database fully. This will not only validate your backups but also test the overall reliability of your recovery plan.
|
||||
|
||||
## Post-validation Actions
|
||||
Post-validation Actions
|
||||
-----------------------
|
||||
|
||||
After validating your backups, it's essential to document the results and address any issues encountered during the validation process. This may involve refining your backup and recovery strategies, fixing any errors or updating your scripts and tools.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@pg_verifybackup](https://www.postgresql.org/docs/current/app-pgverifybackup.html)
|
||||
- [@article@PostgreSQL Backup and Restore Validation](https://portal.nutanix.com/page/documents/solutions/details?targetId=NVD-2155-Nutanix-Databases:postgresql-backup-and-restore-validation.html)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Barman (Backup and Recovery Manager) is a robust tool designed for managing PostgreSQL backups and disaster recovery. It supports various backup types, including full and incremental backups, and provides features for remote backups, backup retention policies, and compression to optimize storage. Barman also offers point-in-time recovery (PITR) capabilities and integrates with PostgreSQL's WAL archiving to ensure data integrity. With its extensive monitoring and reporting capabilities, Barman helps database administrators automate and streamline backup processes, ensuring reliable and efficient recovery options in case of data loss or corruption.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@pgBarman Website](https://www.pgbarman.org/)
|
||||
- [@opensource@EnterpriseDB/barman](https://github.com/EnterpriseDB/barman)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
BRIN is an abbreviation for Block Range INdex which is an indexing technique introduced in PostgreSQL 9.5. This indexing strategy is best suited for large tables containing sorted data. It works by storing metadata regarding ranges of pages in the table. This enables quick filtering of data when searching for rows that match specific criteria. While not suitable for all tables and queries, they can significantly improve performance when used appropriately. Consider using a BRIN index when working with large tables with sorted or naturally ordered data.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@BRIN Indexes](https://www.postgresql.org/docs/17/brin.html)
|
||||
- [@article@Block Range INdexes](https://en.wikipedia.org/wiki/Block_Range_Index)
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
PostgreSQL uses a buffer pool to efficiently cache frequently accessed data pages in memory. The buffer pool is a fixed-size, shared memory area where database blocks are stored while they are being used, modified or read by the server. Buffer management is the process of efficiently handling these data pages to optimize performance.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@Buffer Manager](https://dev.to/vkt1271/summary-of-chapter-8-buffer-manager-from-the-book-the-internals-of-postgresql-part-2-4f6o)
|
||||
- [@official@pg_buffercache](https://www.postgresql.org/docs/current/pgbuffercache.html)
|
||||
- [@official@Write Ahead Logging](https://www.postgresql.org/docs/current/wal-intro.html)
|
||||
- [@official@Write Ahead Logging](https://www.postgresql.org/docs/current/wal-intro.html)
|
||||
- [@article@Buffer Manager](https://dev.to/vkt1271/summary-of-chapter-8-buffer-manager-from-the-book-the-internals-of-postgresql-part-2-4f6o)
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
Bulk load process data involves transferring large volumes of data from external files into the PostgreSQL database. This is an efficient way to insert massive amounts of data into your tables quickly, and it's ideal for initial data population or data migration tasks. Leveraging the `COPY` command or `pg_bulkload` utility in combination with best practices should help you load large datasets swiftly and securely.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Populating a Database](https://www.postgresql.org/docs/current/populate.html)
|
||||
- [@article@7 Best Practice Tips for PostgreSQL Bulk Data Loading](https://www.enterprisedb.com/blog/7-best-practice-tips-postgresql-bulk-data-loading)
|
||||
@@ -1,5 +1,5 @@
|
||||
# check_pgactivity
|
||||
|
||||
`check_pgactivity` is a PostgreSQL monitoring tool that provides detailed health and performance statistics for PostgreSQL databases. Designed to be used with the Nagios monitoring framework, it checks various aspects of PostgreSQL activity, including connection status, replication status, lock activity, and query performance. By collecting and presenting key metrics, `check_pgactivity` helps database administrators detect and troubleshoot performance issues, ensuring the database operates efficiently and reliably. The tool supports custom thresholds and alerting, making it a flexible solution for proactive database monitoring.
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@opensource@OPMDG/check_pgactivity](https://github.com/OPMDG/check_pgactivity)
|
||||
@@ -4,12 +4,11 @@ Monitoring `pgBackRest` helps ensure that your PostgreSQL backups are consistent
|
||||
|
||||
`pgBackRest` provides a built-in command called `check` which performs various checks to validate your repository and configuration settings. The command is executed as follows:
|
||||
|
||||
```sh
|
||||
pgbackrest --stanza=<stanza_name> check
|
||||
```
|
||||
pgbackrest --stanza=<stanza_name> check
|
||||
|
||||
|
||||
`<stanza_name>` should be replaced with the name of the stanza for which you want to verify the repository and configuration settings.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@pgBackRest Website](https://pgbackrest.org/)
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
|
||||
In PostgreSQL, checkpoints and the background writer are essential for maintaining data integrity and optimizing performance. Checkpoints periodically write all modified data (dirty pages) from the shared buffers to the disk, ensuring that the database can recover to a consistent state after a crash. This process is controlled by settings such as `checkpoint_timeout`, `checkpoint_completion_target`, and `max_wal_size`, balancing between write performance and recovery time. The background writer continuously flushes dirty pages to disk in the background, smoothing out the I/O workload and reducing the amount of work needed during checkpoints. This helps to maintain steady performance and avoid spikes in disk activity. Proper configuration of these mechanisms is crucial for ensuring efficient disk I/O management and overall database stability.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Checkpoints](https://www.postgresql.org/docs/current/sql-checkpoint.html)
|
||||
- [@article@What is a checkpoint?](https://www.cybertec-postgresql.com/en/postgresql-what-is-a-checkpoint/)
|
||||
- [@article@What are the difference between background writer and checkpoint in postgresql?](https://stackoverflow.com/questions/71534378/what-are-the-difference-between-background-writer-and-checkpoint-in-postgresql)
|
||||
- [@article@What are the difference between background writer and checkpoint in postgresql?](https://stackoverflow.com/questions/71534378/what-are-the-difference-between-background-writer-and-checkpoint-in-postgresql)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Chef is a powerful and widely-used configuration management tool that provides a simple yet customizable way to manage your infrastructure, including PostgreSQL installations. Chef is an open-source automation platform written in Ruby that helps users manage their infrastructure by creating reusable and programmable code, called "cookbooks" and "recipes", to define the desired state of your systems. It uses a client-server model and employs these cookbooks to ensure that your infrastructure is always in the desired state.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Chef Website](https://www.chef.io/products/chef-infra)
|
||||
- [@opensource@chef/chef](https://github.com/chef/chef)
|
||||
@@ -1,8 +1,8 @@
|
||||
# Columns in PostgreSQL
|
||||
|
||||
Columns are a fundamental component of PostgreSQL's object model. They are used to store the actual data within a table and define their attributes such as data type, constraints, and other properties.
|
||||
Columns are a fundamental component of PostgreSQL's object model. They are used to store the actual data within a table and define their attributes such as data type, constraints, and other properties.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Columns](https://www.postgresql.org/docs/current/ddl-alter.html)
|
||||
- [@article@PostgreSQL ADD COLUMN](https://www.w3schools.com/postgresql/postgresql_add_column.php)
|
||||
@@ -1,6 +1,6 @@
|
||||
# Configuring PostgreSQL
|
||||
|
||||
Configuring PostgreSQL involves modifying several key configuration files to optimize performance, security, and functionality. The primary configuration files are postgresql.conf, pg_hba.conf, and pg_ident.conf, typically located in the PostgreSQL data directory. By properly configuring these files, you can tailor PostgreSQL to better fit your specific needs and environment.
|
||||
Configuring PostgreSQL involves modifying several key configuration files to optimize performance, security, and functionality. The primary configuration files are postgresql.conf, pg\_hba.conf, and pg\_ident.conf, typically located in the PostgreSQL data directory. By properly configuring these files, you can tailor PostgreSQL to better fit your specific needs and environment.
|
||||
|
||||
Visit the following resources to learn more:
|
||||
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
# Connect Using `psql`
|
||||
# Connect Using psql
|
||||
|
||||
`psql` is an interactive command-line utility that enables you to interact with a PostgreSQL database server. Using `psql`, you can perform various SQL operations on your database.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@psql](https://www.postgresql.org/docs/current/app-psql.html#:~:text=psql%20is%20a%20terminal%2Dbased,and%20see%20the%20query%20results.)
|
||||
- [@article@psql guide](https://www.postgresguide.com/utilities/psql/)
|
||||
@@ -14,7 +14,7 @@ Constraints are an essential part of the relational model, as they define rules
|
||||
|
||||
**Exclusion** - An exclusion constraint is a more advanced form of constraint that allows you to specify conditions that should not exist when comparing multiple rows in a table. It helps maintain data integrity by preventing conflicts in data.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Constraints](https://www.postgresql.org/docs/current/ddl-constraints.html)
|
||||
- [@article@PostgreSQL - Constraints](https://www.tutorialspoint.com/postgresql/postgresql_constraints.htm)
|
||||
- [@article@PostgreSQL - Constraints](https://www.tutorialspoint.com/postgresql/postgresql_constraints.htm)
|
||||
@@ -4,7 +4,7 @@ Consul is a distributed, highly-available, and multi-datacenter aware service di
|
||||
|
||||
Consul uses a consensus protocol for leader election and ensures that only one server acts as a leader at any given time. This leader automatically takes over upon leader failure or shutdown, making the system resilient to outages. It provides a range of services like service discovery, health checking, key-value storage, and DNS services.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Consul by Hashicorp](https://www.consul.io/)
|
||||
- [@opensource@hashicorp/consul](https://github.com/hashicorp/consul)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
A core dump is a file that contains the memory image of a running process and its process status. It's typically generated when a program crashes or encounters an unrecoverable error, allowing developers to analyze the state of the program at the time of the crash. In the context of PostgreSQL, core dumps can help diagnose and fix issues with the database system.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@Core Dump](https://wiki.archlinux.org/title/Core_dump)
|
||||
- [@article@Enabling Core Dumps](https://wiki.postgresql.org/wiki/Getting_a_stack_trace_of_a_running_PostgreSQL_backend_on_Linux/BSD#Enabling_core_dumps)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
A Common Table Expression, also known as CTE, is a named temporary result set that can be referenced within a `SELECT`, `INSERT`, `UPDATE`, or `DELETE` statement. CTEs are particularly helpful when dealing with complex queries, as they enable you to break down the query into smaller, more readable chunks. Recursive CTEs are helpful when working with hierarchical or tree-structured data.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Common Table Expressions](https://www.postgresql.org/docs/current/queries-with.html)
|
||||
- [@article@PostgreSQL CTEs](https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-cte/)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Data partitioning is a technique that divides a large table into smaller, more manageable pieces called partitions. Each partition is a smaller table that stores a subset of the data, usually based on specific criteria such as ranges, lists, or hashes. Partitioning can improve query performance, simplifies data maintenance tasks, and optimizes resource utilization.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Table Partitioning](https://www.postgresql.org/docs/current/ddl-partitioning.html)
|
||||
- [@article@How to use Table Partitioning to Scale PostgreSQL](https://www.enterprisedb.com/postgres-tutorials/how-use-table-partitioning-scale-postgresql)
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
PostgreSQL offers a rich and diverse set of data types, catering to a wide range of applications and ensuring data integrity and performance. These include standard numeric types such as integers, floating-point numbers, and serial types for auto-incrementing fields. Character types like `VARCHAR` and `TEXT` handle varying lengths of text, while DATE, TIME, and TIMESTAMP support a variety of temporal data requirements. PostgreSQL also supports a comprehensive set of Boolean, enumerated (ENUM), and composite types, enabling more complex data structures. Additionally, it excels with its support for JSON and JSONB data types, allowing for efficient storage and querying of semi-structured data. The inclusion of array types, geometric data types, and the PostGIS extension for geographic data further extends PostgreSQL's versatility, making it a powerful tool for a broad spectrum of data management needs.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Data Types](https://www.postgresql.org/docs/current/datatype.html)
|
||||
- [@article@Introduction to PostgreSQL DataTypes](https://www.prisma.io/dataguide/postgresql/introduction-to-data-types)
|
||||
- [@article@PostgreSQL® Data Types: Mappings to SQL, JDBC, and Java Data Types](https://www.instaclustr.com/blog/postgresql-data-types-mappings-to-sql-jdbc-and-java-data-types/)
|
||||
- [@article@PostgreSQL® Data Types: Mappings to SQL, JDBC, and Java Data Types](https://www.instaclustr.com/blog/postgresql-data-types-mappings-to-sql-jdbc-and-java-data-types/)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
PostgreSQL offers a comprehensive set of data types to cater to diverse data needs, including numeric types like `INTEGER`, `FLOAT`, and `SERIAL` for auto-incrementing fields; character types such as `VARCHAR` and `TEXT` for variable-length text; and temporal types like `DATE`, `TIME`, and `TIMESTAMP` for handling date and time data. Additionally, PostgreSQL supports `BOOLEAN` for true/false values, `ENUM` for enumerated lists, and composite types for complex structures. It also excels with `JSON` and `JSONB` for storing and querying semi-structured data, arrays for storing multiple values in a single field, and geometric types for spatial data. These data types ensure flexibility and robust data management for various applications.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@PostgreSQL® Data Types: Mappings to SQL, JDBC, and Java Data Types](https://www.instaclustr.com/blog/postgresql-data-types-mappings-to-sql-jdbc-and-java-data-types/)
|
||||
- [@official@Data Types](https://www.postgresql.org/docs/current/datatype.html)
|
||||
- [@official@Data Types](https://www.postgresql.org/docs/current/datatype.html)
|
||||
- [@article@PostgreSQL® Data Types: Mappings to SQL, JDBC, and Java Data Types](https://www.instaclustr.com/blog/postgresql-data-types-mappings-to-sql-jdbc-and-java-data-types/)
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
In PostgreSQL, a database is a named collection of tables, indexes, views, stored procedures, and other database objects. Each PostgreSQL server can manage multiple databases, enabling the separation and organization of data sets for various applications, projects, or users.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Managing Databases](https://www.postgresql.org/docs/current/managing-databases.html)
|
||||
- [@official@Managing Databases](https://www.postgresql.org/docs/current/managing-databases.html)
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
PostgreSQL allows you to define object privileges for various types of database objects. These privileges determine if a user can access and manipulate objects like tables, views, sequences, or functions. In this section, we will focus on understanding default privileges in PostgreSQL.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@ALTER DEFAULT PRIVILEGES](https://www.postgresql.org/docs/current/sql-alterdefaultprivileges.html)
|
||||
- [@official@Privileges](https://www.postgresql.org/docs/current/ddl-priv.html)
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
"Depesz" is a popular, online query analysis tool for PostgreSQL, named after Hubert "depesz" Lubaczewski, the creator of the tool. It helps you understand and analyze the output of `EXPLAIN ANALYZE`, a powerful command in PostgreSQL for examining and optimizing your queries. Depesz is often used to simplify the query analysis process, as it offers valuable insights into the performance of your SQL queries and aids in tuning them for better efficiency.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Depesz Website](https://www.depesz.com/)
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
|
||||
In this section, we will discuss deploying PostgreSQL in the cloud. Deploying your PostgreSQL database in the cloud offers significant advantages such as scalability, flexibility, high availability, and cost reduction. There are several cloud providers that offer PostgreSQL as a service, which means you can quickly set up and manage your databases without having to worry about underlying infrastructure, backups, and security measures.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@5 Ways to Host PostgreSQL Databases](https://www.prisma.io/dataguide/postgresql/5-ways-to-host-postgresql)
|
||||
- [@article@Postgres On Kubernetes](https://cloudnative-pg.io/)
|
||||
- [@feed@Explore top posts about Cloud](https://app.daily.dev/tags/cloud?ref=roadmapsh)
|
||||
- [@feed@Explore top posts about Cloud](https://app.daily.dev/tags/cloud?ref=roadmapsh)
|
||||
@@ -4,7 +4,7 @@ Domains in PostgreSQL are essentially user-defined data types that can be create
|
||||
|
||||
To create a custom domain, you need to define a name for your domain, specify its underlying data type, and set any constraints or default values you want to apply. Domains in PostgreSQL are a great way to enforce data integrity and consistency in your relational database. They allow you to create custom data types based on existing data types with added constraints, default values, and validation rules. By using domains, you can streamline your database schema and ensure that your data complies with your business rules or requirements.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@CREATE DOMAIN](https://www.postgresql.org/docs/current/sql-createdomain.html)
|
||||
- [@official@Domain Types](https://www.postgresql.org/docs/current/domains.html)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
eBPF is a powerful Linux kernel technology used for tracing and profiling various system components such as processes, filesystems, network connections, and more. It has gained enormous popularity among developers and administrators because of its ability to offer deep insights into the system's behavior, performance, and resource usage at runtime. In the context of profiling PostgreSQL, eBPF can provide valuable information about query execution, system calls, and resource consumption patterns.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@What is eBPF? (Extended Berkeley Packet Filter)](https://www.kentik.com/kentipedia/what-is-ebpf-extended-berkeley-packet-filter/)
|
||||
- [@article@What is Extended Berkeley Packet Filter (eBPF)](https://www.sentinelone.com/cybersecurity-101/what-is-extended-berkeley-packet-filter-ebpf/)
|
||||
|
||||
@@ -4,8 +4,8 @@ Etcd is a distributed key-value store that provides an efficient and reliable me
|
||||
|
||||
Etcd can be utilized in conjunction with _connection poolers_ such as PgBouncer or HAProxy to improve PostgreSQL load balancing. By maintaining a list of active PostgreSQL servers' IP addresses and ports as keys in the store, connection poolers can fetch this information periodically to route client connections to the right servers. Additionally, transactional operations on the store can simplify the process of adding or removing nodes from the load balancer configuration while maintaining consistency.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@opensource@PostgreSQL High Availability with Etcd](https://github.com/patroni/patroni)
|
||||
- [@video@PostgreSQL High Availability](https://www.youtube.com/watch?v=J0ErkLo2b1E)
|
||||
- [@articles@etcd vs PostgreSQL](https://api7.ai/blog/etcd-vs-postgresql)
|
||||
- [@article@etcd vs PostgreSQL](https://api7.ai/blog/etcd-vs-postgresql)
|
||||
- [@video@PostgreSQL High Availability](https://www.youtube.com/watch?v=J0ErkLo2b1E)
|
||||
@@ -4,7 +4,7 @@ Understanding the performance and efficiency of your queries is crucial when wor
|
||||
|
||||
`EXPLAIN` generates a query execution plan without actually executing the query. It shows the nodes in the plan tree, the order in which they will be executed, and the estimated cost of each operation.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Using EXPLAIN](https://www.postgresql.org/docs/current/using-explain.html)
|
||||
- [@article@PostgreSQL EXPLAIN](https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-explain/)
|
||||
@@ -1,7 +1,7 @@
|
||||
# explain.dalibo.com
|
||||
|
||||
explain.dalibo.com is a free service that allows you to analyze the execution plan of your queries. It is based on the explain.depesz.com service.
|
||||
[explain.dalibo.com](http://explain.dalibo.com) is a free service that allows you to analyze the execution plan of your queries. It is based on the [explain.depesz.com](http://explain.depesz.com) service.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@explain.dalibo.com](https://explain.dalibo.com/)
|
||||
- [@official@explain.dalibo.com](https://explain.dalibo.com/)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Filtering data is an essential feature in any database management system, and PostgreSQL is no exception. When we refer to filtering data, we're talking about selecting a particular subset of data that fulfills specific criteria or conditions. In PostgreSQL, we use the **WHERE** clause to filter data in a query based on specific conditions.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@How to Filter Query Results in PostgreSQL](https://www.prisma.io/dataguide/postgresql/reading-and-querying-data/filtering-data)
|
||||
- [@article@Using PostgreSQL FILTER](https://www.crunchydata.com/blog/using-postgres-filter)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
A schema is a logical collection of database objects within a PostgreSQL database. It behaves like a namespace that allows you to group and isolate your database objects separately from other schemas. The primary goal of a schema is to organize your database structure, making it easier to manage and maintain. By default, every PostgreSQL database has a `public` schema, which is the default search path for any unqualified table or other database object.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Schemas](https://www.postgresql.org/docs/current/ddl-schemas.html)
|
||||
- [@article@PostgreSQL Schema](https://hasura.io/learn/database/postgresql/core-concepts/1-postgresql-schema/)
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
The primary DDL statements for creating and managing tables in PostgreSQL include `CREATE TABLE`, `ALTER TABLE`, and `DROP TABLE`, these DDL commands allow you to create, modify, and delete tables and their structures, providing a robust framework for database schema management in PostgreSQL.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@CREATE TABLE](https://www.postgresql.org/docs/current/sql-createtable.html)
|
||||
- [@official@DROP TABLE](https://www.postgresql.org/docs/current/sql-droptable.html)
|
||||
- [@official@ALTER TABLE](https://www.postgresql.org/docs/current/sql-altertable.html)
|
||||
- [@official@ALTER TABLE](https://www.postgresql.org/docs/current/sql-altertable.html)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
GDB, the GNU Debugger, is a powerful debugging tool that provides inspection and modification features for applications written in various programming languages, including C, C++, and Fortran. GDB can be used alongside PostgreSQL for investigating backend processes and identifying potential issues that might not be apparent at the application level.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@GDB](https://sourceware.org/gdb/)
|
||||
- [@article@Learn how to use GDB](https://opensource.com/article/21/3/debug-code-gdb)
|
||||
+12
-6
@@ -2,27 +2,33 @@
|
||||
|
||||
PostgreSQL is an open-source database system developed by a large and active community. By getting involved in the development process, you can help contribute to its growth, learn new skills, and collaborate with other developers around the world. In this section, we'll discuss some ways for you to participate in the PostgreSQL development community.
|
||||
|
||||
## Join Mailing Lists and Online Forums
|
||||
Join Mailing Lists and Online Forums
|
||||
------------------------------------
|
||||
|
||||
Join various PostgreSQL mailing lists, such as the general discussion list (_pgsql-general_), the development list (_pgsql-hackers_), or other specialized lists to stay up-to-date on discussions related to the project. You can also participate in PostgreSQL-related forums, like Stack Overflow or Reddit, to engage with fellow developers, ask questions, and provide assistance to others.
|
||||
|
||||
## Bug Reporting and Testing
|
||||
Bug Reporting and Testing
|
||||
-------------------------
|
||||
|
||||
Reporting bugs and testing new features are invaluable contributions to improving the quality and stability of PostgreSQL. Before submitting a bug report, make sure to search the official bug tracking system to see if the issue has already been addressed. Additionally, consider testing patches submitted by other developers or contributing tests for new features or functionalities.
|
||||
|
||||
## Contribute Code
|
||||
Contribute Code
|
||||
---------------
|
||||
|
||||
Contributing code can range from fixing small bugs or optimizing existing features, to adding entirely new functionalities. To start contributing to the PostgreSQL source code, you'll need to familiarize yourself with the [PostgreSQL coding standards](https://www.postgresql.org/docs/current/source.html) and submit your changes as patches through the PostgreSQL mailing list. Make sure to follow the [patch submission guidelines](https://wiki.postgresql.org/wiki/Submitting_a_Patch) to ensure that your contributions are properly reviewed and considered.
|
||||
|
||||
## Documentation and Translations
|
||||
Documentation and Translations
|
||||
------------------------------
|
||||
|
||||
Improving and expanding the official PostgreSQL documentation is crucial for providing accurate and up-to-date information to users. If you have expertise in a particular area, you can help by updating the documentation. Additionally, translating the documentation or interface messages into other languages can help expand the PostgreSQL community by providing resources for non-English speakers.
|
||||
|
||||
## Offer Support and Help Others
|
||||
Offer Support and Help Others
|
||||
-----------------------------
|
||||
|
||||
By helping others in the community, you not only contribute to the overall growth and development of PostgreSQL but also develop your own knowledge and expertise. Participate in online discussions, answer questions, conduct workshops or webinars, and share your experiences and knowledge to help others overcome challenges they may be facing.
|
||||
|
||||
## Advocate for PostgreSQL
|
||||
Advocate for PostgreSQL
|
||||
-----------------------
|
||||
|
||||
Promoting and advocating for PostgreSQL in your organization and network can help increase its adoption and visibility. Share your success stories, give talks at conferences, write blog posts, or create tutorials to help encourage more people to explore PostgreSQL as a go-to solution for their database needs.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Generalized Inverted Index (GIN) is a powerful indexing method in PostgreSQL that can be used for complex data types such as arrays, text search, and more. GIN provides better search capabilities for non-traditional data types, while also offering efficient and flexible querying.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@GIN Introduction](https://www.postgresql.org/docs/current/gin-intro.html)
|
||||
- [@article@Generalized Inverted Indexes](https://www.cockroachlabs.com/docs/stable/inverted-indexes)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
The Generalized Search Tree (GiST) is a powerful and flexible index type in PostgreSQL that serves as a framework to implement different indexing strategies. GiST provides a generic infrastructure for building custom indexes, extending the core capabilities of PostgreSQL. This powerful indexing framework allows you to extend PostgreSQL's built-in capabilities, creating custom indexing strategies aligned with your specific requirements.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@GIST Indexes](https://www.postgresql.org/docs/8.1/gist.html)
|
||||
- [@article@Generalized Search Trees for Database Systems](https://www.vldb.org/conf/1995/P562.PDF)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Golden Signals are a set of metrics that help monitor application performance and health, particularly in distributed systems. These metrics are derived from Google's Site Reliability Engineering (SRE) practices and can be easily applied to PostgreSQL troubleshooting methods. By monitoring these four key signals – latency, traffic, errors, and saturation – you can gain a better understanding of your PostgreSQL database's overall performance and health, as well as quickly identify potential issues.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@The Four Golden Signals](https://sre.google/sre-book/monitoring-distributed-systems/#xref_monitoring_golden-signals)
|
||||
- [@article@4 SRE Golden Signals (What they are and why they matter)](https://www.blameless.com/blog/4-sre-golden-signals-what-they-are-and-why-they-matter)
|
||||
@@ -1,8 +1,8 @@
|
||||
# Grant and Revoke Privileges in PostgreSQL
|
||||
|
||||
One of the most important aspects of database management is providing appropriate access permissions to users. In PostgreSQL, this can be achieved with the `GRANT` and `REVOKE` commands, which allow you to manage the privileges of database objects such as tables, sequences, functions, and schemas.
|
||||
One of the most important aspects of database management is providing appropriate access permissions to users. In PostgreSQL, this can be achieved with the `GRANT` and `REVOKE` commands, which allow you to manage the privileges of database objects such as tables, sequences, functions, and schemas.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@GRANT](https://www.postgresql.org/docs/current/sql-grant.html)
|
||||
- [@official@REVOKE](https://www.postgresql.org/docs/current/sql-revoke.html)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Grep is a powerful command-line tool used for searching plain-text data sets against specific patterns. It was originally developed for the Unix operating system and has since become available on almost every platform. When analyzing PostgreSQL logs, you may find the `grep` command an incredibly useful resource for quickly finding specific entries or messages.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@grep command in Linux/Unix](https://www.digitalocean.com/community/tutorials/grep-command-in-linux-unix)
|
||||
- [@article@Use the Grep Command](https://docs.rackspace.com/docs/use-the-linux-grep-command)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Grouping is a powerful technique in SQL that allows you to organize and aggregate data based on common values in one or more columns. The `GROUP BY` clause is used to create groups, and the `HAVING` clause is used to filter the group based on certain conditions.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@PostgreSQL GROUP BY CLAUSE](https://www.postgresql.org/docs/current/sql-select.html#SQL-GROUPBY)
|
||||
- [@article@PostgreSQL GROUP BY](https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-group-by/)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
HAProxy, short for High Availability Proxy, is a popular open-source software used to provide high availability, load balancing, and proxying features for TCP and HTTP-based applications. It is commonly used to improve the performance, security, and reliability of web applications, databases, and other services. When it comes to load balancing in PostgreSQL, HAProxy is a popular choice due to its flexibility and efficient performance. By distributing incoming database connections across multiple instances of your PostgreSQL cluster, HAProxy can help you achieve better performance, high availability, and fault tolerance.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@HAProxy Website](https://www.haproxy.org/)
|
||||
- [@article@An Introduction to HAProxy and Load Balancing Concepts](https://www.digitalocean.com/community/tutorials/an-introduction-to-haproxy-and-load-balancing-concepts)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Hash Indexes are a type of database index that uses a hash function to map each row's key value into a fixed-length hashed key. The purpose of using a hash index is to enable quicker search operations by converting the key values into a more compact and easily searchable format.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Hash](https://www.postgresql.org/docs/current/indexes-types.html#INDEXES-TYPES-HASH)
|
||||
- [@article@Re-Introducing Hash Indexes in PostgreSQL](https://hakibenita.com/postgresql-hash-index)
|
||||
@@ -4,7 +4,7 @@ Helm is a popular package manager for Kubernetes that allows you to easily deplo
|
||||
|
||||
Helm streamlines the installation process by providing ready-to-use packages called "charts". A Helm chart is a collection of YAML files, templates, and manifests, that describe an application's required resources and configurations.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Helm Website](https://helm.sh/)
|
||||
- [@opensource@helm/helm](https://github.com/helm/helm)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Hybrid Transactional/Analytical Processing (HTAP) in PostgreSQL refers to a database system's ability to efficiently handle both Online Transaction Processing (OLTP) and Online Analytical Processing (OLAP) workloads simultaneously. PostgreSQL achieves this through its robust architecture, which supports ACID transactions for OLTP and advanced analytical capabilities for OLAP. Key features include Multi-Version Concurrency Control (MVCC) for high concurrency, partitioning and parallel query execution for performance optimization, and extensions like PL/pgSQL for complex analytics. PostgreSQL's ability to manage transactional and analytical tasks in a unified system reduces data latency and improves real-time decision-making, making it an effective platform for HTAP applications.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@HTAP: Hybrid Transactional and Analytical Processing](https://www.snowflake.com/guides/htap-hybrid-transactional-and-analytical-processing/)
|
||||
- [@article@What is HTAP?](https://planetscale.com/blog/what-is-htap)
|
||||
+1
-1
@@ -4,7 +4,7 @@ In PostgreSQL, one of the fastest and most efficient ways to import and export d
|
||||
|
||||
If you can't use the `COPY` command due to lack of privileges, consider using the `\copy` command in the `psql` client instead, which works similarly, but runs as the current user rather than the PostgreSQL server.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@COPY](https://www.postgresql.org/docs/current/sql-copy.html)
|
||||
- [@article@Copying Data Between Tables in PostgreSQL](https://www.atlassian.com/data/sql/copying-data-between-tables)
|
||||
+8
-8
@@ -2,11 +2,11 @@
|
||||
|
||||
Indexes in PostgreSQL improve query performance by allowing faster data retrieval. Common use cases include:
|
||||
|
||||
- Primary and Unique Keys: Ensure fast access to rows based on unique identifiers.
|
||||
- Foreign Keys: Speed up joins between related tables.
|
||||
- Search Queries: Optimize searches on large text fields with full-text search indexes.
|
||||
- Range Queries: Improve performance for range-based queries on date, time, or numerical fields.
|
||||
- Partial Indexes: Create indexes on a subset of data, useful for frequently queried columns with specific conditions.
|
||||
- Expression Indexes: Index expressions or functions, enhancing performance for queries involving complex calculations.
|
||||
- Composite Indexes: Optimize multi-column searches by indexing multiple fields together.
|
||||
- GIN and GiST Indexes: Enhance performance for array, JSONB, and geometric data types.
|
||||
* Primary and Unique Keys: Ensure fast access to rows based on unique identifiers.
|
||||
* Foreign Keys: Speed up joins between related tables.
|
||||
* Search Queries: Optimize searches on large text fields with full-text search indexes.
|
||||
* Range Queries: Improve performance for range-based queries on date, time, or numerical fields.
|
||||
* Partial Indexes: Create indexes on a subset of data, useful for frequently queried columns with specific conditions.
|
||||
* Expression Indexes: Index expressions or functions, enhancing performance for queries involving complex calculations.
|
||||
* Composite Indexes: Optimize multi-column searches by indexing multiple fields together.
|
||||
* GIN and GiST Indexes: Enhance performance for array, JSONB, and geometric data types.
|
||||
@@ -6,4 +6,4 @@ Visit the following resources to learn more:
|
||||
|
||||
- [@official@PostgreSQL](https://www.postgresql.org/)
|
||||
- [@official@PostgreSQL Documentation](https://www.postgresql.org/docs/)
|
||||
- [@article@History of POSTGRES to PostgreSQL](https://www.postgresql.org/docs/current/history.html)
|
||||
- [@article@History of POSTGRES to PostgreSQL](https://www.postgresql.org/docs/current/history.html)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
`iotop` is an essential command-line utility that provides real-time insights into the input/output (I/O) activities of processes running on your system. This tool is particularly useful when monitoring and managing your PostgreSQL database's performance, as it helps system administrators or database developers to identify processes with high I/O, leading to potential bottlenecks or server optimization opportunities.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@Linux iotop Check What’s Stressing & Increasing Load On Hard Disks](https://www.cyberciti.biz/hardware/linux-iotop-simple-top-like-io-monitor/)
|
||||
- [@article@iotop man page](https://linux.die.net/man/1/iotop)
|
||||
@@ -1,7 +1,7 @@
|
||||
# Joining Tables
|
||||
|
||||
Joining tables is a fundamental operation in the world of databases. It allows you to combine information from multiple tables based on common columns. PostgreSQL provides various types of joins, such as Inner Join, Left Join, Right Join, and Full Outer Join.
|
||||
Joining tables is a fundamental operation in the world of databases. It allows you to combine information from multiple tables based on common columns. PostgreSQL provides various types of joins, such as Inner Join, Left Join, Right Join, and Full Outer Join.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Joins Between Tables](https://www.postgresql.org/docs/current/tutorial-join.html)
|
||||
- [@official@Joins Between Tables](https://www.postgresql.org/docs/current/tutorial-join.html)
|
||||
@@ -4,8 +4,8 @@ Keepalived is a robust and widely-used open-source solution for load balancing a
|
||||
|
||||
Keepalived achieves this by utilizing the Linux Virtual Server (LVS) module and the Virtual Router Redundancy Protocol (VRRP). For PostgreSQL database systems, Keepalived can be an advantageous addition to your infrastructure by offering fault tolerance and load balancing. With minimal configuration, it distributes read-only queries among multiple replicated PostgreSQL servers or divides transaction processing across various nodes – ensuring an efficient and resilient system.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Keepalived](https://www.keepalived.org/)
|
||||
- [@opensource@acassen/keepalived](https://github.com/acassen/keepalived)
|
||||
- [@article@Keepalived: High Availability for Self-hosted Services](https://www.virtualizationhowto.com/2023/09/keepalived-high-availability-for-self-hosted-services/)
|
||||
- [@article@Keepalived: High Availability for Self-hosted Services](https://www.virtualizationhowto.com/2023/09/keepalived-high-availability-for-self-hosted-services/)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Lateral join allows you to reference columns from preceding tables in a query, making it possible to perform complex operations that involve correlated subqueries and the application of functions on tables in a cleaner and more effective way. The `LATERAL` keyword in PostgreSQL is used in conjunction with a subquery in the `FROM` clause of a query. It helps you to write more concise and powerful queries, as it allows the subquery to reference columns from preceding tables in the query.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@LATERAL Subqueries](https://www.postgresql.org/docs/current/queries-table-expressions.html#QUERIES-LATERAL)
|
||||
- [@article@How to use lateral join in PostgreSQL](https://popsql.com/learn-sql/postgresql/how-to-use-lateral-joins-in-postgresql)
|
||||
@@ -5,4 +5,4 @@ SQL stands for Structured Query Language. It is a standardized programming langu
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@roadmap@Visit Dedicated SQL Roadmap](https://roadmap.sh/sql)
|
||||
- [@article@SQL Tutorial - Essential SQL For The Beginners](https://www.sqltutorial.org/)
|
||||
- [@article@SQL Tutorial - Essential SQL For The Beginners](https://www.sqltutorial.org/)
|
||||
@@ -4,7 +4,7 @@ Lock management in PostgreSQL is implemented using a lightweight mechanism that
|
||||
|
||||
There are various types of lock modes available, such as `AccessShareLock`, `RowExclusiveLock`, `ShareUpdateExclusiveLock`, etc. Each lock mode determines the level of compatibility with other lock modes, allowing or preventing specific operations on the locked object.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Lock Management](https://www.postgresql.org/docs/current/runtime-config-locks.html)
|
||||
- [@article@Understanding Postgres Locks and Managing Concurrent Transactions](https://medium.com/@sonishubham65/understanding-postgres-locks-and-managing-concurrent-transactions-1ededce53d59)
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
Logical replication in PostgreSQL allows the selective replication of data between databases, providing flexibility in synchronizing data across different systems. Unlike physical replication, which copies entire databases or clusters, logical replication operates at a finer granularity, allowing the replication of individual tables or specific subsets of data. This is achieved through the use of replication slots and publications/subscriptions. A publication defines a set of changes (INSERT, UPDATE, DELETE) to be replicated, and a subscription subscribes to these changes from a publisher database to a subscriber database. Logical replication supports diverse use cases such as real-time data warehousing, database migration, and multi-master replication, where different nodes can handle both reads and writes. Configuration involves creating publications on the source database and corresponding subscriptions on the target database, ensuring continuous, asynchronous data flow with minimal impact on performance.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Logical Replication](https://www.postgresql.org/docs/current/logical-replication.html)
|
||||
- [@article@Logical Replication in PostgreSQL Explained](https://www.enterprisedb.com/postgres-tutorials/logical-replication-postgresql-explained)
|
||||
|
||||
@@ -7,9 +7,9 @@ PostgreSQL's development community offers a variety of mailing lists for discuss
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Mailing List Etiquette](https://www.postgresql.org/community/lists/etiquette/)
|
||||
- [@official@pgsql-hackers Subscription](https://www.postgresql.org/list/pgsql-hackers/)
|
||||
- [@official@pgsql-announce Subscription](https://www.postgresql.org/list/pgsql-announce/)
|
||||
- [@official@pgsql-general Subscription](https://www.postgresql.org/list/pgsql-general/)
|
||||
- [@official@pgsql-novice Subscription](https://www.postgresql.org/list/pgsql-novice/)
|
||||
- [@official@pgsql-docs Subscription](https://www.postgresql.org/list/pgsql-docs/)
|
||||
- [@official@pgsql-hackers Subscription](https://www.postgresql.org/list/pgsql-hackers/)
|
||||
- [@official@pgsql-announce Subscription](https://www.postgresql.org/list/pgsql-announce/)
|
||||
- [@official@pgsql-general Subscription](https://www.postgresql.org/list/pgsql-general/)
|
||||
- [@official@pgsql-novice Subscription](https://www.postgresql.org/list/pgsql-novice/)
|
||||
- [@official@pgsql-docs Subscription](https://www.postgresql.org/list/pgsql-docs/)
|
||||
- [@official@PostgreSQL Mailing Lists page](https://www.postgresql.org/list/)
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
# liquibase, sqitch, Bytebase, ora2pg etc
|
||||
|
||||
Migrations are crucial in the lifecycle of database applications. As the application evolves, changes to the database schema and sometimes data itself become necessary.
|
||||
Migrations are crucial in the lifecycle of database applications. As the application evolves, changes to the database schema and sometimes data itself become necessary.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Liquibase Website](https://www.liquibase.com/)
|
||||
- [@official@Sqitch Website](https://sqitch.org/)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Modifying data in PostgreSQL is an essential skill when working with databases. The primary DML queries used to modify data are `INSERT`, `UPDATE`, and `DELETE`.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@INSERT](https://www.postgresql.org/docs/current/sql-insert.html)
|
||||
- [@official@UPDATE](https://www.postgresql.org/docs/current/sql-update.html)
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
Data normalization in PostgreSQL involves organizing tables to minimize redundancy and ensure data integrity through a series of normal forms: First Normal Form (1NF) ensures each column contains atomic values and records are unique; Second Normal Form (2NF) requires that all non-key attributes are fully dependent on the primary key; Third Normal Form (3NF) eliminates transitive dependencies so non-key attributes depend only on the primary key; Boyce-Codd Normal Form (BCNF) further ensures that every determinant is a candidate key; Fourth Normal Form (4NF) removes multi-valued dependencies; and Fifth Normal Form (5NF) addresses join dependencies, ensuring tables are decomposed without loss of data integrity. These forms create a robust framework for efficient, consistent, and reliable database schema design.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@A Guide to Data Normalization in PostgreSQL ](https://www.cybertec-postgresql.com/en/data-normalization-in-postgresql/)
|
||||
- [@video@First normal form](https://www.youtube.com/watch?v=PCdZGzaxwXk)
|
||||
|
||||
@@ -6,4 +6,4 @@ Visit the following resources to learn more:
|
||||
|
||||
- [@official@Object Model](https://www.postgresql.org/docs/current/tutorial-concepts.html)
|
||||
- [@article@Understanding PostgreSQL: The Power of an Object-Relational](https://medium.com/@asadbukhari886/understanding-of-postgresql-the-power-of-an-object-relational-database-b6ae349c3f40)
|
||||
- [@article@PostgreSQL Server and Database Objects](https://neon.com/postgresql/postgresql-tutorial/postgresql-server-and-database-objects)
|
||||
- [@article@PostgreSQL Server and Database Objects](https://neon.com/postgresql/postgresql-tutorial/postgresql-server-and-database-objects)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Object privileges in PostgreSQL are the permissions given to different user roles to access or modify database objects like tables, views, sequences, and functions. Ensuring proper object privileges is crucial for maintaining a secure and well-functioning database.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@PostgreSQL Roles and Privileges Explained](https://www.aviator.co/blog/postgresql-roles-and-privileges-explained/)
|
||||
- [@article@What are Object Privileges?](https://www.prisma.io/dataguide/postgresql/authentication-and-authorization/managing-privileges#what-are-postgresql-object-privileges)
|
||||
- [@article@What are Object Privileges?](https://www.prisma.io/dataguide/postgresql/authentication-and-authorization/managing-privileges#what-are-postgresql-object-privileges)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Online Analytical Processing (OLAP) in PostgreSQL refers to a class of systems designed for query-intensive tasks, typically used for data analysis and business intelligence. OLAP systems handle complex queries that aggregate large volumes of data, often from multiple sources, to support decision-making processes. PostgreSQL supports OLAP workloads through features such as advanced indexing, table partitioning, and the ability to create materialized views for faster query performance. Additionally, PostgreSQL's support for parallel query execution and extensions like Foreign Data Wrappers (FDW) and PostGIS enhance its capability to handle large datasets and spatial data, making it a robust platform for analytical applications.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@Transforming Postgres into a Fast OLAP Database](https://blog.paradedb.com/pages/introducing_analytics)
|
||||
- [@video@Online Analytical Processing](https://www.youtube.com/watch?v=NuVAgAgemGI)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Online Transaction Processing (OLTP) in PostgreSQL refers to a class of systems designed to manage transaction-oriented applications, typically for data entry and retrieval transactions in database systems. OLTP systems are characterized by a large number of short online transactions (INSERT, UPDATE, DELETE), where the emphasis is on speed, efficiency, and maintaining data integrity in multi-access environments. PostgreSQL supports OLTP workloads through features like ACID compliance (Atomicity, Consistency, Isolation, Durability), MVCC (Multi-Version Concurrency Control) for high concurrency, efficient indexing, and robust transaction management. These features ensure reliable, fast, and consistent processing of high-volume, high-frequency transactions critical to OLTP applications.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@video@OLTP vs OLAP](https://www.youtube.com/watch?v=iw-5kFzIdgY)
|
||||
- [@article@What is OLTP?](https://www.oracle.com/uk/database/what-is-oltp/)
|
||||
- [@article@What is OLTP?](https://www.oracle.com/uk/database/what-is-oltp/)
|
||||
- [@video@OLTP vs OLAP](https://www.youtube.com/watch?v=iw-5kFzIdgY)
|
||||
@@ -1,6 +1,6 @@
|
||||
# Operators in Kubernetes Deployment
|
||||
|
||||
Operators in Kubernetes are software extensions that use custom resources to manage applications and their components. They encapsulate operational knowledge and automate complex tasks such as deployments, backups, and scaling. Using Custom Resource Definitions (CRDs) and custom controllers, Operators continuously monitor the state of the application and reconcile it with the desired state, ensuring the system is self-healing and resilient. Popular frameworks for building Operators include the Operator SDK, Kubebuilder, and Metacontroller, which simplify the process and enhance Kubernetes' capability to manage stateful and complex applications efficiently.
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@roadmap@Visit Dedicated Kubernetes Roadmap](https://roadmap.sh/kubernetes)
|
||||
- [@official@Kubernetes](https://kubernetes.io/)
|
||||
|
||||
+2
-2
@@ -2,11 +2,11 @@
|
||||
|
||||
While Patroni is a popular choice for managing PostgreSQL clusters, there are several other tools and frameworks available that you might consider as alternatives to Patroni. Each of these has its unique set of features and benefits, and some may be better suited to your specific requirements or use-cases.
|
||||
|
||||
Several alternatives to Patroni exist for PostgreSQL cluster management, each with unique features catering to specific needs. **Stolon**, a cloud-native manager by Sorint.lab, ensures high availability and seamless scaling. **Pgpool-II**, by the Pgpool Global Development Group, offers load balancing, connection pooling, and high availability. **Repmgr**, developed by 2ndQuadrant, simplifies replication and cluster administration. **PAF (PostgreSQL Automatic Failover)**, created by Dalibo, provides lightweight failover management using Pacemaker and Corosync. These tools present diverse options for managing PostgreSQL clusters effectively.
|
||||
Several alternatives to Patroni exist for PostgreSQL cluster management, each with unique features catering to specific needs. **Stolon**, a cloud-native manager by Sorint.lab, ensures high availability and seamless scaling. **Pgpool-II**, by the Pgpool Global Development Group, offers load balancing, connection pooling, and high availability. **Repmgr**, developed by 2ndQuadrant, simplifies replication and cluster administration. **PAF (PostgreSQL Automatic Failover)**, created by Dalibo, provides lightweight failover management using Pacemaker and Corosync. These tools present diverse options for managing PostgreSQL clusters effectively.
|
||||
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@opensources@sorintlab/stolen](https://github.com/sorintlab/stolon)
|
||||
- [@official@RepMgr](https://repmgr.org/)
|
||||
- [@official@pgPool](https://www.pgpool.net/mediawiki/index.php/Main_Page)
|
||||
- [@opensource@dalibo/PAF](https://github.com/dalibo/PAF)
|
||||
- [@article@sorintlab/stolen](https://github.com/sorintlab/stolon)
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
Patroni is an open-source tool that automates the setup, management, and failover of PostgreSQL clusters, ensuring high availability. It leverages distributed configuration stores like Etcd, Consul, or ZooKeeper to maintain cluster state and manage leader election. Patroni continuously monitors the health of PostgreSQL instances, automatically promoting a replica to primary if the primary fails, minimizing downtime. It simplifies the complexity of managing PostgreSQL high availability by providing built-in mechanisms for replication, failover, and recovery, making it a robust solution for maintaining PostgreSQL clusters in production environments.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@opensource@zalando/patroni](https://github.com/zalando/patroni)
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
Practical patterns for implementing queues in PostgreSQL include using a dedicated table to store queue items, leveraging the `FOR` `UPDATE` `SKIP` `LOCKED` clause to safely dequeue items without conflicts, and partitioning tables to manage large volumes of data efficiently. Employing batch processing can also enhance performance by processing multiple queue items in a single transaction. Antipatterns to avoid include using high-frequency polling, which can lead to excessive database load, and not handling concurrency properly, which can result in data races and deadlocks. Additionally, storing large payloads directly in the queue table can degrade performance; instead, store references to the payloads. By following these patterns and avoiding antipatterns, you can build efficient and reliable queuing systems in PostgreSQL.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@Postgres as Queue](https://leontrolski.github.io/postgres-as-queue.html)
|
||||
- [@video@Can PostgreSQL Replace Your Messaging Queue?](https://www.youtube.com/watch?v=IDb2rKhzzt8)
|
||||
+3
-3
@@ -2,9 +2,9 @@
|
||||
|
||||
In PostgreSQL, per-user and per-database settings allow administrators to customize configurations for specific users or databases, enhancing performance and management. These settings are managed using the ALTER ROLE and ALTER DATABASE commands.
|
||||
|
||||
These commands store the settings in the system catalog and apply them whenever the user connects to the database or the database is accessed. Commonly customized parameters include search_path, work_mem, and maintenance_work_mem, allowing fine-tuned control over query performance and resource usage tailored to specific needs.
|
||||
These commands store the settings in the system catalog and apply them whenever the user connects to the database or the database is accessed. Commonly customized parameters include search\_path, work\_mem, and maintenance\_work\_mem, allowing fine-tuned control over query performance and resource usage tailored to specific needs.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@ALTER ROLE](https://www.postgresql.org/docs/current/sql-alterrole.html)
|
||||
- [@official@ALTER DATABASE](https://www.postgresql.org/docs/current/sql-alterdatabase.html)
|
||||
- [@official@ALTER DATABASE](https://www.postgresql.org/docs/current/sql-alterdatabase.html)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Perf tools is a suite of performance analysis tools that comes as part of the Linux kernel. It enables you to monitor various performance-related events happening in your system, such as CPU cycles, instructions executed, cache misses, and other hardware-related metrics. These tools can be helpful in understanding the bottlenecks and performance issues in your PostgreSQL instance and can be used to discover areas of improvement.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@Profiling with Linux perf tool](https://mariadb.com/kb/en/profiling-with-linux-perf-tool/)
|
||||
- [@official@perf: Linux profiling with performance counters ](https://perf.wiki.kernel.org/index.php/Main_Page)
|
||||
- [@official@perf: Linux profiling with performance counters ](https://perf.wiki.kernel.org/index.php/Main_Page)
|
||||
- [@article@Profiling with Linux perf tool](https://mariadb.com/kb/en/profiling-with-linux-perf-tool/)
|
||||
@@ -1,7 +1,7 @@
|
||||
# PEV2
|
||||
|
||||
`pev2`, or *Postgres Explain Visualizer v2*, is an open-source tool designed to make query analysis with PostgreSQL easier and more understandable. By providing a visual representation of the `EXPLAIN ANALYZE` output, `pev2` simplifies query optimization by displaying the query plan and execution metrics in a readable structure.
|
||||
`pev2`, or _Postgres Explain Visualizer v2_, is an open-source tool designed to make query analysis with PostgreSQL easier and more understandable. By providing a visual representation of the `EXPLAIN ANALYZE` output, `pev2` simplifies query optimization by displaying the query plan and execution metrics in a readable structure.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@opensource@dalibo/pev2](https://github.com/dalibo/pev2)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
`pg_basebackup` is a utility for creating a physical backup of a PostgreSQL database cluster. It generates a consistent backup of the entire database cluster by copying data files while ensuring write operations do not interfere. Typically used for setting up streaming replication or disaster recovery, `pg_basebackup` can be run in parallel mode to speed up the process and can output backups in tar format or as a plain directory. It ensures minimal disruption to database operations during the backup process.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@pg_basebackup](https://www.postgresql.org/docs/current/app-pgbasebackup.html)
|
||||
- [@article@Understanding the new pg_basebackup options](https://www.postgresql.fastware.com/blog/understanding-the-new-pg_basebackup-options)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
`pg_dump` is a utility for backing up a PostgreSQL database by exporting its data and schema. Unlike `pg_basebackup`, which takes a physical backup of the entire cluster, `pg_dump` produces a logical backup of a single database. It can output data in various formats, including plain SQL, custom, directory, and tar, allowing for flexible restore options. `pg_dump` can be used to selectively backup specific tables, schemas, or data, making it suitable for tasks like migrating databases or creating development copies. The utility ensures the backup is consistent by using the database's built-in mechanisms to capture a snapshot of the data at the time of the dump.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@pg_dump](https://www.postgresql.org/docs/current/app-pgdump.html)
|
||||
- [@article@pg_dump - VMWare](https://docs.vmware.com/en/VMware-Greenplum/5/greenplum-database/utility_guide-client_utilities-pg_dump.html)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
`pg_dumpall` is a utility for backing up all databases in a PostgreSQL cluster, including cluster-wide data such as roles and tablespaces. It creates a plain text SQL script file that contains the commands to recreate the cluster's databases and their contents, as well as the global objects. This utility is useful for comprehensive backups where both database data and cluster-wide settings need to be preserved. Unlike `pg_dump`, which targets individual databases, `pg_dumpall` ensures that the entire PostgreSQL cluster can be restored from the backup, making it essential for complete disaster recovery scenarios.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@pg_dumpall](https://www.postgresql.org/docs/current/app-pg-dumpall.html)
|
||||
- [@article@pg_dump & pg_dumpall](https://www.postgresqltutorial.com/postgresql-administration/postgresql-backup-database/)
|
||||
@@ -1,7 +1,7 @@
|
||||
# PostgreSQL Security: pg_hba.conf
|
||||
|
||||
When securing your PostgreSQL database, one of the most important components to configure is the `pg_hba.conf` (short for PostgreSQL Host-Based Authentication Configuration) file. This file is a part of PostgreSQL's Host-Based Authentication (HBA) system and is responsible for controlling how clients authenticate and connect to your database.
|
||||
When securing your PostgreSQL database, one of the most important components to configure is the `pg_hba.conf` (short for PostgreSQL Host-Based Authentication Configuration) file. This file is a part of PostgreSQL's Host-Based Authentication (HBA) system and is responsible for controlling how clients authenticate and connect to your database.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@The pg_hba.conf file](https://www.postgresql.org/docs/current/auth-pg-hba-conf.html)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
`pg_probackup` is a backup and recovery manager for PostgreSQL, designed to handle periodic backups of PostgreSQL clusters. It supports incremental backups, merge strategies to avoid frequent full backups, validation, and parallelization for efficiency. It also offers features like backup from standby servers, remote operations, and compression. With support for PostgreSQL versions 11 through 16, it enables comprehensive management of backups and WAL archives, ensuring data integrity and efficient recovery processes.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@opensource@postgrespro/pg_probackup](https://github.com/postgrespro/pg_probackup)
|
||||
- [@official@PostgresPro Website](https://postgrespro.com/products/extensions/pg_probackup)
|
||||
- [@official@PostgresPro Website](https://postgrespro.com/products/extensions/pg_probackup)
|
||||
- [@opensource@postgrespro/pg_probackup](https://github.com/postgrespro/pg_probackup)
|
||||
@@ -1,6 +1,6 @@
|
||||
# pg_restore
|
||||
|
||||
`pg_restore` is a utility for restoring PostgreSQL database backups created by `pg_dump` in non-plain-text formats (custom, directory, or tar). It allows for selective restoration of database objects such as tables, schemas, or indexes, providing flexibility to restore specific parts of the database. `pg_restore` can also be used to reorder data load operations, create indexes and constraints after data load, and parallelize the restore process to speed up recovery. This utility ensures efficient and customizable restoration from logical backups.
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@pg_restore](https://www.postgresql.org/docs/current/app-pgrestore.html)
|
||||
- [@article@A guide to pg_restore](https://www.timescale.com/learn/a-guide-to-pg_restore-and-pg_restore-example)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
`pg_stat_activity` is a crucial system view in PostgreSQL that provides real-time information on current database connections and queries being executed. This view is immensely helpful when troubleshooting performance issues, identifying long-running or idle transactions, and managing the overall health of the database. `pg_stat_activity` provides you with valuable insights into database connections and queries, allowing you to monitor, diagnose, and act accordingly to maintain a robust and optimally performing system.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@pg_state_activity](https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW)
|
||||
- [@article@Understanding pg_stat_activity](https://www.depesz.com/2022/07/05/understanding-pg_stat_activity/)
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
**Pg Stat Statements** is a system view in PostgreSQL that provides detailed statistics on the execution of SQL queries. It is particularly useful for developers and database administrators to identify performance bottlenecks, optimize query performance, and troubleshoot issues. This view can be queried directly or accessed through various administration tools. To use Pg Stat Statements, you need to enable the `pg_stat_statements` extension by adding the following line to the `postgresql.conf` configuration file.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@pg_stat_statements](https://www.postgresql.org/docs/current/pgstatstatements.html)
|
||||
- [@article@Using pg_stat_statements to Optimize Queries](https://www.timescale.com/blog/using-pg-stat-statements-to-optimize-queries/)
|
||||
@@ -1,6 +1,6 @@
|
||||
# pgBackRest: A Comprehensive Backup and Recovery Solution
|
||||
|
||||
pgBackRest is a robust backup and restore solution for PostgreSQL, designed for high performance and reliability. It supports full, differential, and incremental backups, and provides features like parallel processing, backup validation, and compression to optimize storage and speed. pgBackRest also includes support for point-in-time recovery (PITR), encryption, and remote operations. Its configuration flexibility and extensive documentation make it suitable for various PostgreSQL deployment scenarios, ensuring efficient data protection and disaster recovery.
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@pgBackRest documentation](https://pgbackrest.org)
|
||||
- [@opensource@pgbackrest/pgbackrest](https://github.com/pgbackrest/pgbackrest)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
PgBadger is a fast, efficient PostgreSQL log analyzer and report generator. It parses PostgreSQL log files to generate detailed reports on database performance, query statistics, connection information, and more. PgBadger supports various log formats and provides insights into slow queries, index usage, and overall database activity. Its reports, typically in HTML format, include visual charts and graphs for easy interpretation. PgBadger is valuable for database administrators looking to optimize performance and troubleshoot issues based on log data.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@opensource@darold/pgbadger](https://github.com/darold/pgbadger)
|
||||
- [@article@PGBadger - Postgresql log analysis made easy](https://dev.to/full_stack_adi/pgbadger-postgresql-log-analysis-made-easy-54ki)
|
||||
+3
-3
@@ -2,8 +2,8 @@
|
||||
|
||||
Pgpool-II, HAProxy, and Odyssey are prominent tools for enhancing PostgreSQL performance and availability. **Pgpool-II** is a versatile connection pooler offering load balancing, replication, and connection limits to optimize performance. **HAProxy** excels as a load balancer for distributing connections across PostgreSQL servers, featuring health checks and SSL/TLS support for secure, high-availability setups. **Odyssey**, developed by Yandex, is a multithreaded connection pooler designed for high-performance deployments, providing advanced routing, transparent SSL, and load balancing capabilities tailored for large-scale systems.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@opensource@yandex/odyssey](https://github.com/yandex/odyssey)
|
||||
- [@official@HAProxy Website](http://www.haproxy.org/)
|
||||
- [@official@PGPool Website](https://www.pgpool.net/mediawiki/index.php/Main_Page)
|
||||
- [@official@PGPool Website](https://www.pgpool.net/mediawiki/index.php/Main_Page)
|
||||
- [@opensource@yandex/odyssey](https://github.com/yandex/odyssey)
|
||||
@@ -1,6 +1,6 @@
|
||||
# PgBouncer
|
||||
|
||||
PgBouncer is a lightweight connection pooler for PostgreSQL, designed to reduce the overhead associated with establishing new database connections. It sits between the client and the PostgreSQL server, maintaining a pool of active connections that clients can reuse, thus improving performance and resource utilization. PgBouncer supports multiple pooling modes, including session pooling, transaction pooling, and statement pooling, catering to different use cases and workloads. It is highly configurable, allowing for fine-tuning of connection limits, authentication methods, and other parameters to optimize database access and performance.
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@PgBouncer Website](https://www.pgbouncer.org/)
|
||||
- [@opensource@pgbouncer/pgbouncer](https://github.com/pgbouncer/pgbouncer)
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
`pgcenter` is a command-line tool that provides real-time monitoring and management for PostgreSQL databases. It offers a convenient interface for tracking various aspects of database performance, allowing users to quickly identify bottlenecks, slow queries, and other potential issues. With its numerous features and easy-to-use interface, `pgcenter` is an essential tool in the toolbox of anyone working with PostgreSQL databases.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@opensource@lesovsky/pgcenter](https://github.com/lesovsky/pgcenter)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
PgCluu is a powerful and easy-to-use PostgreSQL performance monitoring and tuning tool. This open-source program collects statistics and provides various metrics in order to analyze PostgreSQL databases, helping you discover performance bottlenecks and optimize your cluster's performance. Apart from PostgreSQL-specific settings, you can also tweak other options, such as the RRDtool's data file format (JPG or SVG), time range for graphs, and more.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@pgCluu Website](https://pgcluu.darold.net/)
|
||||
- [@opensource@darold/pgcluu](https://github.com/darold/pgcluu)
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
Skytools is a set of tools developed by Skype to assist with using PostgreSQL databases. One of the key components of Skytools is PGQ, a queuing system built on top of PostgreSQL that provides efficient and reliable data processing.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@opensource@PgQ — Generic Queue for PostgreSQL](https://github.com/pgq)
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
|
||||
PostgreSQL's physical storage and file layout optimize data management and performance through a structured organization within the data directory, which includes subdirectories like `base` for individual databases, `global` for cluster-wide tables, `pg_wal` for Write-Ahead Logs ensuring durability, and `pg_tblspc` for tablespaces allowing flexible storage management. Key configuration files like `postgresql.conf`, `pg_hba.conf`, and `pg_ident.conf` are also located here. This layout facilitates efficient data handling, recovery, and maintenance, ensuring robust database operations.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@What is $PGDATA in PostgreSQL?](https://stackoverflow.com/questions/26851709/what-is-pgdata-in-postgresql)
|
||||
- [@official@TOAST](https://www.postgresql.org/docs/current/storage-toast.html)
|
||||
- [@official@TOAST](https://www.postgresql.org/docs/current/storage-toast.html)
|
||||
- [@article@What is $PGDATA in PostgreSQL?](https://stackoverflow.com/questions/26851709/what-is-pgdata-in-postgresql)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
`PL/pgSQL` is a procedural language for the PostgreSQL database system that enables you to create stored procedures and functions using conditionals, loops, and other control structures, similar to a traditional programming language. Using PL/pgSQL, you can perform complex operations on the server-side, reducing the need to transfer data between the server and client. This can significantly improve performance, and it enables you to encapsulate and modularize your logic within the database.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@PL/pgSQL — SQL Procedural Language](https://www.postgresql.org/docs/current/plpgsql.html)
|
||||
- [@article@PostgreSQL PL/pgSQL](https://www.postgresqltutorial.com/postgresql-plpgsql/)
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
# PostgreSQL Anonymizer
|
||||
|
||||
PostgreSQL Anonymizer is an extension designed to mask or anonymize sensitive data within PostgreSQL databases. It provides various anonymization techniques, including randomization, generalization, and pseudonymization, to protect personal and sensitive information in compliance with data privacy regulations like GDPR. This extension can be configured to apply these techniques to specific columns or datasets, ensuring that the anonymized data remains useful for development, testing, or analysis without exposing actual sensitive information.
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@opensource@dalibo/postgresql_anonymizer](https://github.com/dalibo/postgresql_anonymizer)
|
||||
- [@official@PostgreSQL Anonymizer Website](https://postgresql-anonymizer.readthedocs.io/en/stable/)
|
||||
- [@official@PostgreSQL Anonymizer Website](https://postgresql-anonymizer.readthedocs.io/en/stable/)
|
||||
- [@opensource@dalibo/postgresql_anonymizer](https://github.com/dalibo/postgresql_anonymizer)
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
|
||||
PostgreSQL, a powerful open-source relational database system, excels in handling complex queries, ensuring data integrity, and supporting ACID transactions, making it ideal for applications requiring intricate data relationships and strong consistency. It offers advanced features like JSON support for semi-structured data, full-text search, and extensive indexing capabilities. In contrast, NoSQL databases, such as MongoDB or Cassandra, prioritize scalability and flexibility, often supporting schema-less designs that make them suitable for handling unstructured or semi-structured data and high-velocity workloads. These databases are typically used in scenarios requiring rapid development, horizontal scaling, and high availability, often at the cost of reduced consistency guarantees compared to PostgreSQL.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@What’s the Difference Between MongoDB and PostgreSQL?](https://aws.amazon.com/compare/the-difference-between-mongodb-and-postgresql/)
|
||||
- [@article@MongoDB vs PostgreSQL: 15 Critical Differences](https://kinsta.com/blog/mongodb-vs-postgresql/)
|
||||
- [@article@MongoDB vs. PostgreSQL: Key differences and when to use each](https://roadmap.sh/mongodb/vs-postgresql)
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
PostgreSQL stands out among other RDBMS options due to its open-source nature, advanced features, and robust performance. Unlike proprietary systems like Oracle or Microsoft SQL Server, PostgreSQL is free to use and highly extensible, allowing users to add custom functions, data types, and operators. It supports a wide range of indexing techniques and provides advanced features such as full-text search, JSON support, and geographic information system (GIS) capabilities through PostGIS. Additionally, PostgreSQL's strong adherence to SQL standards ensures compatibility and ease of migration. While systems like MySQL are also popular and known for their speed in read-heavy environments, PostgreSQL often surpasses them in terms of functionality and compliance with ACID properties, making it a versatile choice for complex, transactional applications.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@PostgreSQL vs MySQL: The Critical Differences](https://www.integrate.io/blog/postgresql-vs-mysql-which-one-is-better-for-your-use-case/)
|
||||
- [@article@Whats the difference between PostgreSQL and MySQL?](https://aws.amazon.com/compare/the-difference-between-mysql-vs-postgresql/)
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
Practical patterns for PostgreSQL migrations include using version control tools like Liquibase or Flyway to manage schema changes, applying incremental updates to minimize risk, maintaining backward compatibility during transitions, and employing zero-downtime techniques like rolling updates. Data migration scripts should be thoroughly tested in staging environments to ensure accuracy. Employing transactional DDL statements helps ensure atomic changes, while monitoring and having rollback plans in place can quickly address any issues. These strategies ensure smooth, reliable migrations with minimal application disruption.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@Liquibase Website](https://www.liquibase.com/)
|
||||
- [@official@Flyway Website](https://flywaydb.org/)
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
In PostgreSQL, functions and procedures encapsulate reusable logic within the database to enhance performance and maintain organization. Functions return a value or a table, take input parameters, and are used in SQL queries, defined with `CREATE FUNCTION`. Procedures, introduced in PostgreSQL 11, do not return values but can perform actions and include transaction control commands like `COMMIT` and `ROLLBACK`, defined with `CREATE PROCEDURE` and called using the `CALL` statement. Key differences include functions' mandatory return value and integration in SQL queries, while procedures focus on performing operations and managing transactions.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@official@CREATE PROCEDURE](https://www.postgresql.org/docs/current/sql-createprocedure.html)
|
||||
- [@official@CREATE FUNCTION](https://www.postgresql.org/docs/current/sql-createfunction.html)
|
||||
|
||||
+5
-5
@@ -2,12 +2,12 @@
|
||||
|
||||
PostgreSQL’s process memory architecture is designed to efficiently manage resources and ensure performance. It consists of several key components:
|
||||
|
||||
- Shared Memory: This is used for data that needs to be accessed by all server processes, such as the shared buffer pool (shared_buffers), which caches frequently accessed data pages, and the Write-Ahead Log (WAL) buffers (wal_buffers), which store transaction log data before it is written to disk.
|
||||
- Local Memory: Each PostgreSQL backend process (one per connection) has its own local memory for handling query execution. Key components include the work memory (work_mem) for sorting operations and hash tables, and the maintenance work memory (maintenance_work_mem) for maintenance tasks like vacuuming and index creation.
|
||||
- Process-specific Memory: Each process allocates memory dynamically as needed for tasks like query parsing, planning, and execution. Memory contexts within each process ensure efficient memory usage and cleanup.
|
||||
- Temporary Files: For operations that exceed available memory, such as large sorts or hash joins, PostgreSQL spills data to temporary files on disk.
|
||||
* Shared Memory: This is used for data that needs to be accessed by all server processes, such as the shared buffer pool (shared\_buffers), which caches frequently accessed data pages, and the Write-Ahead Log (WAL) buffers (wal\_buffers), which store transaction log data before it is written to disk.
|
||||
* Local Memory: Each PostgreSQL backend process (one per connection) has its own local memory for handling query execution. Key components include the work memory (work\_mem) for sorting operations and hash tables, and the maintenance work memory (maintenance\_work\_mem) for maintenance tasks like vacuuming and index creation.
|
||||
* Process-specific Memory: Each process allocates memory dynamically as needed for tasks like query parsing, planning, and execution. Memory contexts within each process ensure efficient memory usage and cleanup.
|
||||
* Temporary Files: For operations that exceed available memory, such as large sorts or hash joins, PostgreSQL spills data to temporary files on disk.
|
||||
|
||||
Learn more from the following resources:
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [@article@Understanding PostgreSQL Shared Memory](https://stackoverflow.com/questions/32930787/understanding-postgresql-shared-memory)
|
||||
- [@article@Understanding The Process and Memory Architecture of PostgreSQL](https://dev.to/titoausten/understanding-the-process-and-memory-architecture-of-postgresql-5hhp)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user