Recommender systems actively collect various kinds of data in order to generate their recommendations. Collaborative filtering is based on collecting and analyzing information on users' preferences and estimating what users will like based on their similarity to other users. However, most of current collaborative filtering methods often suffer from two problems: sparsity and scalability. This paper proposes a framework for collaborative filtering by applying nonnegative matrix factorization, which alleviates the problems via matrix factorization. Experimental results on benchmark dataset are presented to show that our method is indeed more tolerant against both sparsity and scalability, and obtains good performance in the meanwhile.