kandi background
Explore Kits

system-design-primer | design large-scale systems | Architecture library

 by   donnemartin Python Version: Current License: Non-SPDX

 by   donnemartin Python Version: Current License: Non-SPDX

Download this library from

kandi X-RAY | system-design-primer Summary

system-design-primer is a Python library typically used in Institutions, Learning, Education, Architecture applications. system-design-primer has no bugs, it has no vulnerabilities and it has medium support. However system-design-primer build file is not available and it has a Non-SPDX License. You can download it from GitHub.
Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • system-design-primer has a medium active ecosystem.
  • It has 143449 star(s) with 26399 fork(s). There are 5857 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 120 open issues and 55 have been closed. On average issues are closed in 142 days. There are 106 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of system-design-primer is current.
system-design-primer Support
Best in #Architecture
Average in #Architecture
system-design-primer Support
Best in #Architecture
Average in #Architecture

quality kandi Quality

  • system-design-primer has 0 bugs and 28 code smells.
system-design-primer Quality
Best in #Architecture
Average in #Architecture
system-design-primer Quality
Best in #Architecture
Average in #Architecture

securitySecurity

  • system-design-primer has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • system-design-primer code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
system-design-primer Security
Best in #Architecture
Average in #Architecture
system-design-primer Security
Best in #Architecture
Average in #Architecture

license License

  • system-design-primer has a Non-SPDX License.
  • Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.
system-design-primer License
Best in #Architecture
Average in #Architecture
system-design-primer License
Best in #Architecture
Average in #Architecture

buildReuse

  • system-design-primer releases are not available. You will need to build from source code and install.
  • system-design-primer has no build file. You will be need to create the build yourself to build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
  • system-design-primer saves you 270 person hours of effort in developing the same functionality from scratch.
  • It has 655 lines of code, 148 functions and 26 files.
  • It has low code complexity. Code complexity directly impacts maintainability of the code.
system-design-primer Reuse
Best in #Architecture
Average in #Architecture
system-design-primer Reuse
Best in #Architecture
Average in #Architecture
Top functions reviewed by kandi - BETA

kandi has reviewed system-design-primer and discovered the below as its top functions. This is intended to give you an instant insight into system-design-primer implemented functionality, and help decide if they suit your requirements.

  • Set the value of a query .
  • Sort the values of a key .
  • Dispatch a call .
  • Crawl all pages .
  • Calculate the best score .
  • Return the current card .
  • Find the best category of a transaction .
  • Process a query .
  • Remove key from the table .
  • Disks a vehicle .

system-design-primer Key Features

Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.

Availability in numbers

copy iconCopydownload iconDownload
Availability (Total) = Availability (Foo) * Availability (Bar)

When to update the cache

copy iconCopydownload iconDownload
def get_user(self, user_id):
    user = cache.get("user.{0}", user_id)
    if user is None:
        user = db.query("SELECT * FROM users WHERE user_id = {0}", user_id)
        if user is not None:
            key = "user.{0}".format(user_id)
            cache.set(key, json.dumps(user))
    return user

Remote procedure call (RPC)

copy iconCopydownload iconDownload
GET /someoperation?data=anId

POST /anotheroperation
{
  "data":"anId";
  "anotherdata": "another value"
}

Representational state transfer (REST)

copy iconCopydownload iconDownload
GET /someresources/anId

PUT /someresources/anId
{"anotherdata": "another value"}

Powers of two table

copy iconCopydownload iconDownload
Power           Exact Value         Approx Value        Bytes
---------------------------------------------------------------
7                             128
8                             256
10                           1024   1 thousand           1 KB
16                         65,536                       64 KB
20                      1,048,576   1 million            1 MB
30                  1,073,741,824   1 billion            1 GB
32                  4,294,967,296                        4 GB
40              1,099,511,627,776   1 trillion           1 TB

Latency numbers every programmer should know

