|
| 1 | +# Appendix A - Principles of Systems Design |
| 2 | +<div id="author-signature">Leedehai</div> |
| 3 | +Friday, June 2, 2017 |
| 4 | + |
| 5 | +> Computer systems: filesystems, operating systems, compilation systems, database management systems, networks, and many large software. |
| 6 | +
|
| 7 | +> This course is implementation-driven, but we have to step back and look at the bigger picture. |
| 8 | +
|
| 9 | +## A.1 Abstraction |
| 10 | +Separating behavior from implementation, defining clean interface to a component or subsystem that makes using and interacting with a system much, much easier. |
| 11 | + |
| 12 | +- You know POSIX C's `pthread` and C++'s `thread`, but you do not know how they are implemented. In fact, threading is not natively supported by C or assembly code, so they are actually built upon abstraction. |
| 13 | +- You know sockets, but the complicated world of networking layers are hidden behind the scene. |
| 14 | +- You know SQL languages (from CS145), but the implementation of a relational database managing system is not shown to users. |
| 15 | +- You know `g++` and `gdb`, but how are they implemented is not known to the clients. |
| 16 | + |
| 17 | +## A.2 Modularity and layering |
| 18 | +Subdivision of a larger system into a collection of smaller systems, which themselves can be further subdivided. Layering is a form of modularity, which is the organization of several modules that interact in some hierachical manner, where each layer typically only opens its interface to the module above and beneath it. |
| 19 | + |
| 20 | +- Compilation system `gcc`: preprocessor, lexer, parser, semantic analyzer, code generator. |
| 21 | +- Filesystems: sectors, blocks, inodes, file names, pathnames. |
| 22 | +- Internet: link layer, internet layer, transport layer, application layer. |
| 23 | +- GUI framework: MVC - model-view-control. |
| 24 | + |
| 25 | +## A.3 Naming and name resolution |
| 26 | +Names provide a way to refer to system resources, and name resolution is a means for converting between human-friendly names to machine-oriented ones. |
| 27 | + |
| 28 | +- Filesystems: file names, inode numbers, block numbers. |
| 29 | +- Internet: domain names, IP addresses. |
| 30 | + |
| 31 | +## A.4 Caching |
| 32 | +A cache is a component that stores data so that requests can be handled more quickly. |
| 33 | + |
| 34 | +- Computer: L1, L2 cache |
| 35 | +- Web servers: e.g. `memcache`, used in Facebook, etc. to handle large amount of request from users. |
| 36 | +- Web proxy servers and DNS servers have cache. |
| 37 | + |
| 38 | +## A.5 Virtualization: |
| 39 | +Abstraction that make manu hardware resources look like one, or make one look like many. |
| 40 | + |
| 41 | +- AFS (Andrew File System): make file systems on many machines look like one uniform machine. AFS grafts many independent, networked file systems into one rooted at `/afs`. You descend into various subdirectories of `/afs` with, in principle, zero knowledge of where in the world those directories are stored. Stanford uses OpenAFS for Stanford to log into AFS. |
| 42 | +- Multithreading, multiprocessing - make one thread or process look like many. |
| 43 | +- Vitual machines - make one physical machine look like many. |
| 44 | +- Load balancer of web servers - make many servers look like one. |
| 45 | + |
| 46 | +## A.6 Concurrency |
| 47 | +Run in real or pseudo parallelism. Multiprocessing, multithreading, signal and intercept handlers are all examples of concurrency. |
| 48 | + |
| 49 | +- Some programming languages—Erlang comes to mind— are so inherently concurrent that they adopt a programming model that makes race conditions virtually impossible. (Other languages—I'm thinking of pure JavaScript—adopt the view that concurrency, or at least threading, is too complicated and error-prone to support). |
| 50 | + |
| 51 | +## A.7 Client-server request-and-response |
| 52 | +Request/response is a way to organize functionality into modules that have a clear set of responsibilities. We've already had some experience with the request-and-response aspect of this. |
| 53 | + |
| 54 | +- HTTP, IMAP, NFS, AFS, DNS |
| 55 | + |
| 56 | +###### EOF |
0 commit comments