Skip to content

Instantly share code, notes, and snippets.

NoSql
CAP Theorm (no dbms that follow 3 rules at the same time)
Consistency
Accesability
Partition tolerance
Vertical and Horizontal scaling in terms RDBMS:
You can partition data vertically (splitting tables into subsets of columns and implementing each subset as a separate table) and horizontally (splitting tables into subsets of rows, and implementing each subset as a separate table where each table contains the same columns). You can place different partitions on different servers to spread the load and improve scalability.
Sharding - horizontal scaling of data
Sharding migth decrease performance (for example when join 2 tables on differ shards => try to store at the same shard)
@zxdcm
zxdcm / gist:7c979efa81708853f20f6e4cfd8bf0b5
Created February 14, 2019 20:12
Browser common ideas
Browser components:
1. UI |
↓ |
2. Browser Engine ========================|===========> data persistance
3. Rendering Engine ↓ (25)
4. Networking 5. JS Interpreter 6. UI Backend
Chrome uses several display modules
@zxdcm
zxdcm / gist:069deadf53ed04990d9f34e73a49c276
Last active November 23, 2020 21:35
Networks, HTTP, DNS, and so on
Proxy may return info from cache!!
Forward proxy (for client)
Reverse proxy (for server, service)
(можно на отдельный сервер вынести отправку статического контента,
как раз reverse proxy)
CDN - Content Delivery Network
Proxy may return info from cache
Схема позиционирования
Существует три схемы позиционирования.
Стандартная: объект размещается согласно своему положению в дереве отображения и в дереве DOM
а также своему типу и размерам окна
Плавающая: сначала по стандартной схеме, затем смещается в крайнее правое или крайнее левое положение
Абсолютная: положение объекта в дереве отображения отличается от его положения в дереве DOM.
https://www.learnentityframeworkcore.com/
1. Adding
2. Modifying
a)
var author = context.Authors.First(a => a.AuthorId == 1);
author.FirstName = "Bill";
context.SaveChanges();
1. async vs defer
<script src="1.js" defer></script>
<script src="2.js" defer></script>
defer - preserve the execution order.
Naming:
jquery obj ? $name : name
1. Базовая структура блока plsql
Declare - необязательно
(const, vars, types, cursors, user exceptions)
Begin - обязательно
(PL/SQL, SQL commands)
Exception - необязательно
Действий при возникновении ошибки
GUIDs hurt performance of inserts.
Relational databases use B+ tree structure to store data.
If data coming in is not ordered, then a lot of IO work is required to rearrange the leafs.
GUIDs are random, so they may lead to heavy performance drawbacks, especially with large tables.
Database generated integers may hurt performance of inserts as well but for another reason.
When a database generates a new auto-incremented value for a primary key, it takes a lock to avoid race conditions.
It causes a performance issue that shows up in scenarios with multithread or bulk inserts.
IF EXISTS (SELECT * FROM dbo.Ids WHERE EntityId = @EntityId)
@zxdcm
zxdcm / tokens.md
Created July 4, 2021 18:25 — forked from zmts/tokens.md
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@zxdcm
zxdcm / README.md
Created March 23, 2022 11:30 — forked from andris9/README.md
Extremely simple HTTP proxy for changing Host: header Useful when proxying requests to virtual hosts that require Host: header to be set.

Setup reverse tunnel

Run the following in your client machine

ssh -R EXPOSED_PORT:localhost:SERVICE_PORT USER@HOST

Where

  • EXPOSED_PORT is the port exposed to the internet in the proxy server
  • SERVICE_PORT is the port your application is listening in your machine