Beside means there is no space between the two things. If you sit beside someone, you are right next to them. If the town is beside the ocean, it is right next to the ocean.
By is a more nebulous term. It is not so close as beside (It is okay to say 'come sit by me,' by the way).
Next to means there is nothing else between the two objects. However, they could be separated by some space. "Have you seen my keys?" "Yes, they're next to your glass on the table." In this example, there is nothing between the keys and the glass. But they could be a few inches apart or more. If you said "they're beside your glass on the table" (which would be weird), it would mean they were very close together for sure.
Beside in general feels more poetic and intimate than the other options.