category theory application to database implementation