Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
deepaksood619 committed Jan 23, 2024
1 parent d9eabee commit f8c22a2
Show file tree
Hide file tree
Showing 19 changed files with 112 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Humans cannot be trusted, they trust software more than other humans - Haven't y

[It’s Millet Time!](https://finshots.in/archive/its-millet-time/)

[Introducing r1 - YouTube](https://www.youtube.com/watch?v=22wlLy7hKP4)

## Top changes

1. We will be capable of having (subject to no political barriers) Al-based near free doctors, lawyers and tutors for every citizen of the planet that will amplify our human professionals to improve accessibility and care.
Expand Down
2 changes: 1 addition & 1 deletion docs/ai/computer-vision-cv/others.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ https://image-net.org

## Vertex AI Matching Engine

Vertex AI Matching Engine provides the industry's leading high scale, low latency, vector-similarity matching (also known asapproximate nearest neighbor) service, and industry-leading algorithms to train semantic embeddings for similarity-matching use cases.
Vertex AI Matching Engine provides the industry's leading high scale, low latency, vector-similarity matching (also known as approximate nearest neighbor) service, and industry-leading algorithms to train semantic embeddings for similarity-matching use cases.

https://cloud.google.com/vertex-ai/docs/matching-engine/overview

Expand Down
1 change: 1 addition & 0 deletions docs/ai/learning-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- [Harvard CS50's Introduction to Artificial Intelligence with Python – Free University Course](https://www.freecodecamp.org/news/harvard-cs50s-ai-python-course)
- Mathematics (probability, statistics, calculus)
- [Machine Learning & Neural Networks without Libraries – No Black Box Course - YouTube](https://www.youtube.com/watch?v=3wwiOSxDAmg)
- [udlbook](https://udlbook.github.io/udlbook/)

## DS (Data Science) + DA (Data Analytics) + DE (Data Engineering)

Expand Down
1 change: 1 addition & 0 deletions docs/ai/llm/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,4 @@ Moving from information to knowledge age
- [[#29] AI Evolution: From AlexNet to Generative AI – Redefining the Paradigm of Software Development](https://bizit.substack.com/p/29-ai-evolution-from-alexnet-to-generative)
- [Google "We Have No Moat, And Neither Does OpenAI"](https://www.semianalysis.com/p/google-we-have-no-moat-and-neither)
- [AGI-Proof Jobs: Navigating the Impending Obsolescence of Human Labor in the Age of AGI - YouTube](https://www.youtube.com/watch?v=Ahh92qtRwos&ab_channel=DavidShapiro)
- [A DeepMind AI rivals the world's smartest high schoolers at geometry](https://www.understandingai.org/p/a-deepmind-ai-rivals-the-worlds-smartest)
2 changes: 2 additions & 0 deletions docs/cloud/aws/networking-content-delivery/aws-elb.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Elastic Load Balancing automatically distributes incoming application traffic ac

This load balancer operates at Layer 7 of the OSI model. It can be used to load-balance HTTP and HTTPS applications and can invoke Lambda functions, among several other features.

[IP address types for your Application Load Balancer - Elastic Load Balancing](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-ip-address-type.html)

## Network Load Balancer (NLB)

Used for extreme performance, this load balancer operates at Layer 4 of the OSI model. It can, therefore, load-balance any kind of TCP traffic and can handle large amounts of requests with low latency.
Expand Down
22 changes: 8 additions & 14 deletions docs/computer-science/interview-question/system-design-others.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,12 @@ Non-functional requirements

## Others

HTTP + json is not good (because contract is not upheld from developers while sending apis)

[Overview of Discord's data platform that daily processes petabytes of data and trillion points - YouTube](https://www.youtube.com/watch?v=yGpEzO32lU4)

[10 Tips for Building Resilient Payment Systems (2023)](https://shopify.engineering/building-resilient-payment-systems)

- HTTP + json is not good (because contract is not upheld from developers while sending apis)
- [Overview of Discord's data platform that daily processes petabytes of data and trillion points - YouTube](https://www.youtube.com/watch?v=yGpEzO32lU4)
- [10 Tips for Building Resilient Payment Systems (2023)](https://shopify.engineering/building-resilient-payment-systems)
- [How Shopify’s engineering improved database writes by 50% with ULID - YouTube](https://www.youtube.com/watch?v=f53-Iw_5ucA)

[Ep 1 - @RazorpayEngineering's journey to microservices and ensuring data consistency - YouTube](https://www.youtube.com/watch?v=yqkyq8TPWbg)

[How to NOT Fail a System Design Interview (By a Data Engineer) - YouTube](https://www.youtube.com/watch?v=WQBc2mY9Jng)

[How Giphy uses CDN to serve 10 billion GIFs every day - YouTube](https://www.youtube.com/watch?v=-bo7oVejgRM)

[What happens before the Backend gets the Request - YouTube](https://www.youtube.com/watch?v=gSQoA4SYhJY)
- [Ep 1 - @RazorpayEngineering's journey to microservices and ensuring data consistency - YouTube](https://www.youtube.com/watch?v=yqkyq8TPWbg)
- [How to NOT Fail a System Design Interview (By a Data Engineer) - YouTube](https://www.youtube.com/watch?v=WQBc2mY9Jng)
- [How Giphy uses CDN to serve 10 billion GIFs every day - YouTube](https://www.youtube.com/watch?v=-bo7oVejgRM)
- [What happens before the Backend gets the Request - YouTube](https://www.youtube.com/watch?v=gSQoA4SYhJY)
- [How Discord Serves 15-Million Users on One Server](https://blog.bytebytego.com/p/how-discord-serves-15-million-users?)
2 changes: 2 additions & 0 deletions docs/databases/concepts/history.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@
![image](../../media/History-image16.jpg)

[01 - History of Databases (CMU Databases / Spring 2020)](https://www.youtube.com/watch?v=SdW5RKUboKc)

[Databases in 2023: A Year in Review | OtterTune](https://ottertune.com/blog/2023-databases-retrospective)
56 changes: 56 additions & 0 deletions docs/databases/nosql-databases/etcd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# etcd

etcd is a distributed key value store that provides a reliable way to store data across a cluster of machines. It's open-source and available on GitHub. etcd gracefully handles leader elections during network partitions and will tolerate machine failure, including the leader.

Your applications can read and write data into etcd. A simple use-case is to store database connection details or feature flags in etcd as key value pairs. These values can be watched, allowing your app to reconfigure itself when they change.

Advanced uses take advantage of the consistency guarantees to implement database leader elections or do distributed locking across a cluster of workers.

etcd is a distributed key-value store. In fact, etcd is the primary datastore of Kubernetes; storing and replicating all Kubernetes cluster state. As a critical component of a Kubernetes cluster having a reliable automated approach to its configuration and management is imperative.

As a distributed consensus-based system, the cluster configuration of etcd can be complicated. Bootstrapping, maintaining quorum, reconfiguring cluster membership, creating backups, handling disaster recovery, and monitoring critical events are tedious work, and require etcd-specific expertise.

- uses Raft consensus algorithm - https://raft.github.io
- etcd means distributed etc directory
- used by kubernetes, emqx, openshift

### Operator

An Operator builds upon the basic Kubernetes resource and controller concepts but includes application domain knowledge to take care of common tasks. They reduce the complexity of running distributed systems and help you focus on the desired configuration, not the details of manual deployment and lifecycle management.

https://coreos.com/etcd

https://github.com/etcd-io/etcd

https://etcd.readthedocs.io/en/latest/faq.html#what-is-etcd

https://jepsen.io/analyses/etcd-3.4.3

### Is it possible for etcd to have a split-brain scenario?

What is split-brain scenario?

Split brain scenarios occur when a group of nodes in a distributed system loses communication with each other primarily due to network partitioning, resulting in inconsistent or conflicting system states.

etcd is designed to avoid split-brain scenarios, as it relies on a leader election mechanism to ensure that only one node is active and in control of the cluster at any given time.

The official documentation says, there is no “split-brain” in etcd. Here is why.

- A network partition divides the etcd cluster into two parts; one with a member majority and the other with a member minority.
- The majority side becomes the available cluster and the minority side is unavailable
- If the leader is on the majority side, then from the majority point of view the failure is a minority follower failure.
- If the leader is on the minority side, then it is a leader failure.
- The leader on the minority side steps down and the majority side elects a new leader.
- Once the network partition clears, the minority side automatically recognizes the leader from the majority side and recovers its state.

So how does the leader know weather its in the majority or minority?

etcd nodes regularly send "heartbeats" to each other.

If the leader is in the minority part of the split, it will not receive acknowledgments from the majority of the nodes.

When the leader doesn't get enough responses to its heartbeats, it realizes that it might be in the minority.

To maintain the integrity of the system, it steps down from its leadership role.

On the other side of the partition, where the majority of nodes are, they also notice they're not getting heartbeats from the leader. Since they are the majority, they can elect a new leader among themselves.
1 change: 1 addition & 0 deletions docs/databases/nosql-databases/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [MongoDB](mongodb/readme.md)
- [Druid](druid/readme.md)
- [Cassandra](cassandra/readme.md)
- [etcd](databases/nosql-databases/etcd.md)
- [AWS DyanamoDB](aws-dynamodb/readme.md)
- [Time Series DB](time-series-db/readme.md)
- [YugabyteDB](databases/nosql-databases/yugabytedb.md)
Expand Down
8 changes: 4 additions & 4 deletions docs/databases/nosql-databases/redis/redis-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ https://redis.io/commands/scan

## Persistence

- The RDB persistence performs point-in-time snapshots of your dataset at specified intervals.
- The AOF persistence logs every write operation received by the server, that will be played again at server startup, reconstructing the original dataset. Commands are logged using the same format as the Redis protocol itself, in an append-only fashion. Redis is able to rewrite the log in the background when it gets too big.
- If you wish, you can disable persistence completely, if you want your data to just exist as long as the server is running.
- It is possible to combine both AOF and RDB in the same instance. Notice that, in this case, when Redis restarts the AOF file will be used to reconstruct the original dataset since it is guaranteed to be the most complete.
- **RDB** (Redis Database): RDB persistence performs point-in-time snapshots of your dataset at specified intervals.
- **AOF** (Append Only File): AOF persistence logs every write operation received by the server. These operations can then be replayed again at server startup, reconstructing the original dataset. Commands are logged using the same format as the Redis protocol itself.
- **No persistence**: You can disable persistence completely. This is sometimes used when caching.
- **RDB + AOF**: You can also combine both AOF and RDB in the same instance. Notice that, in this case, when Redis restarts the AOF file will be used to reconstruct the original dataset since it is guaranteed to be the most complete.

![redis-persistance](../../../media/Pasted%20image%2020231224140113.png)

Expand Down
31 changes: 0 additions & 31 deletions docs/databases/others/databases-others.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,37 +260,6 @@ https://en.wikipedia.org/wiki/Lightning_Memory-Mapped_Database

http://www.lmdb.tech/doc

## etcd

etcd is a distributed key value store that provides a reliable way to store data across a cluster of machines. It's open-source and available on GitHub. etcd gracefully handles leader elections during network partitions and will tolerate machine failure, including the leader.

Your applications can read and write data into etcd. A simple use-case is to store database connection details or feature flags in etcd as key value pairs. These values can be watched, allowing your app to reconfigure itself when they change.

Advanced uses take advantage of the consistency guarantees to implement database leader elections or do distributed locking across a cluster of workers.

- Used by kubernetes, emqx, openshift

etcd is a distributed key-value store. In fact,etcdis the primary datastore of **Kubernetes;** storing and replicating allKubernetescluster state. As a critical component of aKubernetescluster having a reliable automated approach to its configuration and management is imperative.

- As a distributed consensus-based system, the cluster configuration of etcd can be complicated. Bootstrapping, maintaining quorum, reconfiguring cluster membership, creating backups, handling disaster recovery, and monitoring critical events are tedious work, and require etcd-specific expertise.

- Uses Raft consensus algorithm
- https://raft.github.io

- etcd is pronounced/ˈɛtsiːdiː/, and means distributedetcdirectory.

- Operator

An Operator builds upon the basic Kubernetes resource and controller concepts but includes application domain knowledge to take care of common tasks. They reduce the complexity of running distributed systems and help you focus on the desired configuration, not the details of manual deployment and lifecycle management.

https://coreos.com/etcd

https://github.com/etcd-io/etcd

https://etcd.readthedocs.io/en/latest/faq.html#what-is-etcd

https://jepsen.io/analyses/etcd-3.4.3

## KsqlDB

The event streaming database purpose-built for stream processing applications.
Expand Down
6 changes: 5 additions & 1 deletion docs/devops/ides/jupyter-jupyterlab-notebook/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ services:
- 8888:8888
```
### Others
### Querybook
https://www.querybook.org
Expand All @@ -263,3 +263,7 @@ Querybook is a Big Data Querying UI, combining collocated table metadata and a s
## SQL Notebooks
https://engineering.fb.com/2022/04/26/developer-tools/sql-notebooks
## Others
[GitHub - marimo-team/marimo: A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git.](https://github.com/marimo-team/marimo)
19 changes: 10 additions & 9 deletions docs/devops/monitoring/prometheus/prometheus-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@
## Scaling and Augmenting Prometheus

1. Simplified metric collection

2. Events correlation and alerts

3. Troubleshooting and tracing

4. Security

## Metrics Collection Questions
Expand All @@ -27,19 +24,19 @@

## Vertical Sharing and Federation

## Vertical Sharing
### Vertical Sharing

If a single Prometheus server cannot handle it all, one server per datacenter or availability zone can be run per cluster or even per application. It is not unusual to see Kubernetes with its own Prometheus server for cluster metrics while there is another server for service and application metrics. This way, you can scale down the requirements of each Prometheus server. This is known as vertical sharing.

## Federation
### Federation

Federation is another approach that allows for building a hierarchical tree to aggregate metrics. Some Prometheus servers collect high-resolution metrics (this could be per container metrics) and then the upstream server only stores the aggregated metrics (global service metrics).

## CORTEX, THANOS, AND M3

To solve some of these limitations, a lot of third-party open-source projects have appeared recently.

## Cortex
### Cortex

Cortex allows for storing time series data in a key-value store like Cassandra, AWS DynamoDB, or Google BigTable. It offers a Prometheus compatible query API, and you can push metrics into a write endpoint. This makes it best suited for cloud environments and multi-tenant scenarios like service providers building hosted and managed platforms.

Expand All @@ -54,7 +51,7 @@ Cortex provides horizontally scalable, highly available, multi-tenant, long term

https://github.com/cortexproject/cortex

## Architecture
#### Architecture

Cortex has a fundamentally service-based design, with its essential functions split up into single-purpose components that can be independently scaled:

Expand All @@ -71,12 +68,16 @@ As the diagram shows, Cortex "completes" the Prometheus Monitoring System. To ad

https://www.cncf.io/blog/2018/12/18/cortex-a-multi-tenant-horizontally-scalable-prometheus-as-a-service

## Thanos
### Thanos

Thanos stores time series data in an object store like AWS S3, Google Cloud Storage, etc. Thanos pushes metrics through a side-car container from each Prometheus server through the gRPC store API to the query service in order to provide a global query view. The side-car container also pushes immutable data blocks to the object storage. When you need to retrieve data that is on block storage, the store component takes care of that. The compactor component takes care of compaction and downsampling.

![image](../../../media/DevOps-Monitoring-Prometheus-Architecture-image2.jpg)

## M3
### M3

M3 is an open source, large-scale metrics platform developed by Uber. It has its own time series database, M3DB. Like Thanos, M3 also uses a side-car container to push the metrics to the DB. In addition, it supports metric deduplication and merging, and provides distributed query support.

## Links

[Prometheus Architecture: Complete Breakdown Of Key Components](https://devopscube.com/prometheus-architecture)
4 changes: 3 additions & 1 deletion docs/devops/terminal-bash/others.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,6 @@ Plus, you can make your interactive filter available inside your programmable te

## Others

https://github.com/google/zx
[GitHub - google/zx: A tool for writing better scripts](https://github.com/google/zx)

[GitHub - YS-L/csvlens: Command line csv viewer](https://github.com/YS-L/csvlens)
10 changes: 5 additions & 5 deletions docs/devops/terminal-bash/shell-bash-script.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ find . -type f | grep -v "media" | sed 's|\(.*/\)[^A-Z]*\([A-Z].*\)|mv \"&\" \"\

## References

https://en.wikipedia.org/wiki/Shell_script

https://www.shellscript.sh

https://www.shellscript.sh/loops.html
- https://en.wikipedia.org/wiki/Shell_script
- https://www.shellscript.sh
- https://www.shellscript.sh/loops.html
- [Top Shell Scripting Interview Questions (2024) - InterviewBit](https://www.interviewbit.com/shell-scripting-interview-questions/)
- [Top 30 Shell Scripting Interview Questions And Answers for 2023](https://www.simplilearn.com/shell-scripting-interview-questions-article)
2 changes: 2 additions & 0 deletions docs/frontend/frontend-intro/others.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ Birme - https://www.birme.net

[AI Image Upscaler - Enlarge & Enhance Your Photos for Free - Upscale.media](https://www.upscale.media/)

[Image Resizer - Crop & Resize Image Online | RedKetchup](https://redketchup.io/image-resizer)

```bash
brew install imagemagick

Expand Down
5 changes: 5 additions & 0 deletions docs/knowledge/links.md
Original file line number Diff line number Diff line change
Expand Up @@ -1481,5 +1481,10 @@
1471. [State of value investing in 2024](https://youtu.be/dLW0h8lPcG8?si=mq4JK0ZhA2vo8doJ)
1472. [Cathie Wood "Mark My Words, Everyone Who Own These 3 Stocks Will Become ...](https://youtu.be/Ab-VwBpQYP0?si=Gep0a5oE-6-nONX9)
1473. [8 Investing Hacks That Will Actually Improve Your Portfolio - YouTube](https://www.youtube.com/watch?v=AXNNdAyVdhk&ab_channel=NewMoney)
1474. [I thought this rotating house was impossible. - YouTube](https://www.youtube.com/watch?v=gisdyTBMNyQ)
1475. [Tata Projects, Transforming Lives by building MTHL - YouTube](https://www.youtube.com/watch?v=ReOKecV0ldw)
1476. [Top 10 Announcements From Consumer Electronics Show! - YouTube](https://www.youtube.com/watch?v=wdPjcxGtQ6o)
1477. [Why Rabbit R1 Won't Work! - YouTube](https://www.youtube.com/watch?v=B6lHomRD7C0)
1478. [The Special Design That Makes Library Books Indestructible - YouTube](https://www.youtube.com/watch?v=06wObrv15fc)

## End
1 change: 1 addition & 0 deletions docs/python/advanced/others.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,4 @@ The easiest way to do so is to useimport my_modulesyntax, rather thanfrom my_mod
- https://www.codementor.io/@arpitbhayani/how-python-implements-super-long-integers-12icwon5vk
- https://www.toptal.com/python/interview-questions
- [The Power Of The Plugin Architecture In Python](https://youtu.be/iCE1bDoit9Q)
- [Fastest Way to Read Excel in Python | Haki Benita](https://hakibenita.com/fast-excel-python)
6 changes: 3 additions & 3 deletions docs/python/others/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
- [FastAPI](fastapi/readme.md)
- [Internal Working](fastapi/internal-working)
- [Flask](flask/readme.md)
- [Documentation](flask/documentation)
- [flask-sqlalchemy](flask/flask-sqlalchemy)
- [Others](flask/others)
- [Documentation](flask/documentation)
- [flask-sqlalchemy](flask/flask-sqlalchemy)
- [Others](flask/others)

0 comments on commit f8c22a2

Please sign in to comment.