Datastore structure for app like Google Forms?

67 views
Skip to first unread message

asmith26

unread,
Aug 2, 2017, 9:00:56 AM8/2/17
to Google App Engine

I'm building a web app for allowing users to create online forms through a GUI, but I am unsure how to structure my database (similar to Google Forms).


My ideas are:

  • 1 Kind for the forms designed by users, 1 Kind for the data containing completed forms.
  • Alternatively, I've recently come across the Fear of Adding Tables. Thus I could create a new Kind for every form created by users:
    • Do you know if Datastore allows for separate databases to segregate kinds by e.g. user?
    • Does datastore have a limit on the number of Kinds allowed?

Any better ideas? Many thanks!

Jordan (Cloud Platform Support)

unread,
Aug 2, 2017, 1:05:59 PM8/2/17
to google-a...@googlegroups.com
There does not seem to be any limit for Datastore Kinds. Essentially you would have one 'Form' Kind. When someone creates a new main Form entity via your application you then make that main Form available to other user's via your application. 

When a user fills out the main Form via your application, you then save a copy of that Form entity for that user, and save their email or ID to the new copied Form entity.  

Each Form will have multiple Section entities, and each Section will have multiple Question entities. The user then interacts with their own Form's Question entities (organized into Sections like Google Forms). 


- Datastore Kinds:
  • Form:
    • User's email who filled out. (null if this is the Main form to be copied by other users). 
    • Title.
    • Ordered list of Section entity IDs.
    • Background image URL. 
    • other settings etc..
  • Section:
    • Parent = a Form entity.
    • Title.
    • Ordered list of Question entity IDs.
  • Question Kinds:
    • MultipleChoice:
      • Parent = a Section entity.
      • List of choices.
      • Chosen choices by user. 
    • CheckBoxes:
      • Parent = a Section entity.
      • List of options for checkboxes.
      • Chosen options by user. 
    • Paragraph:
      • Parent = a Section entity.
      • Paragraph String.
    • etc...

- NOTE: This is my own interpretation of how you would implement Google Forms with the Datastore, and is in no way a reflection of how it is actually implemented. 

asmith26

unread,
Aug 2, 2017, 3:48:48 PM8/2/17
to Google App Engine
Very interesting idea. Many thanks for your detailed answer!
Reply all
Reply to author
Forward
0 new messages