Safe Programming Over Distributed Streams