The development of efficient methods for long-range systems plays important role in all-atom simulations of biomolecules and drug design. We present a random-batch Ewald (RBE) method for molecular dynamics simulations of particle systems with long-range Coulomb interactions. The RBE takes advantage of the random minibatch strategy for the force calculation between particles, leading to an order N algorithm. It is based on the Ewald splitting of the Coulomb kernel and the random importance sampling is employed in the Fourier part such that the force variance can be reduced. This new simulation method avoids the use of the FFT and greatly improves the scalability of the molecular simulations. We present numerical results to show the nice features of the algorithm.