Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
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 Parker227,126 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.