Glossary

Web Developer Dictionary

Визначення технічних термінів з PHP, DevOps, MySQL та AI — з прикладами коду та поясненнями простою мовою.

228 terms
27 letters
N
N+1 Problem
The N+1 problem is an anti-pattern where displaying N records triggers N+1 SQL queries: one to fetch the list, and one per related record. With 100 records — 101 queries; with 1000 — 1001.How it occursAn ORM loads a list of objects. Then in a loop, each object accesses a related one — and the ORM silently fires a separate SELECT. Each access looks harmless, but together they kill performance.Fix: Eager LoadingInstead of separate queries in a loop — one additional query with WHERE id IN (...) for all related records at once. Result: always 2 queries regardless of record count. In most ORMs this is controlled by methods like include, with, joins, or preload.DiagnosisEnable SQL query logging and watch for identical SELECTs repeating dozens of times. A query count proportional to the number of rows on the page is a sure sign of N+1.
Named Arguments (PHP 8)
Named arguments — PHP 8.0 allows passing arguments by parameter name rather than position. No need to memorise argument order; optional parameters can be skipped. Example // Positional — must remember the order array_slice($array, 0, 5, true); // Named — self-documenting without checking the signature array_slice( array: $array, offset: 0, length: 5, preserve_keys: true, ); // Skip parameters that have defaults function createUser( string $name, string $role = 'user', bool $active = true ) {} createUser(name: 'Alice', active: false); // role defaults to 'user' Limitations A named argument cannot be passed before a positional one. Named arguments in variadic functions become an associative array.
Namespace
A namespace is a code-organisation mechanism that prevents name conflicts between classes, functions, and constants. Like folders on a disk: two Logger.php files can coexist peacefully in different directories.Declaration and usagenamespace App\Services; class UserService { ... } // In another file: use App\Services\UserService; $service = new UserService();PSR-4 and autoloadingThe PSR-4 standard maps namespaces to directory structure: App\Services\UserService → app/Services/UserService.php. Composer automatically loads the file on first class access — no manual require needed.
Nginx
Nginx is a web server and reverse proxy with an asynchronous, event-driven architecture. Unlike Apache (one process per connection), Nginx handles thousands of connections in a single thread — consuming far less memory under peak load.Nginx rolesWeb server — serves static files (CSS, JS, images) directly, without PHPReverse proxy — accepts client requests and forwards them to PHP-FPM, Node.js, or another backendLoad balancer — distributes traffic across multiple serversSSL termination — handles HTTPS so the backend can use plain HTTP internallyPHP + NginxNginx cannot execute PHP itself. It forwards .php requests to PHP-FPM via the FastCGI protocol (fastcgi_pass). PHP-FPM processes the request and returns an HTML response.
NoSQL
NoSQL is a broad category of databases that move away from the relational model (tables + SQL). It covers very different systems: document, key-value, columnar, and graph. Not "better than SQL" — simply suited to a different class of problems.Main typesDocument (MongoDB, CouchDB) — store JSON-like documents. Flexible schema, convenient for nested dataKey-value (Redis, DynamoDB) — ultra-fast access by keyColumnar (Cassandra, ClickHouse) — efficient for large-scale analyticsGraph (Neo4j) — for complex relationships between entities (social networks, recommendations)When to choose NoSQLFlexible or frequently changing schemaHorizontal scaling to petabyte volumesAccess patterns that are awkward for JOINs
Nullsafe Operator (?->)
The nullsafe operator (?->) is PHP 8.0 syntax that automatically short-circuits a method chain and returns null if any intermediate result is null. It eliminates nested null checks. Before and after // Before PHP 8.0 — verbose $city = null; if ($user !== null) { if ($user->getAddress() !== null) { $city = $user->getAddress()->getCity(); } } // PHP 8.0+ — one line $city = $user?->getAddress()?->getCity(); Rules If any part of the chain returns null, the whole expression becomes null Methods after null are not called — no side effects Can be combined with null coalescing: $user?->getName() ?? 'Guest'