Reputation: 5884
Does Spring Data e.g for MongoDB come with a performance penalty? If so, how much?
Upvotes: 1
Views: 900
Reputation: 18129
Yes.
Everything you put between your user and your data store comes at a cost and impacts performance. Spring Data generates obviously some overhead in comparison to using MongoDB directly. Overhead can be measured in CPU and memory consumption. Spring Data MongoDB requires initialization and most probably some container (Spring or JavaEE with CDI) to run your application.
Spring Data MongoDB is designed to provide a consistent and easy to use abstraction layer on top of the MongoDB Java driver. It provides a lot of features like object mapping and query abstraction.
The overhead for your application depends on the features you use, your data model and how you use the API. The overhead bandwidth varies between almost nothing and a measurable impact, depending on your use and what you measure.
Upvotes: 3