美文网首页
scalability for dummies

scalability for dummies

作者: 程序员赤小豆_gzh同名 | 来源:发表于2018-10-26 18:32 被阅读0次
  • That leads to the first golden rule for scalability: every server contains exactly the same codebase and does not store any user-related data, like sessions or profile pictures, on local disc or memory.

  • Sessions need to be stored in a centralized data store which is accessible to all your application servers. It can be an external database or an external persistent cache, like Redis.

  • Database will become a bottleneck when app get slower and slower. Path #1, stick to Mysql, do master-slave replication, sharding, denormalization, sql tuning. Path #2, use NoSQL.

  • When database is still a bottleneck, you can consider caching!

  • The author prefer caching an object of data. Something like wrapping the data into a class.

    • user sessions (never use the database!)
    • fully rendered blog articles
    • activity streams
    • user<->friend relationships
  • Async stuff

Reference

相关文章

网友评论

      本文标题:scalability for dummies

      本文链接:https://www.haomeiwen.com/subject/vijdzftx.html