Redis

Learn how to work with our managed Redis databases.

Redis (Remote Dictionary Server) is an in-memory data structure store, which can be used as a database, cache, and message broker. It supports a variety of data structures such as strings, hashes, lists, sets, sorted sets, etc. Known for its high performance and flexibility, Redis is a popular choice for caching, session management, gaming, real-time analytics, and more.

Set up your database

Redis integration is available as a managed service right inside of Codesphere through the Marketplace. You can access it from your Dashboard by clicking the the Marketplace tab.

From here, select the Redis 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.