Hosting Web application - best practices - reactjs

So I have a web application where the Frontend is written in React and the backend is written in NodeJs/NestJs, and are in the stages of deploying the application. I have a Linode server running Ubuntu, and my initial thoughts was to install Docker & Kubernetes (I will need a couple more servers) and then spin up containers for the front and backend, and a separate server hosting the database. Since the requirements are high uptime, scaleability and modularity.
So is this a good way to go about setting up the application? Are there any pros and cons with this setup except pricing because of the amount of servers needed? Or are there any other options available that could be more benefitial?
Thanks in advance.

It depends if you want to make DevOps job or not, and also about the budget you have.
If you really want to stay in control of your clusters, scalability of them and money is not a worry, then kubernetes is a good alternative.
Disclaimer: I don't know Linode and have no idea if there is some GCP compatible services.
For front-end, you said it was react: The hosting service of firebase, here's a tutorial.
And the good news is that you can alternatively use any cloud platform with a storage service like Google Storage, AWS S3 or Azure.
For back-end, I would suggest App Engine or functions, I'm having a great experience using App Engine and is a lot easier to configure than any pods, deployments, ingress and all steps to deploy a kubernetes cluster. I'm not really sure if you can use NestJs with Cloud Functions and all FaaS options.
Also, this suggestion will make you spend a lot less than a whole k8s infrastructure.
But, of course, it depends on your case.

Related

MERN app - how does someone run it locally with a database connection

So I have 2 assignments for different job applications. I can deploy on Heroku by using the free Cluster in Mongodb Atlas, but how would they get the second application to work on their computer? I want it to be as easily done as possible for them, but it seems that they will need to download Node.js and MongoDB compass to their computer.
Any other suggestions?
have you considered using a PaaS?
If you build the app only for the purpose of the interview then it means the webapp should be "accessible/live" only for a few hours at max while it's being reviewed.
The major cloud providers have some free tiers which should help host your app for the interview for free.
(for DB MongoDB Atlas should be good enough)
There are many articles on that since the cloud is very popular nowadays.
Services like: Azure Web Apps, Azzure App Service, Google App Engine and so on should work.

Different App Engine Applications in Google Cloud

I'm looking at moving my application to google cloud and I'm having a hard time understanding how best to organize my project. It seems like you can only have one App Engine application per project with services available to support a microservices architecture and instances representing the App Engine instances created via auto scaling.
What is the correct way to build an App Engine for my API server and an App Engine for my Web Server? Do I need to have a project for each? I'm essentially trying to accomplish the following:
It is straightforward to have a single GAE project implement both your website and an API. You can even do this within a single service. You could put each in a separate service, and the advantage of that is that you can update one without updating the other. For small projects, a disadvantage is that two services are more expensive than one (though GAE is quite inexpensive overall).
For prod vs dev, you'll need to explain your requirements a little more, but here are some thoughts.
Each GAE service has multiple versions. You can deploy your production version to www.mycompany.com and deploy a dev version to dev-dot-myapp.appspot.com (that's the way GAE does URLs for versions of your app). Both of these versions will access the same datastore so you need to be careful with the dev version so that it doesn't mess up your prod implementation.
If you have a dev situation that is bleeding edge and shouldn't be able to access the datastore of your production app, then you would create a different GAE project for that.
Here is a way to visualize it:
Google Cloud Project A
GAE Project A
production www service
production API service (this could be combined with production www service)
dev www service
dev API service
Google Cloud Project B
GAE Project B
bleeding edge www service
bleeding edge API service
Best Practices:
Your Dev and Prod should be in separate projects for both security and billing purposes.
App Engine:
You can only have one App Engine per project. This will create a problem for you to use App Engine for both API Server and Web Server. In this case, I would not use App Engine at all and instead look at Containers on Compute Engine or go for Kubernetes.
Even a single node Kubernetes Cluster will shock you with its flexibility and power. Containers on Compute Engine still have a lot flexibility and power too. If you like the concepts of App Engine Flexible, then you might really like containers. The exception here is that App Engine makes some concepts brain dead simple where you have more work in configuration for Containers or Kubernetes.

MEAN stack deployment on PaaS

Which PaaS (platform as a service) to consider for auto-scaling MEAN stack. Have previously used Google App Engine for REST Api web development. I am looking for something similar (to GAE) which autoscales MEAN.
First choice suggestion is Heroku.
Heroku is a platform as a service (PaaS) that enables developers to build and run applications entirely in the cloud.
Second choice suggestion is AppFog.
If you want to make your own decision on pros-n-cons Heroku vs AppFog

How to scale a webapp after Heroku

Heroku's great, but expensive. How do most startups scale after hosting with Heroku starts getting too costly?
Let's say we're running rails on a linux server, typical bandwidth and storage needs.
Rackspace? I've just heard of getting into trouble if you go down this route.
Google app engine I've heard is another dangerous route.
Amazon Web Services? Just peel off Heroku's layer and save the money there?
Heroku is a value added layer of services on top of AWS EC2.
If Heroku is more expensive, you can run your own app servers on AWS using EC2 (app servers), ELB (load balancer), ElastiCache (memcached/redis), and RDS (Postgres/Mysql).
All of the Heroku services are provided on top of their applications running on AWS EC2.
Heroku allows ease of use and implements tools/services you will need to build yourself (deployment, scaling, etc). They do this at a premium over the cost of the raw AWS services. You may be able to achieve lower costs and economies of scale with larger instances.
Rackspace has a couple of options for hosting.
Rackspace Cloud: this option is very similar to Amazon but somehow is a bit more limited on the some of features they provide. However, their prices are a bit more competitive's than AWS's. They provide a Rest API as well that you can use to manage your servers programmatically (Although not compatible with AWS's API)
Rackaspace Hosting: with this option you get the whole physical server/infrastructure for you to manage. This option is very cost effective if you need a lot of CPU power (physical CPU) and you use your servers permanently (no on-demand). For example, we created an entire Cloudera/Hadoop cluster using several machines using Rackspace and migrated all of our jobs from EMR (Amazon's Elastic Map Reduce) to our physical cluster with more than 50% savings. The downside to this option is that you generally have to manage the physical servers yourself.

google web engine SDK as a local web server?

I'm thinking of building a dynamic web site using Google web engine Technology, however I would like to use it in a local network without internet . Can I use the Google web engine SDK as a LOCAL SERVER.In other words, is the SDK just for development and testing purposes or it can be used as a server?
Should I worry about long-term use of SDK as a local web server, is there any scalability issues I should be aware of.
Thank you.
You probably could, but there'd be no point.
GAE makes all sorts of tradeoffs which only make sense in terms of the benefits you get by running on Google's infrastructure: for example, the limited querying you can do with the datastore, or the strict timeout on requests.
Plus, the development server is extremely limited in what it can serve, so you'd need to put a proper web server in front of it anyway.
If you're using Python, you can use webapp2 as a standalone WSGI application, although you might be better off going directly for something like Django. I don't know much about serving Java apps directly but I guess you can use Tomcat.

Resources