Thursday, June 22, 2017

MongoDB Indexes With Spring Data

DZone Database Zone
MongoDB Indexes With Spring Data

When working with large amounts of data, the use of indexes will greatly improve the time it takes for your queries to run by storing part of a collection’s data in a form that is easy to traverse. To add some indexes to your collections, you could run some functions directly via the Mongo Shell — or Spring Data can be used to handle it for you. As the title suggests, that's what we will be looking into in this post.

Let's start with some background information about why we should use indexes. As mentioned in the introduction indexes allows us to query vast amounts of data in a more efficient way which reduces the time taken to retrieve the results. This might seem negligible with smaller sets of data but as the size of documents and collections increase this time difference between having indexes or not is definitely recognizable.

No comments:

Fun With SQL: Functions in Postgres

DZone Database Zone Fun With SQL: Functions in Postgres In our previous  Fun with SQL  post on the  Citus Data  blog, we covered w...