Cloud Tech by Victor

Search

30 results for “rest

Search results

Backend

REST vs GraphQL

The real trade-offs between REST and GraphQL, over/under-fetching, caching, versioning, and when each one is the better default for an API.

Backend

REST vs GraphQL

How REST and GraphQL differ in fetching, caching, and versioning, and which fits a given API better.

Kubernetes Security

What is the difference between the Baseline and Restricted Pod Security Standards levels, and why are they cumulative?

Baseline blocks the most well-known container privilege-escalation paths, privileged containers, host namespaces, hostPath volumes, dangerous Linux capabilities, while still allowing a fairly permissive pod spec otherwise. Restricted inherits every Baseline rule and adds real hardening on top: it requires running as non-root, forbids privilege escalation outright, requires a restricted seccomp profile, and requires dropping all Linux capabilities except NET_BIND_SERVICE. A read-only root filesystem is not part of either standard, it's a separate hardening measure some organizations layer on as their own policy, on top of, not as part of, Restricted. They're cumulative by design, Restricted is Baseline plus more, so a workload that passes Restricted automatically satisfies Baseline too, and a cluster can apply different levels per namespace based on how much a given workload can be trusted.

REST vs GraphQL

What problem does GraphQL solve that REST does not, structurally?

Over-fetching and under-fetching. A REST endpoint returns a fixed shape, so a mobile client that only needs a user's name either gets the whole user object (over-fetching) or the API team has to add a new endpoint or query params for every new shape a client needs (under-fetching, solved by proliferating endpoints). GraphQL lets the client specify exactly which fields it wants in the query itself, so one flexible schema serves many different client needs without new endpoints.

REST vs GraphQL

Why is caching harder with GraphQL than REST?

REST responses map naturally to HTTP caching because a GET to a specific URL returns a predictable resource, so CDNs and browsers can cache by URL. GraphQL typically uses a single POST endpoint with a query body, which defeats standard HTTP/URL-based caching, most GraphQL setups instead rely on client-side normalized caches (like Apollo Client or Relay) keyed by object id and field, or persisted queries plus a CDN cache keyed on the query hash.

REST vs GraphQL

When would you choose REST over GraphQL for a new API?

When the API is simple, resource-shaped, and consumed by a small number of known clients with similar needs, REST's simplicity, mature tooling, and native HTTP caching usually win. GraphQL earns its added complexity (schema design, resolver N+1 management, more complex caching) when there are many different client shapes to serve, several frontends, mobile plus web, or third-party API consumers, where flexible field selection meaningfully reduces the number of purpose-built endpoints.

Blog

How to Restrict USB and Removable Storage Devices using Group Policy in Active Directory

This lab documents a real world Group Policy implementation used to restrict USB drives, external hard drives, and all removable storage devices across domain joined systems in an Active Directory environment. The configuration addresses a critical security risk in modern on premises and hybrid env…

Backend

gRPC vs REST

How gRPC and REST differ in contracts, transport, streaming, and browser support, and when a binary RPC protocol beats plain HTTP and JSON.

AWS Organizations & Account Structure

Why would an organization use multiple AWS accounts instead of one account holding all resources?

Separate accounts per environment (production, staging, development) or per team give a hard isolation boundary that a single account with tags or naming conventions cannot: a mistake or compromised credential in a development account cannot reach production resources at all, rather than merely being restricted by IAM policy within the same account. It also gives cleaner cost attribution (billing rolls up per account), independent service quotas, and a natural blast-radius limit for security incidents. AWS Organizations, and patterns built on top of it like a landing zone, exist specifically to make many accounts manageable, centralized billing, centralized logging, and org-wide SCPs, without losing that isolation.

CSS Box Model & Stacking Context

Name three CSS properties, besides z-index with positioning, that create a new stacking context, and why does that matter when debugging a layering bug?

