We study the amount of randomness required to sample an item from a stream of items. The items keep on arriving and we need to store a single element from the items seen so far. The sampled element at any point of time should be an uniform sample of the elements seen so far. We give an algorithm which does this using $O(\log n)$ random bits. This matches the offline lower bound for the problem. Our algorithm is also space and time efficient.