Yes, it is mandatory to deregister from the Municipal Personal Records Database (BRP) when you are leaving the Netherlands.