lab_server/notes.md

3.3 KiB

Project Server Notes

Checkpoint 1

  1. Lots of software today connects to remote servers, and can't work offline. What are some advantages of using a program or an app which uses a remote server? What are some advantages of using a program or an app which is completely local? An advantage of using a program or an app which uses a remote server is that it can be accessed (presumably by someone with sufficient permissions) from anywhere with internet access. Another advantage is that the user may have some flexibility with what device they use to access the remote server. An advantage of using a program an app which is completely local is that the user is not reliant on a remote server being up. Another advantage might be security; only someone with access to the user's device (and hopefully access is well monitored) can access the program or app.

  2. You just ran a server on your own computer, and connected to it as a client on the same computer. In what other situations might it be useful to run a server on your computer, where you're the only client, on the same computer? I would imagine if the server were setup for me as this one was that it could abstract away some of how it functions so the user can focus on what they want to happen. Another situation it might be useful to run the server on my own computer where I'm the only client on the same computer is to test whether the serve works the way it should before deploying it to a remote server or allowing others elsewhere to access it remotely.

Checkpoint 2

  1. Choose a program (Steam), web app (Google Docs), or app (Weather) that you use frequently. You can't observe the calls this program is making to its server (unless you have fancy tools), but you can infer some of the calls based on the program's behavior. Describe a few routes which you think may exist for your chosen program's backend server.

With google docs, I assume every time something is typed the location of the character typed as well as what was typed is posted as a change to the document on the server, so a route might be "change." Given that google docs allows for near-real-time remote collaboration, google docs likely gets the document extraordinarily frequently to make it appear that changes happen nearly instantly, so a route might be "show." Such a route might also simultaneously check if the user has access, as a user whose access is removed can no longer view or edit the document.

  1. In your own words, what is an exception? When might it be useful to handle an exception? When is it better not to handle an exception, and instead let the program crash?

An exception is when something unintended happens that would crash a program. It could be useful to handle an exception if it's something that could plausibly happen. Handling the exception provides the opportunity to provide a tailored message to the user to explain what it is that caused the program not to function as expected, especially in the case where they try to access something they're not supposed to or doesn't exist. It could be better not to handle an exception as allowing the program to crash could indicate more work needs to be done to fix the program itself. Putting it in an exception could hide the presence of some program-breaking underlying issue.