DEV Community

José Manuel
José Manuel

Posted on

From Dev/staging to Production, Tips

I'm a beginner dev, so i'm wonder, what we need to do when we put a project in production? or what are the best practices to do it? not only for me also for every dev or project (I know could be to abstract) but my porpuse with this post is create a guide or some check list to review before to release a project to production.

Greetings to all :)

Top comments (3)

Collapse
 
davidszabo97 profile image
Dávid Szabó
  1. Make sure you set your environment variables right. You should use environment variables or a config file to make difference between your staging and production deployment.
  2. Automate deployment. Typically your project is uploaded to either Github, Bitbucket or Gitlab. Setup an automatic deployment script to avoid user errors. (Note: you should have a different branch for automatic deployment, either use master or create a separate branch. Atleast have a master and develop branch.
  3. Security. Is your project secure enough? Make sure you do some hacking ;)
  4. Testing. Your project should have tests. Make sure they pass before you push your code to production.
  5. Maunual testing. Start the app/website or whatever you are doing and play around a little bit. (This is only for smaller projects)

That's it for now :D

Collapse
 
usuario001 profile image
José Manuel

Awesome! and I was Thinking complete this with, how to maintenance the DB and how to change to production and do it some back ups

Collapse
 
davidszabo97 profile image
Dávid Szabó

Database is a problematic one.

I have experience with MariaDB (mysql), but basically, you should use seeding and migration scripts to keep your database up-to-date with your app.

Most of the ORMs supports these. The problem comes when you have multiple instances of your api server and you would like to make a change to your database. You need to shutdown all of them to make the database change, otherwise your servers will fail. Adding a column to a table is costly.

Backups should be automated. You can easily create backups with some bash script and you can even upload it to dropbox or something just to be sure.

I think you are not talking about Facebook scale stuff so you can easily tell the visitors that the app/website is under maintainace for a while (database upgrade or system upgrade)

You shouldn't worry about this until you are not there. Once you reach that scale, you can worry about it ;)