BS170 is not well specified for 5.0V drive. You would be better off with a 2N7000. There are much, much better parts if you don't mind SMT, which you should definitely explore if the MCU supply voltage is less than 5V.
If the load could be inductive you should have a catch diode across the load.
The 10K resistor will turn the MOSFET off if the MCU port pin goes high-Z. This could be vital if the micro finds itself in a low voltage reset condition- if the load is heavy the MOSFET could be damaged by being partially 'on'.
If your supply to the load is higher than the MCU supply, consider a gate resistor which could protect the MCU if a short occurs across the MOSFET drain to gate pins, say by an errant test probe or a failed MOSFET. It can go between the 10K and the gate something like a few K.