Due to the increasing variety and quantity of data in databases, retrieving the desired images among massive images storage becomes a challenge. Hence, many image retrieval methods are applied on one or some static datasets and the steps of features extraction and similarity comparison are performed on the dataset images as offline. To address the challenge, we propose an online content-based image retrieval (CBIR) system from huge datasets by applying MapReduce distributed computing model. In the proposed method, images features and their similarity comparison are computed during the retrieval stage. In feature extraction step, similar to most large-scale image retrieval systems, we employ the bag-of-words model to extract the color and edge histograms from images. Experimental results on the Corel dataset demonstrate that the proposed method improves retrieval accuracy in comparison to the state-of-the-art methods significantly and it is flexible against each database.