Opacity below 1, any non-none `transform`, and `filter` or `backdrop-filter` with a value other than `none` all create a new stacking context, along with several others like `isolation: isolate` and `will-change` naming a stacking-context property. This matters when debugging because a completely unrelated-looking style change, adding a fade transition via opacity, or a hover effect via transform, can silently create a new stacking context and change how that element's children layer against the rest of the page, a z-index layering bug that has nothing to do with z-index values themselves, but with an accidental new stacking context somewhere in the ancestor chain.

Kubernetes Security

How does Kubernetes RBAC decide whether a request is allowed, and can you write an explicit deny rule?

RBAC is default-deny and purely additive: a request is denied unless some Role/RoleBinding or ClusterRole/ClusterRoleBinding explicitly grants it, and there is no such thing as an explicit deny rule. Every applicable binding's permissions are unioned together, so restricting access means removing a grant (or removing the subject from a binding), not adding a deny statement on top of an existing grant, an approach that works cleanly for grant-based access but has no mechanism for "allow everything except X" within RBAC itself.

Kubernetes Security

If no NetworkPolicy exists in a namespace, what traffic is allowed between pods, and what changes the moment one NetworkPolicy is applied?

With no NetworkPolicy at all, pods are non-isolated: every pod can send and receive traffic from any other pod, with no restriction in either direction. The moment any NetworkPolicy selects a pod for a given direction (ingress or egress), that pod becomes isolated for that direction specifically, and only the traffic explicitly allowed by an applicable policy's rules gets through from then on; unrelated pods elsewhere in the cluster that no policy selects remain fully open. This is why introducing NetworkPolicy incrementally, rather than all at once, tends to break things: the first policy applied to a namespace can silently cut off traffic nobody had previously needed to declare.

Linux Filesystem Hierarchy & Permissions

What do the three digits in a chmod octal mode like 644 or 755 actually mean, and what does a leading fourth digit add?

Each of the three digits is a sum of read (4), write (2), and execute (1), in order for the owner, the group, and everyone else; 644 means the owner gets read+write (4+2), while group and others get read-only (4). 755 means the owner gets read+write+execute (4+2+1), and group/others get read+execute (4+1), the common mode for an executable or a directory that others need to traverse. An optional leading fourth digit sets setuid (4), setgid (2), and the sticky bit (1); setuid/setgid make a program run with its owner's or group's privileges rather than the caller's, and the sticky bit on a directory (classically 1777 on /tmp) restricts file deletion to each file's own owner even though the directory itself is world-writable.

Linux Logging & Monitoring with journald

What is the difference between journald's "volatile", "persistent", and "auto" storage modes, and which one is the default?

"Volatile" keeps the journal only in `/run/log/journal`, which is memory-backed and wiped on every reboot, nothing survives a restart. "Persistent" writes to `/var/log/journal` on disk, so entries survive reboots (falling back to volatile only during very early boot or if the disk is unavailable). "Auto" is the actual default, and it behaves like "persistent" only if `/var/log/journal` already exists, otherwise it behaves like "volatile", so whether logs survive a reboot on a given system depends entirely on whether that directory happens to have been created, not on any setting an administrator consciously chose.

Linux Storage & LVM

Why would you add a second disk to an existing volume group instead of just creating a new, separate filesystem on it?

Adding a disk as a new physical volume to an existing volume group extends that VG's total capacity, which lets an existing logical volume (and the filesystem on it) be grown into the new space without unmounting it, moving data, or changing the mount point the rest of the system already depends on. Creating a second, separate filesystem on the new disk instead means the original filesystem is still capacity-constrained by its original disk, and anything needing more room has to be manually split or migrated across two independent mount points rather than one that simply grew.

LLM Fundamentals: Tokens, Context Windows & Sampling

What is the practical difference between lowering temperature and lowering top_p, and why would you use them together?

Temperature scales the randomness applied across the entire probability distribution of next-token candidates, low temperature makes the model consistently pick its highest-probability tokens, high temperature flattens the distribution so lower-probability tokens get chosen more often. top_p (nucleus sampling) instead restricts the candidate pool itself to the smallest set of tokens whose cumulative probability reaches the given threshold, then samples only from that trimmed set. They're complementary, not redundant: temperature changes how sharply the model prefers likely tokens, top_p changes which tokens are even eligible to be picked, which is why both are typically left at sensible defaults and only tuned together deliberately for advanced use cases, not adjusted independently without understanding the interaction.

Recursion & the Call Stack

What does Python's recursion limit actually protect against, and is it just an arbitrary language-level rule?

It protects the real, underlying C stack the Python interpreter itself runs on, each level of recursion consumes real stack memory, and without a limit, sufficiently deep (or infinite) recursion would exhaust that stack and crash the interpreter process entirely, a hard C-level failure, not a clean Python exception. The limit converts that hard crash into a catchable `RecursionError` raised well before the actual stack is exhausted, which is exactly why it exists, a controlled failure mode is far better than an uncontrolled process crash, not an arbitrary restriction on how "should" write code.

React Rendering & Reconciliation

Does React mutate the DOM during the render step, and if not, when does the actual DOM update happen?

No. Rendering is a pure calculation, React calls component functions to figure out what the new JSX should be and diffs it against the previous render, but no DOM node is touched during this step. The actual DOM update happens in a separate commit step afterward, where React applies only the minimal necessary changes based on what actually differs from the previous render, appending everything on the very first render, but patching selectively on every re-render after that. This separation is why an uncontrolled `<input>`'s typed value survives a re-render of its parent: React only touches DOM nodes that actually changed, and leaves everything else alone.

Database Connection Pooling

Why would you choose session pooling over transaction pooling even though it scales to fewer concurrent clients per server connection?

Session pooling is the only mode of the two that supports every PostgreSQL feature without exception, prepared statements, session variables set via SET, LISTEN/NOTIFY, session-level advisory locks, because the server connection genuinely stays with the client for as long as their session lasts. If an application depends on any of those session-level features and can't be refactored around them, session pooling is the correct choice despite its lower connection-reuse efficiency, trading raw scalability for full feature compatibility rather than working around broken session state.

Database Locking & Deadlocks

Two transactions each update two of the same two accounts, but in opposite order, and deadlock. What's the actual fix, not just for this pair of transactions, but for the application generally?

The deadlock happens because Transaction 1 locks account A then waits for account B, while Transaction 2 locks account B then waits for account A, a circular wait. The general fix isn't retry logic alone, retries only paper over deadlocks that keep recurring, it's acquiring locks on multiple objects in the same, consistent order everywhere in the application (for example, always locking accounts in ascending id order), which makes the circular-wait pattern structurally impossible rather than merely less frequent. Retry logic is still worth having as a safety net, but consistent lock ordering is what actually eliminates this class of deadlock.

The JavaScript Event Loop

What does "run to completion" mean for a single task or microtask, and why does it matter for reasoning about shared state?

Once a job (a task or a microtask) starts running, it executes entirely before any other job gets a chance to run, JavaScript cannot pause a running function partway through to let another callback interleave, the way a preemptively-scheduled thread in a language like C could be interrupted mid-function. This is what makes synchronous JavaScript code within a single function safe from data races on shared state without needing locks, whatever a function does to shared variables happens atomically from the perspective of any other queued job, even though the language is single-threaded and asynchronous.

Algorithms

Recursion & the Call Stack

Why CPython's recursion limit exists to protect the real, platform-dependent C stack rather than being an arbitrary language rule, and why raising it too high can still crash the interpreter instead of just allowing deeper recursion. Verified against CPython 3.12; exact stack behavior, default limit, and crash mode are interpreter- and version-specific, not universal across every Python implementation.

Idempotency in Distributed Systems

Why does reusing the same idempotency key with different request parameters return an error instead of just processing the new parameters?

An idempotency key is a promise that a specific, exact operation happened once; if the same key showed up with different parameters, honoring the new parameters would silently violate that promise; either the original operation's recorded result no longer describes what the key represents, or the client made a mistake by rIeusing a key it should have generated fresh for a genuinely different request. Rejecting the mismatched reuse as an error, rather than guessing which parameters were "correct" or silently processing the new ones, surfaces that client-side mistake immediately instead of masking it.

Linux Networking

What is the difference between ss and the older netstat command, and why would you reach for ss first?

Both report socket/connection information, but ss reads directly from kernel data structures and can display considerably more TCP and socket state detail than netstat, including fine-grained state groupings like every "connected" state (everything except listening and closed) or every "synchronized" state, which makes targeted filtering much easier. netstat has been effectively superseded across current Linux distributions, and ss is the tool actively maintained as part of the iproute2 suite alongside ip, which is why it is the modern default for socket inspection rather than a mere alternative.

React Hooks Deep Dive

Why does React require hooks to be called in the same order on every render?

React does not track hook state by name; it tracks it by call order in a linked list attached to the component's fiber. On each render, React walks that list and matches the nth useState call to the nth stored slot. If a hook is called conditionally (inside an if, or after an early return), the call order can shift between renders, and React ends up reading the wrong slot for a given hook; this is exactly why hooks cannot be called inside conditionals or loops.

Testing Python with pytest

What is fixture scope, and why is choosing the wrong one a common source of confusing test failures?

Scope (`function`, `class`, `module`, `session`) controls how often a fixture is torn down and recreated, `function` scope (the default) creates a fresh instance for every test, while `session` scope creates it once for the entire test run and shares it across every test that requests it. Choosing a broader scope than a fixture's state can safely support is a common bug: a `session`-scoped fixture holding mutable state (like a database connection with data inserted by one test) leaks that state into every other test sharing it, causing tests to pass or fail depending on run order, a difficult, non-deterministic failure to debug.

Tool Use & Agents

What is the difference between a client tool and a server tool, and why does that distinction matter for what your application has to do?

A client tool executes in your own application, the model only returns the structured request to call it; your code is responsible for actually running it (hitting your database, calling your API) and returning the result. A server tool, like a web search or code execution tool a provider offers, executes on the provider's own infrastructure, so your application sees the final result directly without ever writing execution code for it. The distinction determines how much you have to build: every client tool needs your own execution and error-handling code, while server tools need none, just declaring them in the request.

Web Accessibility Fundamentals

A custom dropdown built entirely from styled divs passes a visual design review. What is likely still broken for a keyboard-only or screen-reader user, and why doesn't looking right catch it?

Without the correct ARIA roles/states (or, better, a native `<select>`), a div-based dropdown typically has no way to be reached or operated via keyboard alone (no built-in Tab/Enter/Arrow-key handling), and a screen reader has no semantic information telling it "this is a dropdown, it is currently closed, here are its options," so it may announce nothing meaningful at all. A purely visual review can't catch this because the div looks and behaves correctly with a mouse, the missing behavior only surfaces via keyboard navigation or assistive technology, which is exactly why accessibility has to be tested directly with a keyboard and a screen reader, not inferred from how a component looks.

DevOps

Azure Storage

How Blob, File, and Disk storage in Azure fit different access patterns, what redundancy options (LRS, ZRS, GRS) actually protect against, and why access tiers change cost, not durability.

Azure Active Directory (Entra ID)

What is an app registration in Entra ID, and why do workloads need one?

An app registration represents an application's identity in Entra ID, giving it a client ID and the ability to authenticate, either as itself (via a client secret or certificate, for service-to-service calls) or on behalf of a signed-in user (via OAuth 2.0/OpenID Connect flows). Workloads need one because Entra ID authentication and authorization apply uniformly to both humans and applications, a background service calling an API needs its own verifiable identity the same way a person does, and an app registration (often combined with a managed identity to avoid handling secrets directly) is how that identity is established.

Search results for “rest” | Cloud Tech by Victor