Railway - Bring Your Code They Will Handle The Rest

in HiveDevslast year

railway.png

Heroku used to be a to go platform for programming students and hobbyists to experiment with code and apps. Of course Heroku wasn't only for students and hobbyists, they also powered enterprise level apps and products. They still do. Their easy to use and reliable solutions for deploying apps had attracted many programming students and hobbyists. Last year they decided to end their free tier plan and announced removing of all apps that didn't upgrade for paid tier. I too had multiple apps running on Heroku, some on free tier and others on paid tier. I still have a couple of apps that run on paid tier. Heroku has been very reliable, so why not pay for something that works? I will continue using Heroku, but also was exploring other options.

Just recently, I had to build a database for a new project. While I am familiar with SQL queries, my use of databases was limited to retrieving data from existing services. I never had a need to create my own database before. Now that my new project required a database, I need a playground to experiment in. Since Heroku doesn't offer free tier any more, I would need to pay for experimenting. I actually didn't mind that either. Heroku has been so reliable, why not keep paying? Since I also like to discover new tools and solutions, I did want to give some other platforms a try first as well. After all, I am just experimenting at this point, and once I need to deploy the app, I would always be able to go back to Heroku. That is how I discovered Railway.

Railway is a platform just like Heroku that making deploying apps and running in the cloud easy and fast. I would even say, Railway is actually easier to use than Heroku and some of its features might even be better. My project is not finished yet. I have been working on in for the last couple of weeks. I should say, I am impressed by Railway! The purpose of this post is to share some of my experiences with Railway.

Task at hand was to create a database, create python scripts to connect to the database, update data on daily basis, and retrieve data for the app. My preference of relational database system is PostgreSQL. When I first went to Railway's website and wanted to create an account, instead of creating an account it just let me sign in with my gitHub account and connected to my gitHub account. After that I clicked "New Project" button, and to test tried to deploy one of my project that already run on Heroku. In no time the app was up and running. I had to take several more steps to get my code from gitHub to run.

Railway does have a free tier or discount tier. The idea of their discount tier is people can run and experiment with apps and use $5 worth of computing power a month for free. Then those who choose to upgrade, they can do so but also get to keep $5 discount. In other words even after upgrading, user won't be charged for the first $5 worth of computing power. I was impressed by Railway, and also didn't want be in a situation when I couldn't access the database I was building and upgraded to "Developer Plan". There is no fixed fee like Heroku dynos. They charge based on usage. Since apps in development don't really get used much, it is perfect for experimenting and prototyping. I am sure it will be great after production as well. We can also use prepaid cards, if we are not comfortable giving them our credit cards.

Initially I was planning to do everything in python and SQL, creating tables, columns etc. But once I started the project, I realized how Railway provides a super useful UI for creating database, tables, columns, and even entering data if needed. I clicked "New Project", selected the database system of my choice and in no time I had a database. Using its UI was created multiple tables and everything was ready to go. All I had to do at this point was write the python script to connect to the database. Using the credentials provided for the database in the python script I was able to connect without any issues. It didn't even take me an hour to have database and scripts up and running to update the database with all the data needed to test. Since then I just kept adding more tables and writing needed python code to update all data automatically. Now the app that would connect to the database, retrieve and use the data was still running on Heroku.

I am not ready to completely switch to Railway form Heroku. In the past I have tried another cloud solution, Render and have written post about it as well. While it was a decent alternative to Heroku as well, it wasn't as reliable as Heroku and most of the time was very slow. I abandoned Render after a week of using. I would rather pay more than have less speed or go with less reliable solutions. I hope I won't have similar experience with Railway. So far I have had zero issues with Railway. But that is only using it for database. If it continues to be reliable I may consider moving all Heroku apps to Railway. Because it seems like it may even be cheaper to run apps on Railway.

When creating Heroku apps, Heroku allows users to choose the subdomain and have apps run on herokuapp domain. This way Heroku apps were easy to remember, even on free tier. Railway instead generates a link that may not be easy to remember. If I am the only one using the app, that is not a big deal. But if app is shared with others, then it may become problematic. I guess easy solution would be getting a domain and linking it to the app, which is also possible on Heroku. But would cost more to do so on both platform. It necessary for apps that are shared with many and many people use it. It is not necessary for experimenting and prototyping. Since I am only using Railway for database, app link is not needed at all. But to test Railway more, I am running a copy of the Heroku app on Railway as well.

There was a time when Railway build kept failing. But the same code was failing to build on Heroku as well. After discovering and correcting the issue with dependencies Heroku build was successful. So was Railway build. I am not sure if Heroku has auto build when gitHub code is updated. So far I have always updated Heroku builds manually, by choice. I didn't want any unexpected changes happening when adding new features. Railway was rebuilding the app every time I would update gitHub code. It probably has default settings to do so. While I wasn't interested in that, I quickly realized how useful auto rebuilds were. I didn't care if the app on Railway was reliable or not. It was only running a copy and for testing purposes. But this made me see the value of auto rebuilds and running new features on the app right away, without taking any other steps.

When running apps on Heroku I am paying fixed fees for each app running. It doesn't like is the case with Railway. It does keep track of usage of multiple apps as well. I am not sure if $5 discount is per app/project or in total. Either way, what they are offering seems worth the price. I may need to migrate and restart Hive Librarian app on Railway. Have you used Railway? What are your experiences and thoughts? Let me know in the comments.

Sort:  

Have you considered DigitalOcean, Linode or Vultr? No free tier, but for $5 you get a modest Virtual Private Server, and Vultr has $2.50/mo (IP6 only) or $3.50/mo if you can run everything on 0.5 GB RAM. No, I don't work for them or have any association, just a long LONG time user of all 3.

The reason I suggest these over Railway, was I didn't see in Railway a way to choose your base Operating System (Debian, Ubuntu, Ricky, Kali, Slackware, etc) which, if you're so inclined, can customize for security, special services.. etc and get the most performance. Plus, easy to map as many domains and sub-domains as you like onto one instance.

Sounds like a pitch here, not my intent. Just like to find other techies with a passion for full stack and beyond.

But, I'd be very interested in hearing the stability and uptime as you progress. Railway's Zero 9's (99%) uptime doesn't sound all that good. 3 or 4 9's (99.999% or 99.9999%) uptime should be more a target for rarely noticing unavailability.

These are great suggestions. Thank you. I am sure I will try these as well once I complete the project. I just needed something that could get me started quickly with databases.

It looks like a good app for programmers. As a beginner i think python master is great for learning !

Honestly, I am not very familiar with those two applications that you have mentioned
I'll check them online.

Now.... What if I can't code 😂😂

For those interested in programming, this must definitely be a good app

I'm not using this, but will def check this out for sure. Tnks, for sharing this valuabe info.