0

Looking at Realtime API quickstart example, a shortcut file is used to store realtime document model. I'm assuming that this is a file that holds realtime document model state.

Question: do I need to create and clean up this shortcut file for each collaboration session?

Note: Eventually I want to persist data to my database, not Google Drive.

dev.e.loper
  • 35,446
  • 76
  • 161
  • 247

1 Answers1

0

From an API perspective, the realtime documents are designed to be persistent storage. The files are long lived, and there is there is no need to ever recreate them or store data elsewhere.

If you want to copy data elsewhere, how and when to do that sounds like a design decision you need to make given whatever makes sense for your app.

Cheryl Simon
  • 46,552
  • 15
  • 93
  • 82
  • I'm confused because [according to this answer](http://stackoverflow.com/a/17604583/37759) shortcut files don't take up any space. Hence, I assumed that they didn't store any data except metadata like title, sharing permissions, etc. – dev.e.loper Jul 16 '13 at 20:29
  • 1
    The Realtime API works by associating collaborative data with an existing file in Drive (this is why you pass in a file ID to gapi.drive.realtime.load). The existing file can be either a standard binary file (which can have any data you want) or a shortcut file. Binary files count against the user's Drive quota, but shortcut files and Realtime API collaborative data do not. The Realtime data associated with a shortcut file lasts until the shortcut file is deleted. Realtime data associated with a binary file is more complex: https://developers.google.com/drive/realtime/conflicts – Brian Cairns Jul 16 '13 at 20:51