Skip to content

Instantly share code, notes, and snippets.

@Ravenstine
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ravenstine/480b81e84c7509175fb2 to your computer and use it in GitHub Desktop.
Save Ravenstine/480b81e84c7509175fb2 to your computer and use it in GitHub Desktop.
Cognito Data Schema v1

User Management Backend - Data Schema(for Cognito)

A document describing different datasets their key/values that need to exist to support content personalization for SSO users. Any references to JSON, ints, booleans, etc., imply serialization to a string value. The values LastModifiedDate and DeviceLastModifiedDate are implicit for every key/value pair.


Favorites

Stores a user's preferences for favorite entities (programs, topics, etc.)

key string an object defining the entity that the user has favorited (e.g. prog_kpcc-1 would be the object key for AirTalk
value boolean Whether or not a user considers the program to be a favorite(since keys themselves cannot be deleted). This could possibly be expanded to a JSON value if we need to store more meta_data.

Queue

Stores a list for the user to organize content they want to save for later. In other words, these are items that the user has yet to consume.

key string An object key defining the piece of content (this is likely using the ContentBase object key concept in SCPRv4)
value JSON Metadata for the queue item.
Metadata
obj_title string A user-friendly title for the piece of content in the history, usually an article's headline
obj_url string A public URL for where this resource can be accessed on the web
content_type string A value (either "read" or "listen") that represents the type of content the user is saving in their queue

History

Stores individual items of content that a user has consumed using KPCC products.

key string An object key defining the piece of content that is added to the user’s history (this is likely using the ContentBase object key concept in SCPRv4)
value JSON Metadata for the queue item.
Metadata
obj_title string A user-friendly title for the piece of content in the history, usually an article's headline
obj_url string A public URL for where this resource can be accessed on the web
obj_state int The bookmark where a user left off in a piece of audio, represented (possibly as a duration in seconds for on-demand audio, and as a datetime or unix timestamp for the live stream)
content_type string A value (either "read" or "listen") that represents the type of content the user is saving in their queue
completed boolean True if the user has completed listening to the audio. Defaults to false.

Settings

Keeps general user settings. An example setting could be 'queue_size' => 3.

key string The name of the setting or preference.
value * The value of the setting/preference.

@Ravenstine
Copy link
Author

Thought: Episode display data("title", "description", "url", etc.) could be its own separate dataset; that way we can ask for title changes(for example) from the API, and those changes would be reflected in episodes that are in both the queue and the history.

@Ravenstine
Copy link
Author

Wow, github did something funky and deleted my first comment. >:(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment