Overcoming key length limit strategy?

Personally given how incredibly unlikely a collision is in a SHA 256 I would probably go for Solution 1 and deal with the collision if it should ever come up (which I don’t expect) by showing an error and let the monitoring catch it for me to resolve.

You are right that enforcing a unique constraint is best done using the key and then use Add to add elements which enforces unique addition on the server side throwing an error in case of a key clash.

Solution 2 seems to complicate things a lot for a very small chance of clash, it will however work. Also I would suggest another simpler way in my opinion by instead of adding an index storing an array of documents under the key, by default element at index 0 will always be the match should there be more than 1 element you would need to compare the site url.

Solution 3 seems to rely on views, and does some complicated processing which adds significant overhead so I would advise against it for performance reasons.

Hope I could help out a bit.