contraints like unique keys

Is there the concept of a unique key (ex: mysql)?

I see the REPLACE statement which is based on a constraint conflict, but it appears based on an internally generated ID value. Is there a way to expand the constraint?

[update]
Being new to manticore, I’m attempting to import data from another system and was hoping for a replace call to handle insert/update on any changes. Even knowing what records have been updated, the replace statement is only triggered on an ID field conflict which the external system is unaware of.

Is there a “best practices” for bringing data and updating with changes into manticore?

No, only document ID is a unique value in Manticore.

Is there a “best practices” for bringing data and updating with changes into manticore?

Some users make the ID meaningful when syncing from another storage, for example by making it a hash of a combination of the other fields that make the record unique.

Is there any roadmap feature to add a unique value constraint? I have been looking for a reasonable alternative to Elastic Search and this has been compareable in some areas. In my view, synchronization options go along way to adoption, but I’m not yet certain to the target market here.

Let me check with the team on this.

1 Like

@dmartz We’ve discussed it and it looks doable. Feel free to make a feature request on GitHub.

Added. Thank you Sergey.

1 Like

I was looking for something similar, and I stumbled upon the mathematical functions Cantor Pairing and Szudzik Pairing. Both are algorithms that calculates a unique integer based upon 2 different integers in a specific order. So is with Szudzik Pairing 2 and 3 the outcome 11, but 3 and 2 is 14. This behaviour also allows you to reverse the process.

Read more about them

I am using this technique also to store 2 id’s in the id field of a percolated table. Beats the tags field.

1 Like