logo

大约去年底用nodejs和mongodb做了一个版本的相册,测试了之后就停了好些时间,最近想重新设计及实现,升级个版本出来,后端完全改变。以go+redis来代替nodejs+mongodb。
功能

  • 相册album列表,具体相册包含的图片
  • 新的东西,思路:
    图片标签 new
    移动端参考nice in

album design&arch

  • use redis instead of mongodb,KISS,for images, basically insert,update not needed

  • use golang instead of nodejs, lower cpu and memory

  • real-time HTML5 websoket

  • API driven dev API for web and mobile

  • single page?

mongodb schema

> db.users.findOne()
{
    "_id" : ObjectId("54830d9d62021c9c12441402"),
    "accessToken" : "60093934-8ed8-404a-a8e5-b5117741a88b",
    "avatar" : "http://www.gravatar.com/avatar/6ccf32ccd8da00bc003d7b689d9b45bb?size=48",
    "email" : "occj@qq.com",
    "pass" : "$2a$10$0lrAk8zU7tKHbpoisHjdZ.uNuDh/WNv5yiiXUEjMOs1yO3HfUzYyG",
    "loginname" : "cyrus",
    "name" : "cyrus",
    "receive_at_mail" : false,
    "receive_reply_mail" : false,
    "active" : true,
    "update_at" : ISODate("2014-12-06T14:07:25.810Z"),
    "create_at" : ISODate("2014-12-06T14:07:25.809Z"),
    "__v" : 0
}
> db.album.findOne()
{
    "_id" : ObjectId("562ba6ff81c5bf124d5a58c1"),
    "author" : "cyrus",
    "name" : "美女",
    "desc" : "美女",
    "updated_at" : ISODate("2015-10-24T15:42:55.175Z"),
    "created_at" : ISODate("2015-10-24T15:42:55.175Z"),
    "photos" : [
        "http://tuqimg.qiniudn.com/o_1a2d86l0d1dbepkitok1fmf1vh1a.jpg",
        "http://tuqimg.qiniudn.com/o_1a2d86l0d1coplol185qv1n76b.jpg",
        "http://tuqimg.qiniudn.com/o_1a2nalm8s14g4b3v5ukf11uqf9.jpg",
        "http://tuqimg.qiniudn.com/o_1a35qhf492og91k3uh1uu31ikh9.png"
    ],
    "__v" : 0,
    "cover" : "http://tuqimg.qiniudn.com/o_1a35qhf492og91k3uh1uu31ikh9.png"
}

redis
user: hash
album: hash + list/sorted set.

storage

object storage
cloud storage

0 回复
需要 登录 后方可回复, 如果你还没有账号你可以 注册 一个帐号。