TCP server and client for key-value-db