PostgreSQL is a powerful open-source relational database management system (RDBMS). Known for its robustness and advanced features, PostgreSQL offers support for complex data types, transactions, and foreign keys. It excels in handling large volumes of data while ensuring data integrity and security. With its extensibility and SQL compliance, PostgreSQL is a popular choice for data-driven applications and enterprise-level solutions.
Set up your database
PostgreSQL integration is available as a managed service right inside of Codesphere through the Marketplace. You can access it from your Dashboard by clicking the Marketplace tab.
From here, select the PostgreSQL integration and configure it according to your project needs.
While setting up, you'll see an option to add standby nodes. These nodes are copies of your main database, or primary node, and they automatically step in if the main one fails.
They keep up-to-date with the primary node by copying its changes. This ensures a quick switch if anything goes wrong. Standby nodes are particularly important for production environments, where you need high availability of your database and any downtime has immediate monetary implications.
The number of standby nodes you can add depends on the plan you choose.
Your database will then be created. This will take several minutes depending on the configuration. Please be patient until the creation is finished. You can check the status of your database from your Dashboard as well under the Databases tab. Once the process has finished, you will be able to access your database's Connection Parameters by clicking Show info.
You can now use your database in your desired project. To connect to the database, you will need to utilize the connection parameters. The Host parameter specifies the location of your database. Note that you will also need to append the port number to your host in your project.
For example, if your host is mydatabase.codesphere.com
and your port number is 5432
, your connection string should look like this: mydatabase.codesphere.com:5432
.