scalability for dummies
2018-10-26 本文已影响0人
程序员赤小豆_gzh同名
-
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