copy iconCopydownload iconDownload
Latency Comparison Numbers
--------------------------
L1 cache reference                           0.5 ns
Branch mispredict                            5   ns
L2 cache reference                           7   ns                      14x L1 cache
Mutex lock/unlock                           25   ns
Main memory reference                      100   ns                      20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy            10,000   ns       10 us
Send 1 KB bytes over 1 Gbps network     10,000   ns       10 us
Read 4 KB randomly from SSD*           150,000   ns      150 us          ~1GB/sec SSD
Read 1 MB sequentially from memory     250,000   ns      250 us
Round trip within same datacenter      500,000   ns      500 us
Read 1 MB sequentially from SSD*     1,000,000   ns    1,000 us    1 ms  ~1GB/sec SSD, 4X memory
HDD seek                            10,000,000   ns   10,000 us   10 ms  20x datacenter roundtrip
Read 1 MB sequentially from 1 Gbps  10,000,000   ns   10,000 us   10 ms  40x memory, 10X SSD
Read 1 MB sequentially from HDD     30,000,000   ns   30,000 us   30 ms 120x memory, 30X SSD
Send packet CA->Netherlands->CA    150,000,000   ns  150,000 us  150 ms

Notes
-----
1 ns = 10^-9 seconds
1 us = 10^-6 seconds = 1,000 ns
1 ms = 10^-3 seconds = 1,000 us = 1,000,000 ns

License

copy iconCopydownload iconDownload
Copyright 2017 Donne Martin

Creative Commons Attribution 4.0 International License (CC BY 4.0)

http://creativecommons.org/licenses/by/4.0/

Community Discussions

Trending Discussions on system-design-primer
  • crawler design - calling an async job vs. calling a service
Trending Discussions on system-design-primer

QUESTION

crawler design - calling an async job vs. calling a service

Asked 2020-Apr-10 at 10:56

I'm looking at donne martin's design for a web crawler. the crawler service processes a newly crawled url, and then:

  • Adds a job to the Reverse Index Service queue to generate a reverse index
  • Adds a job to the Document Service queue to generate a static title and snippet

what would happen if instead the crawler service would synchronously call these 2 services? I would still be able to horizontally scale all 3 services according to the load on each, right? what came to me as a possible reason is just more complex flow control if one of them fails. are there other more compelling reasons for these async jobs?

ANSWER

Answered 2020-Apr-10 at 03:01

There are likely more reasons behind this design choice, but one is almost certainly use of Microservices. It is a popular technique, so demonstrating command of it is a good idea for answering design questions and benefits of it are well described on Wikipedia:

  • Modularity: This makes the application easier to understand, develop, test, and become more resilient to architecture erosion.[6] This benefit is often argued in comparison to the complexity of monolithic architectures.[33]
  • Scalability: Since microservices are implemented and deployed independently of each other, i.e. they run within independent processes, they can be monitored and scaled independently.[34]
  • Integration of heterogeneous and legacy systems: microservices is considered as a viable mean for modernizing existing monolithic software application.[35][36] There are experience reports of several companies who have successfully replaced (parts of) their existing software by microservices, or are in the process of doing so.[37] The process for Software modernization of legacy applications is done using an incremental approach.[38]
  • Distributed development: it parallelizes development by enabling small autonomous teams to develop, deploy and scale their respective services independently.[39] It also allows the architecture of an individual service to emerge through continuous refactoring.[40] Microservice-based architectures facilitate continuous integration, continuous delivery and deployment.[41] [42]

All of those apply in this case. Indeed, well-defined API makes the modules separate, reusable, easy to understand. Most likely each of the 3 modules will have very different execution time and CPU/memory requirements, so scaling them separately makes a lot of sense. Some companies like Amazon mentioned on the page might go much further splitting those modules into microservices based on the team number, so this split into 3 services can very well be chosen based on the assumption of having 3 teams, rather than technical constraints.

The page also describes criticism of the technique.

Source https://stackoverflow.com/questions/60479306

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install system-design-primer

You can download it from GitHub.
You can use system-design-primer like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

Support

This is a continually updated, open source project.

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Share this Page

share link
Compare Architecture Libraries with Permissive License
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.