Glossary
Web Developer Dictionary
Визначення технічних термінів з PHP, DevOps, MySQL та AI — з прикладами коду та поясненнями простою мовою.
228
terms
27
letters
D
DB Normalization
Normalization is the process of organising tables to minimise data duplication and prevent anomalies on insert, update, and delete. Each normal form imposes stricter requirements.The first three normal forms1NF — each cell holds one atomic value (not an array, not a comma-separated list)2NF — no partial dependencies: every non-key attribute depends on the entire primary key3NF — no transitive dependencies: non-key attributes depend only on the key, not on other non-key attributesDenormalizationNormalization reduces redundancy but increases JOINs. In read-heavy systems, data is deliberately denormalized (duplicated) to avoid complex queries. A typical example: storing a username alongside a comment to avoid JOINing to the users table.
DB Replication
Replication is the synchronisation of data between multiple database servers. There is a primary server and one or more replicas. Replicas receive changes from the primary and duplicate them locally.Why it is neededRead scaling — SELECT queries are distributed across replicas; the primary handles writes onlyFault tolerance — if the primary fails, a replica is promoted to primary (failover)Backup — backups are taken from a replica, not from the primarySynchronous vs asynchronousSynchronous — the primary waits for acknowledgement from the replica. No data loss, but higher latencyAsynchronous — the primary does not wait. Lower latency, but risk of losing the most recent writes on failover
DDoS Attack
DDoS (Distributed Denial of Service) is an attack that sends such a large volume of traffic from many sources (a botnet) that the server cannot process legitimate requests and becomes unavailable.
Attack layers
L3/L4 (network/transport) — UDP/TCP packet flooding. Goal: saturate the channel. Defence: filtering at the provider level
L7 (application) — HTTP flood: thousands of requests to expensive endpoints. Harder to detect because it resembles legitimate traffic
Defence
CDN with DDoS protection — Cloudflare, AWS Shield absorb the attack at edge nodes
Rate Limiting — limit requests per IP
CAPTCHA — for suspicious sessions
Geo-blocking — block regions with anomalous traffic
Anycast — distribute traffic across data centres
Deadlock
A deadlock is a situation in a database or multi-threaded code where two processes are waiting for each other and neither can proceed. Transaction A has locked resource 1 and is waiting for resource 2; transaction B has done the opposite.How it occursClassic example: transferring money. Transaction A locks account 1, then tries to lock account 2. Transaction B has locked account 2 and is waiting for account 1. Both wait forever.How the DBMS resolves itMySQL and other databases automatically detect deadlocks and "kill" one of the transactions (the one with fewer changes). That transaction ends with an error and must be retried by the application.PreventionAlways access resources in the same order across all transactionsKeep transactions as short as possible to minimise lock hold timeUse SELECT ... FOR UPDATE only where genuinely necessary
Decorator Pattern
Decorator is a pattern that dynamically adds new functionality to an object without changing its class. It wraps the original object and extends or alters its behaviour while implementing the same interface.Exampleinterface Logger { log(string $msg): void; }
class FileLogger implements Logger { ... }
class TimestampLogger implements Logger {
public function __construct(private Logger $inner) {}
public function log(string $msg): void {
$this->inner->log(date('H:i:s') . ' ' . $msg);
}
}Advantages over inheritanceDecorators compose dynamically: new JsonLogger(new TimestampLogger(new FileLogger())). Inheritance would require N² subclasses for every combination. Decorators avoid the Open/Closed violation that inheritance frequently causes.
Dependency Injection
Dependency Injection (DI) is a pattern where an object receives its dependencies from the outside rather than creating them itself. Instead of new Mailer() inside a class — Mailer $mailer in the constructor. The class simply declares what it needs.Why it mattersA class that creates its own dependencies is tightly coupled to their concrete implementations. DI lets you swap implementations — for example, replace a real mailer with a fake one in tests — without changing the class itself.IoC containerMost frameworks include a built-in container that resolves dependencies automatically: it reads the class constructor, finds registered implementations of interfaces, and injects them. You describe "what is needed" — the container decides "where to get it".Three injection stylesConstructor injection — most common; dependencies are mandatorySetter injection — dependency is optional, passed via a methodInterface injection — the class implements an interface through which it receives the dependency
Design System
A design system is a collection of ready-made UI components, patterns, tokens (colours, fonts, spacing), and rules for their use. A shared "design language" for the entire product team — designers and developers speaking the same terminology.
What it consists of
Tokens — named values: --color-primary: #c05c08, --spacing-md: 16px
Components — buttons, forms, modals, cards. Ready-to-use building blocks
Patterns — rules for combining components (registration forms, pagination)
Documentation — when and how to use each component
Popular design systems
Material Design (Google), Fluent (Microsoft), Tailwind UI, Ant Design, Radix UI.
Why it matters
Without a design system: every new page has slightly different spacing, colours, button sizes. Consistency degrades over time. With one: changing the --color-primary token updates the entire product.
DNS
DNS (Domain Name System) is the internet's phonebook: it translates domain names (example.com) into IP addresses. A browser does not know where a site is physically located — DNS provides the address.Record typesA — domain → IPv4 (93.184.216.34)AAAA — domain → IPv6CNAME — alias; one domain points to another domainMX — mail servers for the domainTXT — arbitrary text: SPF, DKIM, ownership verificationHow resolution worksThe browser queries the local DNS resolver → the ISP's recursive resolver → the root server → the TLD server (.com) → the domain's authoritative server → IP address. The whole journey takes tens of milliseconds and is cached for the TTL.TTLTime To Live — how long a record is cached. Before changing an A record, lower the TTL to 300 seconds, make the change, then restore it. This minimises downtime during a migration.
Docker
Docker is a containerization platform that packages an application together with all its dependencies into an isolated container. The container runs identically on a developer's laptop, a CI server, and production — eliminating the classic "but it works on my machine".Container vs Virtual MachineA VM emulates full hardware with its own OS kernel — heavy and slow to start. A container shares the host kernel, isolating only processes and the filesystem. Container startup takes seconds, not minutes.Key conceptsImage — an immutable filesystem snapshot built from a DockerfileContainer — a running instance of an imageDockerfile — build instructions: base image, file copying, commandsDocker Compose — run multiple containers (app + db + redis) with one commandVolume — persistent storage outside the container
Docker Compose
Docker Compose is a tool for running multi-container applications via a single YAML file (compose.yaml). One command brings up the entire stack: application, database, Redis, queue — each in its own container with the correct connections.
Basic structure
services:
app:
build: .
ports: ["8080:80"]
depends_on: [db, redis]
environment:
DB_HOST: db
db:
image: mysql:8.4
volumes: [db-data:/var/lib/mysql]
environment:
MYSQL_ROOT_PASSWORD: secret
redis:
image: redis:alpine
volumes:
db-data:
Key commands
docker compose up -d — start in the background
docker compose down — stop and remove containers
docker compose logs -f app — follow logs
docker compose exec app bash — open a shell in a container
DOM (Document Object Model)
DOM is an object representation of an HTML document as a tree of nodes. The browser builds the DOM from HTML and exposes a JavaScript API for reading and modifying the page's structure, styles, and content.Node treehtml
├── head
│ └── title
└── body
├── h1
└── pKey operations// Find an element
const el = document.querySelector('.card');
// Change content
el.textContent = 'Hello';
// Add a class
el.classList.add('active');
// Event listener
el.addEventListener('click', () => console.log('clicked'));
// Create an element
const btn = document.createElement('button');
document.body.appendChild(btn);Virtual DOMReact and other frameworks build a Virtual DOM — a lightweight in-memory copy. On changes, they diff the old and new trees and update only the changed nodes. This is faster than direct DOM manipulation.
Domain Events
A domain event is a fact that has occurred in the business domain: OrderPlaced, PaymentFailed, UserRegistered. Named in the past tense because it describes something that has already happened. A central concept in DDD and Event-Driven Architecture.
How it differs from a regular event
Technical event: ButtonClicked, FileUploaded. Domain event: InvoiceApproved, SubscriptionExpired — carries business meaning and is part of the ubiquitous language.
Why to use them
Decouple aggregates — Order does not know about Notification
Audit trail and Event Sourcing — full history of domain changes
Asynchronous processing of side effects
Example
class OrderPlaced {
public function __construct(
public readonly string $orderId,
public readonly string $userId,
public readonly Money $total,
public readonly \DateTimeImmutable $occurredAt,
) {}
}
// After successful persistence:
EventDispatcher::dispatch(new OrderPlaced($order->id, ...));
Domain-Driven Design (DDD)
DDD (Domain-Driven Design) is a software development approach centred on the domain model: the language, concepts, and rules of the business. Developers and domain experts share one language (Ubiquitous Language). Code reflects real business, not DB structure.Key conceptsEntity — an object with unique identity (User, Order)Value Object — an object without identity; equality is by value (Money, Email)Aggregate — a cluster of objects with one root (Order + OrderItems)Repository — an abstraction for storing aggregatesDomain Event — an event that occurred in the domain (OrderPlaced)Bounded Context — a boundary within which the model and language have unambiguous meaningWhen justifiedDDD adds complexity. It is justified for complex domains with rich business logic. For simple CRUD applications — overkill.
DRY, KISS, YAGNI
Three principles of simple, maintainable code that are often violated together and fixed together.DRY — Don't Repeat YourselfEvery piece of knowledge must have a single, unambiguous representation in the system. Duplicated code means a change must be made in multiple places — and one will inevitably be missed. DRY is about knowledge, not just text: copy-paste is bad, but a shared function for two different concepts is bad too.KISS — Keep It Simple, StupidThe simplest solution that solves the problem is the best one. Complex code is hard to read, test, and maintain. Complexity is the enemy.YAGNI — You Aren't Gonna Need ItDo not implement functionality until it is genuinely needed. Code written "just in case" goes stale, clutters the codebase, and is often never used. Write for today's requirements.
DTO (Data Transfer Object)
DTO (Data Transfer Object) is a simple, logic-free object designed solely to carry data between application layers or between services. Like a data structure: fields only, no behaviour.Why it is neededIsolates the internal model from the external API — a DB schema change will not break the API responseExplicitly documents what data is passed between layersConvenient for validating input data (Request DTO) and shaping responses (Response DTO)Exampleclass CreateUserDTO {
public function __construct(
public readonly string $name,
public readonly string $email,
public readonly string $password,
) {}
}DTO vs Entity vs ViewModelEntity — a domain model object with identity (exists in the DB)DTO — a transport container with no identityViewModel — a DTO specifically shaped for display in a UI/template
Dynamic Programming
Dynamic programming (DP) is an optimisation technique for recursive algorithms: subproblem results are cached to avoid recomputing them. It transforms problems from O(2ⁿ) to O(n) or O(n²).
Two approaches
Top-down (memoisation) — recursion + result cache. More natural to write
Bottom-up (tabulation) — iteratively fill a table from base cases upward
Fibonacci numbers
// Without DP: O(2^n)
fib(n) = fib(n-1) + fib(n-2)
// With memoisation: O(n)
$memo = [];
function fib(int $n): int {
global $memo;
if ($n