[译]《Grokking the System Design Interview》设计Twitter

这是一篇双语翻译的文章,原文出自 grok_system_design_interview.pdf 的一篇文章《Designing Twitter》设计 Twitter。 Let’s design a Twitter-like social networking service. Users of the service will be able to post tweets, follow other people, and favorite tweets. Difficulty Level: Medium 让我们设计一个类似 Twitter 的社交网络服务。该服务的用户将能够发布推文、关注其他人以及喜欢的推文。难度级别:中等 ...

2023-12-14 · 17 min · 8405 words · chensoul

如何设计一个分布式ID生成器保证ID按时间有序?

很多业务有生成唯一 ID 并作为数据库主键的需求。数据库会在这个字段上建立聚集索引(参考 MySQL InnoDB),即该字段会影响各条数据再物理存储上的顺序。 ID还要尽可能短,节省内存,让数据库索引效率更高。基本上64位整数能够满足绝大多数的场景,但是如果能做到比64位更短那就更好了。需要根据具体业务进行分析,预估出ID的最大值,这个最大值通常比64位整数的上限小很多,于是我们可以用更少的bit表示这个ID。 ...

2023-12-05 · 6 min · 2830 words · chensoul

[译]《Grokking the System Design Interview》设计Dropbox

这是一篇双语翻译的文章,原文出自 grok_system_design_interview.pdf 的一篇文章《Designing Dropbox》设计 Dropbox。 Let’s design a file hosting service like Dropbox or Google Drive. Cloud file storage enables users to store their data on remote servers. Usually, these servers are maintained by cloud storage providers and made available to users over a network (typically through the Internet). Users pay for their cloud data storage on a monthly basis. Similar Services: OneDrive, Google Drive Difficulty Level: Medium ...

2023-11-24 · 20 min · 9975 words · chensoul

[译]《Grokking the System Design Interview》设计Facebook Messenger

这是一篇双语翻译的文章,原文出自 grok_system_design_interview.pdf 的一篇文章《Designing Facebook Messenger》设计 Facebook Messenger。 Let’s design an instant messaging service like Facebook Messenger where users can send text messages to each other through web and mobile interfaces. 让我们设计一个像 Facebook Messenger 这样的即时消息服务,用户可以通过网络和移动界面互相发送短信。 ...

2023-11-24 · 17 min · 8383 words · chensoul

[译]《Grokking the System Design Interview》设计Instagram

这是一篇双语翻译的文章,原文出自 grok_system_design_interview.pdf 的一篇文章《Designing Instagram》设计 Instagram。 Let’s design a photo-sharing service like Instagram, where users can upload photos to share them with other users. Similar Services: Flickr, Picasa Difficulty Level: Medium 让我们设计一个像 Instagram 这样的照片共享服务,用户可以上传照片与其他用户共享。类似服务:Flickr、Picasa 难度级别:中 ...

2023-11-24 · 18 min · 8734 words · chensoul

[译]《Grokking the System Design Interview》设计Pastebin

这是一篇双语翻译的文章,原文出自 grok_system_design_interview.pdf 的一篇文章《Designing Pastebin》设计 Pastebin。 Let’s design a Pastebin like web service, where users can store plain text. Users of the service will enter a piece of text and get a randomly generated URL to access it. Similar Services: pastebin.com, pasted.co, chopapp.com Difficulty Level: Easy 让我们设计一个类似 Pastebin 的 Web 服务,用户可以在其中存储纯文本。该服务的用户将输入一段文本并获得一个随机生成的 URL 来访问它。类似服务:pastebin.com、pasted.co、hopapp.com 难度级别:简单 ...

2023-11-24 · 11 min · 5254 words · chensoul

[译]《Grokking the System Design Interview》域名系统

这是一篇双语翻译的文章,原文出自《Grokking the System Design Interview》教程的 Domain Name System 这篇章节。 Introduction to Domain Name System (DNS) 域名系统 (DNS) 简介 The origins of DNS DNS 的起源 Let’s consider the example of a mobile phone where a unique number is associated with each user. To make calls to friends, we can initially try to memorize some of the phone numbers. However, as the number of contacts grows, we’ll have to use a phone book to keep track of all our contacts. This way, whenever we need to make a call, we’ll refer to the phone book and dial the number we need. ...

2023-11-17 · 14 min · 6757 words · chensoul

如何设计一个短网址服务

如何生成一个短网址服务,参考 Design a URL Shortening Service / TinyURL 和 Designing a URL Shortening service like TinyURL 两篇文章,整理如下笔记。 其中主要包括以下内容: 设计一个系统有哪些步骤 需求 预估 设计 高层次设计 API 设计 细节设计 评估 设计一个短网址服务的细节 设计步骤 Requirements 需求 功能性需求 短 URL 生成:我们的服务应该能够为给定 URL 生成唯一的较短别名。 重定向:给定一个短链接,我们的系统应该能够将用户重定向到原始 URL。 自定义短链接:用户应该能够使用我们的系统为其 URL 生成自定义短链接。 删除:在赋予权限的情况下,用户应该能够删除我们系统生成的短链接。 更新:如果有适当的权限,用户应该能够更新与短链接关联的长 URL。 过期时间:短链接必须有一个默认的过期时间,但用户应该可以根据自己的需求设置过期时间。 分功能性需求:可用性、可靠性、扩展性、可维护性、容错性 可用性:我们的系统应该具有高可用性,因为即使是第二次停机的一小部分也会导致 URL 重定向失败。由于我们系统的域位于 URL 中,因此我们没有停机时间的优势,并且我们的设计必须灌输容错条件。 可扩展性:我们的系统应该能够随着需求的增加而水平扩展。 可读性:我们的系统生成的短链接应该易于阅读、区分和输入。 延迟:系统应以低延迟执行,以便为用户提供流畅的体验。 不可预测性:从安全角度来看,我们的系统生成的短链接应该是高度不可预测的。这确保了下一个短 URL 不会连续生成,从而消除了有人猜测我们的系统已经生成或将生成的所有短 URL 的可能性。 Estimation 估计 ...

2023-11-17 · 5 min · 2184 words · chensoul

[译]《Grokking the System Design Interview》系统设计主模板

这是一篇双语翻译的文章,原文出自《Grokking the System Design Interview》教程的 System Design Master Template 这篇章节。 System design interviews are unstructured by design. In these interviews, you are asked to take on an open-ended design problem that doesn’t have a standard solution. 系统设计面试在设计上是非结构化的。在这些面试中,您被要求解决一个没有标准解决方案的开放式设计问题。 ...

2023-11-16 · 17 min · 8123 words · chensoul

[译]《Grokking the System Design Interview》系统设计访谈:分步指南

这是一篇双语翻译的文章,原文出自 grok_system_design_interview.pdf 的一篇文章《System Design Interviews: A step by step guide》系统设计访谈:分步指南。 A lot of software engineers struggle with system design interviews (SDIs) primarily because of three reasons: 许多软件工程师在系统设计面试(SDI)中遇到困难,主要是因为以下三个原因: ...

2023-11-16 · 7 min · 3138 words · chensoul