> 一份2021年02月27日,3月1日的信息流提炼 ### 构建startup的设计体系 原文:[Building a Design System at a Startup](https://news.ycombinator.com/item?id=26291215) > 最近处理这个问题的一些经验。除非你有一个庞大的设计团队和充足的时间,最好从已有的设计系统开始,并对其进行调整。 - [UI2: Figma's Design System](https://www.figma.com/community/file/928108847914589057) ### 10个方法保护你的数据库 原文:[10 Ways To Protect Your Mission-Critical Database](https://betterprogramming.pub/10-ways-to-protect-your-mission-critical-database-7d99d7a52c79) - 备份,备份,备份。**自动定期**的备份策略 - 测试你的备份恢复策略:当正式环境出错时。(基于【RTO:恢复点目标】和【RPO:恢复时间目标】) > Netflix开创了 "无秩工程(chaos engineering)"--一门在生产系统上测试故障场景的学科,以确保你的基础设施真正具有弹性。 - 写下依赖数据库的业务/流程,以便快速掌握影响范围。 - 应用最低权限安全原则。正式环境尽量只提供只读全线。 - 保证数据库命名正确(比如带prod)。这样人们通过查看就知道必须非常小心地对待它。 - 不要相信任何人工配置的资源。现代DevOps和GitOps文化引入了一种非常有用的范式--基础设施即代码,它可以极大地帮助为开发或恢复场景构建特定资源的精确副本。 - 不要让一个人管理全部的服务环境。 - 在让员工使用任何资源之前,先对他们进行指导。 - 使用serverless并监控您的资源,因为serverless背后有平台可靠的devops流程且会检查您的备份策略。 ### 其他值得阅读 - 为简单的商业模式辩护. [In Defense of Simple Business Models](https://www.karllhughes.com/posts/startup-business-model) - 一次建造,反复销售:SaaS - 一次收藏,多次销售:数据贩卖,在线课程 - 重复建设,重复销售:电子商务、产品化服务 - 一次建造,一次销售:定制珠宝、网页设计公司 - 中间人:广告、经纪人、两面市场。 - [内存管理设计精要](https://draveness.me//system-design-memory-management) - 内存管理系统 - 用户程序(Mutator)- 可以通过分配器创建对象或者更新对象持有的指针; - 内存分配器(Allocator)— 处理用户程序的的内存分配请求; - 垃圾收集器(Collector)- 标记内存中的对象并回收不需要的内存; - 静态内存: 在编译期间确认, 固定内存,无运行时,不支持递归 - 栈内存(BP&SP寄存器储存当前栈):固定内存,栈指针管理,栈溢出错误,支持递归 - 堆内存:灵活性,按需分配,可变大小,内存泄漏,悬挂指针。←编程意义上的内存管理 - 手动管理: C/C++ - 自动管理:最常见的自动内存管理机制就是垃圾回收,一些编程语言也会使用自动引用计数辅助内存的管理。 ### 每天学点写作 [Two ways to improve your storytelling](https://twitter.com/david_perell/status/1257477983608041473) > 伟大的讲故事的人都知道,他们在故事中营造的紧张气氛与故事中实际发生的事情同样重要。 > > Great storytellers know that the tension they build to lead up to their climax is as important as what actually happens in their story. > > 就像电影大师阿尔弗雷德-希区柯克说的: "爆炸并不可怕,可怕的是对它的期待" > > As the master filmmaker Alfred Hitchcock said: “There is no terror in the bang, only in the anticipation of it.” > 《南方公园》的主创人员分享了他们最喜欢的讲故事的建议。 用 "但是 "和 "因此 "这样的词来推动你的故事,而不是 "然后"。 > > The creators of South Park share their favorite storytelling advice. Drive your story with words like “but” and “therefore” instead of “and then.” ### 其他值得阅读 - AI|使用GPT-3自动生成业务SQL: [Automating my job by using GPT-3 to generate database-ready SQL to answer business questions](https://blog.seekwell.io/gpt3) - [bkane1/gpt3-instruct-sandbox](https://github.com/bkane1/gpt3-instruct-sandbox) - Redbean - 单文件可分发网络服务器: [Show HN: Redbean – Single-file distributable web server](https://news.ycombinator.com/item?id=26271117) - 深度怀旧 可以把亲人的老照片变成动人的视频: [‘Deep Nostalgia’ can turn old photos of your relatives into moving videos](https://news.ycombinator.com/item?id=26279372) - 感觉和最近抖音?上火的视频段子中用的技术很像。 - CSS动画过渡的交互式指南:[An Interactive Guide to CSS Transitions](https://www.joshwcomeau.com/animation/css-transitions/) ### 今日收获 - 哲思|人类时模仿机器。你可以从英语的历史中看到我们模仿本能的根源。在莎士比亚的时代,"猿 "这个词有两个意思: "灵长类 "和 "模仿"。[Humans are imitation machines.](https://twitter.com/david_perell/status/1365445813644783617?s=20) You can see the roots of our imitative instincts in the history of English. In the time of Shakespeare, the word "ape" had two meanings: "primate" and "to imitate." - Dev|分支尽量用`git rebase master`而不是`git merge master`来保持commits历史的清爽。 - Dev|策略模式:针对不同策略(e.g.大量if-else)的情况下,抽象出一个统一接口使其符合开闭原则。[Go的实现: stratege_test.go](https://github1s.com/senghoo/golang-design-pattern/blob/HEAD/15_strategy/strategy_test.go) - **作为一个领域的初学者,最好从小的项目学起。**如果只是想建立一些太过于脱离自身知识库的东西,就像在没有学会游泳之前就一头跳进大海。 - [Reddit | As a beginner, I'd start smaller](https://www.reddit.com/r/ProgrammingBuddies/comments/lsynnr/how_do_i_find_a_mentor/?) - 线上服务自动重启的最佳实践. [v2ex](https://www.v2ex.com/t/757208#reply5) - 服务进程挂起: [Docker Healthcheck](https://stackoverflow.com/questions/57515333/how-to-do-health-check-of-a-spring-boot-applications-which-is-running-in-docker) - 服务进程退出:supervisor, systemd restart 设置成 on-failure