async socket code, database optimisation (only transfer changes)