# Databin and UUID

This is from doc"

DatabinRemove[bin,uuid]

removes the entry with the specified UUID from a databin."

But I don't find any instruction to explain how to specify a record UUID for a databin. Can one of the data columns to be specified as UUID? or it is automatically assigned when DatabinAdd?

## 1 Answer

It is automatically assigned.

Get[bin]


will return a list of associations that includes the data and UUID for every value in the bin.

Update with more details

bin = CreateDatabin[]
DatabinAdd[bin, 1234]
DatabinAdd[bin, 5678]
Databin[bin, -1]["UUID"] (* UUID of last item *)
First[Select[Get[bin], #Data == 1234 &]]["UUID"] (* UUID of first item with value 1234 *)

• I got to understand what "UUID" refers now. My real problem is that I want to remove a certain record (association) from the bin. How can I find the internal UUID of that specific record? To do a select on databin, like Dataset[Databin[binName]][Select[#column === "test"] &, "UUID"]? Is there an easy way to get it at DatabinAdd step? – user1470393 Feb 8 '19 at 4:57
• @user1470393 Updated answer with more details. Does that help? – Rohit Namjoshi Feb 8 '19 at 16:00
• This helps, but this is what I have known. Using last item is not a reliable solution for multi thread (multi client) application. Search the data every time has a performance concern. It would be better if DatabinAdd[bin, 1234] will return the UUID of that record. And then I can directly use that UUID if I need to remove the record later. It is possible to do it as search, but not of the best performance. – user1470393 Feb 8 '19 at 23:26
• @user1470393 Adding and deleting from Databin are both pretty inefficient operations. DatabinUpload is much more efficient for adding many values. For the use case you are describing it seems Databin is not the right solution. It is meant to be a mostly read only store. Also I don't understand how it would help if DatabinAdd returned the UUID, you still need to store that UUID somewhere so you can access it to perform the delete. Regarding mullti-client, you can use this to serialize access. – Rohit Namjoshi Feb 9 '19 at 1:55
• Thanks for your reply. I am trying to build a backend using Mathematica, meaning multiple clients will simultaneously search and insert records in a database. What technology should I be using for this purpose? – user1470393 Feb 18 '19 at 20:08