It’s nor done until it ships

Photo by Yan Ots on Unsplash

I had the following options for deployment. The below point summaries the ways to deploy both the MERN stack and Django.

  1. Digital Ocean: All the 4 services in the MERN+Flask stack can be deployed in one single server and scaled up based on requirements. Digital Ocean does not have the pay per use model this means there are charges even if the VPS (Droplet) is stopped. You need to destroy the droplet to prevent subsequent charges. The cost is very deterministic, you can clearly know what is the maximum expense you will incur upfront. In terms of scaling, the Managed Postgres offered by Digital Ocean or MongoDB Atlas can be used. There also have Kubernetes cluster which can be used for deploying the MERN+Python stack as a microservice. They offer one-click setup for Django this comes with Postgres and Nginx configured. The static files can be hosted in their Spaces Object Storage for a minimum of 5 $ per month or you can use Cloudflare.
  2. Vercel: Vercel by the creators of NextJS offers hosting multiple languages including NodeJS and Python through their serverless functions. There are some limitations (currently 12) as to how many pages can be rendered on the serverside for free. It comes with its own CDN. For database either managed Postgres services or MongoDB Atlas can be used. Once you hit the hard limits your app stops functioning.
  3. Google Cloud Platform (GCP): Google offers 300 $ credit for 1 year which can be used across all their products. This is great when it comes to experimenting. The MERN+Python can be setup Google App Engine flexible environment (Standard environment does not support WebSockets currently). With the pay per usage model for the app engine, you get automatically scaling based on demand. The frontend can be hosted in Firebase which comes with its own CDN. MongoDB Atlas will be used. In the case of the Django, you host in Compute Engine (VPS similar to Digital Ocean) or app engine. Managed Postgres offered by Google can also be used. The app engine can be easily set up with CD/CI pipelines and also offers A/B testing.
  4. AWS: Similar to GCP however more mature and widely used in the market. Based on the availability of tutorials for learning and community support seems to be the best in comparison to GCP. The free services are of two types, free for 1 year and always free within limits. This means, unlike GCP you cannot test out all the products. Deployment can be done in 3 ways

1. AWS Serverless Lamda functions: This is a pay per use model and scales well. They can at a max run with about 3 GB ram and not to mention the timeout settings when it comes to long-running process you need to be careful not to exceed 15 mins.

2. EC2: This is a VPS offering. It can be easily scaled using managed Postgres, autoscaling groups, or managed Kubernetes.

3. Elastic Bean Stack: This is a service similar to the app engine where you configure and forget. The creation of various services like load balancing, EC2 instances, etc is managed by AWS automagically. You will need to pay for the cost of running any paid services created by Beanstalk.

  1. Heroku: This was the last option when it comes to quick and easy deployment. It’s free for 750 hours and comes also with WebSocket support. For the MERN+Pyton Stack, Vercel for React/NextJS (for CDN) and MongoDB Atlas can be used. For the Django, managed Postgres offered by Heroku can be used. It’s free up to 10K rows. Due to their managed services at a fixed price it is really easy to get started. However, I find it to be costlier when you upgrade from free. The hobby version costs 7$ for running the dyno and 9$ for managed Postgres. As for 1 GB ram dyno you need to pay around 50 $ per month and another 50$ for a database with dedicated 4 GB ram.

Both Google or AWS infrastructure comes with the following challenges:

  • From Code to Config: You will be overwhelmed with the amount of configuration and different screens to setup and deploy each service. Keep in mind these interfaces seem to be constantly updated.
  • Technicalities: Also the when it comes to managed services the updates get released according to predetermined schedules. However, there are options to have a custom runtime even in the serverless offerings.
  • Vendor Lock-In: You will have to spend a significant amount of resources in case you move to a different service provider. Companies like Serverless might help in this process.
  • Cost Determination: Without knowing how many customers will use your product and their subsequent number of requests, it will be very difficult to be deterministic about the cost. Not to mention you will also have to take into account the network charges.

When comparing all the options I think that the Digital Ocean offers a much safer bet where the cost can be determined upfront and the learning can be easily transferred even if you move to AWS, AZURE, GCP, etc as VPS is always same. As the product or service grows and the more services you can it can be switched to AWS/GCP. When it comes to testing Heroku and prototyping free is excellent.

Previous Post :

Next Post :




Life depends on Your Interpretation of it! I am crafting an interesting story out of it :)

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

What Happened to Chat Bubbles (chat heads) in Android?

Chat Head when message is received in Facebook Messenger

Introduction to Go : The very basics.

Build with custom real-time data sources

A Book is a Hypothesis

SOLID Principles. Are they as important as they used to be 20 years ago?

A Beginner’s Guide to Test-Driven Development


The Binary Brand

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Khwaja Rasheed

Khwaja Rasheed

Life depends on Your Interpretation of it! I am crafting an interesting story out of it :)

More from Medium

Negotiating The Turn

Gender Equality Today for an Equal Tomorrow

First time CEO’s and Small Business Owner’s beware of the P’s. They make or break you.

“Lost World” Step Two