I am still trying to unwrap my mind from the world of RDMS and learn how to work around some of the features "missing" (more like intentionally traded for other capabilities) from Lucene/ES. While I don't need elaborate transactions and rollbacks I am struggling with how to simply updated a record safely. It seems like there is a dangerous gap between when I get a record and when I put the modified version back into the index. Anyone else modifying the record in that time period would have their changes overwritten. Is the solution to only let one process ever be allowed to write to the index at one time?
Yes, this is a problem that you have to solve on your end. In the future, ES
might support something similar to optimistic locking throwing an exception
when trying to update a document with a stale version.
I am still trying to unwrap my mind from the world of RDMS and learn how to
work around some of the features "missing" (more like intentionally traded
for other capabilities) from Lucene/ES. While I don't need elaborate
transactions and rollbacks I am struggling with how to simply updated a
record safely. It seems like there is a dangerous gap between when I get a
record and when I put the modified version back into the index. Anyone
else
modifying the record in that time period would have their changes
overwritten. Is the solution to only let one process ever be allowed to
write to the index at one time?
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.