<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Dec 22, 2016 at 1:29 PM, Matthias Kuhn <span dir="ltr"><<a href="mailto:matthias@opengis.ch" target="_blank">matthias@opengis.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi René-Luc<br>
<span class="gmail-"><br>
><br>
> Do you have an idea on a way to share a QgsPostgresSharedData between<br>
> multiple QGIS instances ?<br>
<br>
</span>There are different approaches to this:<br>
<br>
* Use a shared memory segment <a href="http://doc.qt.io/qt-5/qsharedmemory.html" rel="noreferrer" target="_blank">http://doc.qt.io/qt-5/<wbr>qsharedmemory.html</a><br>
in this case, if the server is restarted, anything will be gone<br>
This might introduce data corruption if someone tries to do an update<br>
with a fid obtained before the restart which collides with a newly<br>
created fid.<br>
<br>
* Use some persistent storage like a sqlite database to cache the keys<br>
<br>
* Use a reproducible algorithm to generate the fid<->pk mapping<br>
(something similar to qHash)<br>
<br>
Regards<br>
<span class="gmail-HOEnZb"><font color="#888888">Matthias<br>
</font></span><div class="gmail-HOEnZb"><div class="gmail-h5">______________________________<wbr>_________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a></div></div></blockquote></div><br><br></div><div class="gmail_extra">Hi Matthias,<br><br></div><div class="gmail_extra">In Lyon we also talked about how to share caches between different server processes, do you think that the shared memory segment would be appropriate in that case?<br><br></div><div class="gmail_extra">For a cache it does not matter if it's not persistent.<br><br></div><div class="gmail_extra">The idea would be to have the server honour the 12 factors patterns.<br><br><br></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature">Alessandro Pasotti<br>w3: <a href="http://www.itopen.it" target="_blank">www.itopen.it</a></div>
</div></div>