Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the consistency guarantees of the Google Drive API?

I've written a test suite for my google drive api library and am witnessing some non-deterministic behavior. In the simplest case, I can insert a permission on a file, then immediately get a list of permissions on the file and I don't see the newly inserted permission.

I'm chalking this up to eventual consistency being eventual, but it would be nice to know if this is actually the case; the documentation makes no mention of consistency delays.

like image 941
Donald ball Avatar asked Dec 17 '15 16:12

Donald ball


1 Answers

I can't see this documented anywhere but there is a simple experiment you can do.

Adding and removing permissions is an asynchronous and queued task in my opinion and eventual consistency is my observation too. You can confirm this with a GSuite for Business account by conducting a test as follows:

  1. In the Drive UI, upload a folder tree structure with a root folder, 3 or 4 levels of sub-folders and 300 to 500 files. You may get away with fewer but this is how many I used.
  2. In the Drive UI, share the root of those folders with another user on your domain.
  3. In Admin Console > Reports > Audit > Drive, add Filters as follows:
    • Event name: User Sharing Permissions Change
    • User name: the email of the user you added in step 2.
    • Owner: your email
    • Date and time range:
      • From: add yesterday's date
      • To: add today's date and 23:59 as time
  4. Press search. You should see hundreds of events - one for every file and folder you added in step 1. Each event shows the exact time stamp of the permission being added.

As you should see, the permissions are not added instantly. It can take many minutes/hours depending on the numbers involved and (I assume) indeterminate work going on in the Google cloud.

like image 105
Pete Avatar answered Nov 18 '22 17:11

Pete