Welcome to the Treehouse Community
Looking to learn something new?
Kjetil-Lennart A. Lorentzen13,390 Points
Where should we do calculations?
I would say this question is about scaling, i am taking the SQL course and we are learning to do calculations in the queries. should calulations be done on the server-side or client-side? If the project is gigantic, and it has millions of users, would it then make senese that calculating tax etc be done on client-side to relieve the server-side of stress?
Steven Parker216,083 Points
If calculations are different for each user, it would certainly make sense to do them on the user side, but the development would be a bit more complex. You'd need to transmit script code along with the data to the client to make it work.
Having everything in one place would make development and maintenance simpler. You'd also want to consider if the result of the calculations are needed by the page layout processes in the server.