so basically if i get you right... have one document per challenge which includes a property of all the id's of users that took the challenge and another prop for those who declined?
Ok interesting. How would i handle changes in the challenge entity then? f.e. one property changed (challenge name) across all documents with duplicated data?
Also how would one query "all challenges" not depending on a user without duplication?
You can reindex all the documents that needs to be reindexed when a challenge changes.
You have to have an idea of the cost behind. Ie are you going to reindex 10m documents? Or less than that? How much?
Also does it make sense to change a challenge that happened in the past after a user has already submitted it? That's a business question of course.
About deduplication, may be aggregations would work for you.
Worse case, if you really need to have 2 distinct entities, have a look at the join data type also called parent/child. Although I'm not a big fan, your use case might be a good candidate for this feature.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.