0

What I want to know first is, whether my Nuxt App is Stateful or Stateless?

Summary of my Nuxt App:

  • Firebase Authentication is used for Login/Signup
  • Firebase Firestore as database
  • Node.js v12 for cloud functions
  • Vuex is used for state management

Basically, there are two different user roles in my app.

I know that the app might be Stateful, still want confirmation.

The main question is, I want to deploy and host this app. I am already using Google Cloud Platform and want to know how can I do the job. I just want to know which services to use, and I will do the rest.

Also, tell me if I wrote something wrong.

2 Answers2

0

Nuxt have a "target" config, it can have two values "server" and "static". The server option you will need to deploy it on a node host, if you use "static" you con deploy it on static hosting, like Netlify or Vercel

Read More: Nuxt Official Docs - Commands

0

Whether your app is stateful or not:

  • Does your app write any files in the local file system? If so, will your app stop behaving correctly if those files go away? If your answer is yes, then your app is stateful.

Following are good choices for stateless apps:

  • App Engine(Standard)

  • Cloud Functions

  • Cloud Run

Following are good choices for Stateful apps:

  • Compute Engine

  • Kubernetes Engine

I would suggest to build your webapp such that all the persistent information is stored away from the compute infrastructure in a database(Firestore, Cloud SQL etc.) That way, horizontal scaling of your compute resources is much easier.

dishant makwana
  • 1,029
  • 6
  • 13
  • Can you please explain the term local file system ? I am confused about that. I have one store folder in my application and there is a .js file which stores user login information in mapState. There are also other terms like mapMutation in that file. I am able to access the user information via mapState in computed property such as email, name, uid (all info provided by Firebase as a token). And the token is set to browser's cache by that .js file. Will that make my app stateful or stateless ? – Shubhang Chourasia Apr 05 '21 at 04:56
  • Your app is stateful if removing or reverting the .js file causes your app to not behave properly(basically, data loss). If the .js file you are talking about does not get updated at run time, then your app is stateless – dishant makwana Apr 05 '21 at 07:59
  • Thank You So Much. Got my answer. The files updates information everytime a user logins. So the app is Stateful. – Shubhang Chourasia Apr 05 '21 at 15:35