Initial Impressions: PostgreSQL Management and Private Networking

pbronez
HOBBY

2 days ago

First time trying Railway, enjoying it so far. I quickly signed up for the Hobby plan. I'm working in a single project for now (06439d46-b799-467a-963b-91f074631f7b)

Use Case

I'm deploying several docker-based services for personal use, with the goal of replacing my metal Unraid setup. I've deployed three services Linkding (aa95aa87-fb39-4f4b-b757-670fcc960237), Miniflux (9346ae23-e02c-44f2-888b-144b503e0a60), and a shared Postgres (f7dfce58-bbd0-44c0-bd94-47134a45109f). Each user-facing services get a subdomain on my personal site.

Database Experience

It was very easy to get started with Postgres using Railway's direct database support. I'm not sure how much is thanks to the recent upgrades, but the overall experience was good. I needed the hstore extension to deploy one of my services, and I was able to handle that pretty easily. I wish pgvector , timescaledband age were available. I might need to do more direct management to get all these.

Many of the quality of life started to break down as soon as I started using some slightly more advanced database setups.

Schema Support

Each service gets its own schema and user in Postgres. All the Linkding tables live in the linkding_schema which is owned by linkding_user. This pattern breaks several nice Railway features:

  • The data tab shows "no data" because I don't have a railway schema

  • The magic Environment variables for DB User and Password don't support my new users

  • Extension support in the GUI didn't work quite right -- I enabled the extension via SQL commands after connecting to my Postgres service with the Railway CLI.

I could work around this by refactoring my deployment. I could have a separate Postgres service for each application. I worry that would increase my resource usage and complicate the overall system... I expect to deploy some services that query data across schemas.

Environment Sync Support

I have two environments, Production and Staging . I like how you can arbitrarily sync changes between them. This allows me to do most of my work in Staging, but also easily backport changes from Production when needed.

It's not clear to me how to leverage environment sync for database configuration changes. When I add a new service to my Project, I have to create a database user and schema for it. Sync doesn't catch those changes, so I have to re-run them in the target Environment.

I suspect the solution is to define my database setup commands as pre-deploy commands. That will require some discipline to make them idempotent, but I should be doing that anyway.

Networking Experience

Public Networking

It was extremely easy to setup a custom domain managed by a third-party DNS provider. Applications are snappy, so that Metal Edge thing seems to be working. The auto-generated public URLs also work quickly and effectively. I've spent very little time waiting for network config to propagate, which is lovely.

Private Networking

Private/Internal networking is a mixed bag. My services connect to the database using linked variables no problem. However when I tried to have the services talk to each other (so I can save items from Miniflux to Linkding), the internal address didn't work at all. I confirmed that Linkding has dual-stack networking setup, but it still doesn't work.

I got things working using the public endpoint for the Linkding service. This is not ideal because I incur egress fees for what should be an internal network connection.

Other Feedback

Observability

The baked-in observability is a delight. I was able to catch and fix a memory leak in Linkding before it became a problem.

Logs

Log monitoring is also good, very helpful for diagnosing issues. The query function is a little... sticky? I think it waits for you to manually trigger a query, so sometimes you see logs that don't match the filter in the box. It would be nice to have a visual indicator that the log query has been modified but not yet applied.

Serverless

I really appreciate the Serverless feature. I expect that will keep my costs under control and allow me to deploy many more services that I would otherwise.

Miniflux clearly sleeps, wakes up to check feeds, and goes back to sleep. It's not activating as aggressively as I'd expect for Linkding. I'll try to turn on more detailed logs to figure out where the outbound network activity is coming from.

Under Review

0 Threads mention this feature

1 Replies

pbronez
HOBBY

2 days ago

I found the solution to the private networking issue in a bounty thread. The trick is to add the port. I think my confusion stems from the fact that the Public networking INCLUDES port mappings already. I expected internal networking to work the same way.

I also had to adjust my Miniflux config to force http instead of https. When provided with just the host and port, it assumes HTTPS and fails.


Initial Impressions: PostgreSQL Management and Private Networking - Railway Help Station