I'm using mongoDB for storing and querying close to 50 mn records (Large Json files with no fixed schema), through a spring web application. Simple K-V pair based find queries run into a few seconds. I'm looking at ways to bring search time down to < 1s.
Indexing doesn't work for me because of the nature of the files stored. I was looking at alternatives and came across sharding. However, I found no good tutorial explaining how to set up sharding for my existing spring-mongo application.
Can someone please point me towards a good explanation for the same? Also any other suggestions for optimizing search time would be welcome!
EDIT
Following the comment, I converted my existing Mongo database into a sharded one with 1 config server, 1 query server and 2 shards. Previously my (spring-boot) application.properties file looked like this :
...
spring.data.mongodb.database=pam
spring.data.mongodb.host=localhost
spring.data.mongodb.port=27017
spring.data.mongodb.repositories.enabled=true
spring.data.mongodb.uri=mongodb://localhost:27017/pam
...
How do I modify it now to adapt to the sharded database, with the same name?