The client says the site is down but it's working on my machine as developers we've all been there.the app works perfectly on the local host you test everything and it all works well, then you deploy to production that's where the genesis of our troubles starts and suddenly everything breaks. same code, same application so what changed actually a lot
first, environment variables on your laptops you already had your database password, your api keys, your secrete keys everything sited on your local environment. You deploy and one variable is missing or the database url is wrong or the api keys used belong to the test environment, your code is the same but your configuration is not
second, your production server my not even be running the same environment as your laptop develop on windows then you deploy on linux. you have on version of node, python or even PHP locally then in production it's different, it's something as simple as a filename can break a system. user service might work on a system while other user service might not
third, everything becomes so strict in production your fronted might be in one domain and your API in another cors matters because you might be using https on one request and your other request uses http. your login cookie is missing the correct same site secure or domain settings and suddenly users can not stay logged in.
Finally, real traffic local host, how many users are testing your app? One request comes in you up handles it and everything looks perfect but production might have hundreds of users hitting the same API at the very same time when your database runs out of connection, your memory fills up or it starts timing out two users try updating the same data and suddenly your app crashes, you never saw locally suddenly appears when someone says but it works on my machine, that may actually be the problem because production is not just you laptop on the internet, it has different configuration, system, security rules because of different browsers and real users hitting everything all at once. Everything may be the same but the environment around it is completely different.
Top comments (0)