Skip to content
epicmonkey edited this page Jul 20, 2015 · 11 revisions

Pepyatka uses Redis key-value storage as a database:

username:<username>:uid
email:<email>:uid

user:<userId> { username, screenName, hashedPassword, email, isPrivate, createdAt, updatedAt, type }
user:<userId>:timelines { RiverOfNews, Posts, Likes, Comments, MyDiscussions, Directs }
user:<userId>:administrators { <userId>:<timestamp> }
user:<userId>:subscriptions ( <timelineId>:<timestamp> )
user:<userId>:bans ( <userId>:<timestamp> )
user:<userId>:requests ( <userId>:<timestamp> )
user:<userId>:pending ( <userId>:<timestamp> )

timeline:<timelineId> { name, userId }
timeline:<timelineId>:posts ( <postId>:<timestamp> )
timeline:<timelineId>:subscribers ( <userId>:<timestamp> )

post:<postId> { body, createdAt, updatedAt, userId }
post:<postId>:comments [ <commentId> ]
post:<postId>:attachments [ <attachmentId> ]
post:<postId>:timelines ( <timelineId> )
post:<postId>:likes ( <userId>:<timestamp> )
post:<postId>:to ( <timelineId> )

comment:<commentId> { body, createdAt, updatedAt, createdBy, userId, postId }

attachment:<attachmentId> { fileName, fileSize, mimeType, mediaType, fileExtension, noThumbnail, userId, postId, createdAt, updatedAt }

stats:<userId> { posts, likes, discussions, subscribers, subscriptions }
stats:posts { <userId>:<posts> }
stats:likes { <userId>:<likes> }
stats:comments { <userId>:<discussions> }
stats:subscribers { <userId>:<subscribers> }
stats:subscriptions { <userId>:<subscriptions> }