Jump to content

UUID panic... is it OK to create new records on mobile device?


 Share

This topic is 2821 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Please forgive me if this is a stupid question but I woke up in the middle of the night thinking about it... (sad I know, but this project is stressing me out!) 

 

If I give mobile users the ability to create new records, will these be added to the host on sync..? I was worried that because EasySync identifies records using a Get (UUID) auto-enter calculation that there was a possibility that this field could end up having non-unique values if the records were generated on different devices... 

 

However, my rational head this morning says it looks like since the ES_Record_UUID field auto-enter calculation is set to Do not replace existing value then it will work... have I got that right? Can I let mobile users add records..?

 

Thanks in advance for the clarification!

 

Link to comment
Share on other sites

Thanks Kris. So how do I prevent non-unique values in the ES_Record_UUID field if I'm allowing the creation of records across multiple mobile devices..?

 

I'm thinking perhaps a simple amendment to the auto-enter calc along the lines of this should work... 

 

"UniqueUserID_" + Get (UUID)

 

Am I barking up the wrong tree..?

Link to comment
Share on other sites

I'm pretty sure you don't need to worry about a non-unique UUID being created, even when using multiple devices... I think I read somewhere that the UUID that gets generated might actually use a unique device identifier in part of the creation of the UUID itself.... 

 

However, you could also append Get (PersistantID) which is a built in FileMaker function to get a unique ID for the device, though note that this ID can change for a device if FileMaker is uninstalled and later installed again.....

Link to comment
Share on other sites

I'm pretty sure you don't need to worry about a non-unique UUID being created, even when using multiple devices... I think I read somewhere that the UUID that gets generated might actually use a unique device identifier in part of the creation of the UUID itself.... 

 

However, you could also append Get (PersistantID) which is a built in FileMaker function to get a unique ID for the device, though note that this ID can change for a device if FileMaker is uninstalled and later installed again.....

 

Thanks. The solution I've been tasked with developing will only have a handful of mobile users and these are easily identifiable via their user account name (e.g. east, north etc..) so I think appending Get (PersistantID) might be overkill... I was debating whether or not to prevent new record creation out in the field altogether and just let the main office user handle adding records, but at least it looks like a simple tweak to EasySync's RecordID field will allow for it if required.

Link to comment
Share on other sites

FYI....I have been testing the Get ( UUID ) function for a bit. Last test I ran, was up to 5 million records, with no duplicates. ( Note: I also convert the Base36 Base16 to a Base10 number ).

 

Each user in my solution is assigned a 3 digit user "ID". I could easily prepend that to the UUID to reduce the risk of a duplicate even further.

Link to comment
Share on other sites

Note: I also convert the Base36 to a Base10 number

 

The result of the Get ( UUID ) function is base 16, not base 36.

 

In response to the train of comments above, UUIDs are already designed specifically to minimize the possibility of generating the same ID on different devices. Appending a user- or device-specific component is redundant. Some UUID versions already include a device-specific component. The scheme used by the Get ( UUID ) function does not have a user- or device-specific component, just a random number generator with an astronomically low probability of generating duplicate values. Your file system probably uses the same scheme internally. If it's good enough for the file system, it's good enough for me. Still, some folks are more comfortable with other schemes. My favorite is this one. I've considered making a version 5 (MD5 hash) UUID function, but I'm not sure anyone would bother using it.

Link to comment
Share on other sites

Thanks Jeremy. That's what I meant. Miss-typed that.

 

To clarify. Since Get ( UUID ) came out, I have rarely added the user code onto the ID. If I did, it was merely to appease the decision makers that were not comfortable with the current chance of a duplicate. I personally don't see any need for it. The only real preference I have is to convert the Base16 to Base10. But I don't do that every time either.

Link to comment
Share on other sites

I don't claim to know the math behind the Get (UUID) function but i will hazard a guess that "unique" would apply across just about any domain...

So if your domain is a single table with a Get (UUID) the chances for duplication is extremely small. (ref Jb post "astronomically small")

Increase the amount of tables, regardless of where they are located,  and the probability of dups goes up but won't get into the "i really need to worry about this" range until you have a huge population of tables.

 

The number of possible UUIDs is about 3.4 × 1038 << from Wikipedia

Link to comment
Share on other sites

 

However, my rational head this morning says it looks like since the ES_Record_UUID field auto-enter calculation is set to Do not replace existing value then it will work... have I got that right? Can I let mobile users add records..?

 

Thanks in advance for the clarification!

 

If you're going to be using  "Duplicate Record" function in filemaker, make sure you also call another Set Field ES_Record_UUID = get(uuid) after you duplicate. Otherwise, you'll duplicate the ES UUIDs.

 

Alternatively, you could also disable the  "Do not replace existing value" to achieve the same effect, but I have not tried this myself while using Easy Sync.

  • Like 1
Link to comment
Share on other sites

This topic is 2821 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.