bg_image
header

Inner Join

An INNER JOIN is a term used in SQL (Structured Query Language) to combine rows from two (or more) tables based on a related column between them.

Example:

You have two tables:

 

Table: Customers

CustomerID Name
1 Anna
2 Bernd
3 Clara

 

Table: Orders

OrderID CustomerID Product
101 1 Book
102 2 Laptop
103 4 Phone

Now you want to know which customers have placed orders. You only want the customers who exist in both tables.

SQL with INNER JOIN:

SELECT Customers.Name, Orders.Product
FROM Customers
INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID;

Result:

Name Product
Anna Book
Bernd Laptop

Explanation:

  • Clara didn’t place any orders → not included.

  • The order with CustomerID 4 doesn’t match any customer → also excluded.

In short:

An INNER JOIN returns only the rows with matching values in both tables.


Explicit join

An explicit join is a clear and direct way to define a join in an SQL query, where the type of join (such as INNER JOIN, LEFT JOIN, RIGHT JOIN, or FULL OUTER JOIN) is explicitly stated.

Example of an explicit join:

SELECT *
FROM customers
INNER JOIN orders
ON customers.customer_id = orders.customer_id;

This makes it clear:

  • Which tables are being joined (customers, orders)

  • What kind of join is used (INNER JOIN)

  • What the join condition is (ON customers.customer_id = orders.customer_id)


In contrast: Implicit join

An implicit join is the older style, using a comma in the FROM clause, and putting the join condition in the WHERE clause:

SELECT *
FROM customers, orders
WHERE customers.customer_id = orders.customer_id;

This works the same, but it's less clear and not ideal for complex queries.


Benefits of explicit joins:

  • More readable and structured, especially with multiple tables

  • Clear separation of join conditions (ON) and filter conditions (WHERE)

  • Recommended in modern SQL development


Hyperscaler

A hyperscaler is a company that provides cloud services on a massive scale — offering IT infrastructure such as computing power, storage, and networking that is flexible, highly available, and globally scalable. Common examples of hyperscalers include:

  • Amazon Web Services (AWS)

  • Microsoft Azure

  • Google Cloud Platform (GCP)

  • Alibaba Cloud

  • IBM Cloud (on a somewhat smaller scale)

Key characteristics of hyperscalers:

  1. Massive scalability
    They can scale their services virtually without limits, depending on the customer's needs.

  2. Global infrastructure
    Their data centers are distributed worldwide, enabling high availability, low latency, and redundancy.

  3. Automation & standardization
    Many operations are automated (e.g., provisioning, monitoring, billing), making services more efficient and cost-effective.

  4. Self-service & pay-as-you-go
    Customers usually access services via web portals or APIs and pay only for what they actually use.

  5. Innovation platform
    Hyperscalers offer not only infrastructure (IaaS), but also platform services (PaaS), as well as tools for AI, big data, or IoT.

What are hyperscalers used for?

  • Hosting websites or web applications

  • Data storage (e.g., backups, archives)

  • Big data analytics

  • Machine learning / AI

  • Streaming services

  • Corporate IT infrastructure


Implicit join

An implicit join is a way of joining tables in SQL without using the JOIN keyword explicitly. Instead, the join is expressed using the WHERE clause.

Example of an implicit join:

SELECT *
FROM customers, orders
WHERE customers.customer_id = orders.customer_id;

In this example, the tables customers and orders are joined using a condition in the WHERE clause.


In contrast, an explicit join looks like this:

SELECT *
FROM customers
JOIN orders ON customers.customer_id = orders.customer_id;

Differences:

Aspect Implicit Join Explicit Join
Syntax Tables separated by commas, joined via WHERE Uses JOIN and ON
Readability Less readable in complex queries More structured and readable
Error-proneness Higher (e.g., accidental cross joins) Lower, as join conditions are clearer
ANSI-92 compliance Not compliant Fully compliant

When is an implicit join used?

It was common in older SQL code, but explicit joins are recommended today, as they are clearer, easier to maintain, and less error-prone, especially in complex queries involving multiple tables.


Materialized View

A Materialized View is a special type of database object that stores the result of a SQL query physically on disk, unlike a regular view which is computed dynamically every time it’s queried.

Key Characteristics of a Materialized View:

  • Stored on disk: The result of the query is saved, not just the query definition.

  • Faster performance: Since the data is precomputed, queries against it are typically much faster.

  • Needs refreshing: Because the underlying data can change, a materialized view must be explicitly or automatically refreshed to stay up to date.

Comparison: View vs. Materialized View

Feature View Materialized View
Storage Only the query, no data stored Query and data are stored
Performance Slower for complex queries Faster, as results are precomputed
Freshness Always up to date Can become stale
Needs refresh No Yes (manually or automatically)

Example:

-- Creating a materialized view in PostgreSQL
CREATE MATERIALIZED VIEW top_customers AS
SELECT customer_id, SUM(order_total) AS total_spent
FROM orders
GROUP BY customer_id;

To refresh the data:

REFRESH MATERIALIZED VIEW top_customers;

When to use it?

  • For complex aggregations that are queried frequently

  • When performance is more important than real-time accuracy

  • In data warehouses or reporting systems


Fully Qualified Domain Name - FQDN

The Fully Qualified Domain Name (FQDN) is the complete and unique name of a computer or host on the internet or a local network. It consists of multiple parts that reflect a hierarchical structure.

Structure of an FQDN

An FQDN is made up of three main components:

  1. Hostname – The specific name of a computer or service (e.g., www).

  2. Domain Name – The name of the higher-level domain (e.g., example).

  3. Top-Level Domain (TLD) – The highest level of the domain structure (e.g., .com).

Example of an FQDN:
👉 www.example.com.

  • www → Hostname

  • example → Domain name

  • .com → Top-Level Domain

  • The trailing dot (.) is optional and represents the root domain of the DNS system.

Why is the FQDN important?

Uniqueness: Each FQDN is globally unique and refers to a specific resource on the internet.
DNS Resolution: It is used by DNS servers to find the IP address of websites and servers.
SSL Certificates: An FQDN is often required for SSL/TLS certificates to ensure secure connections.
Email Delivery: Mail servers use FQDNs to send emails to the correct hosts.

Difference Between an FQDN and a Simple Domain

  • FQDN: mail.google.com (fully specified)

  • Simple Domain: google.com (can contain multiple hosts, e.g., www, mail, ftp)

In summary, the FQDN is the complete address of a device or service on the internet, while a simple domain is a more general address.


Early Exit

An Early Exit is a programming technique where a function or algorithm terminates early when a specific condition is met. The goal is usually to make the code more efficient and easier to read.

Example in a function:

function getDiscount($age) {
    if ($age < 18) {
        return 10; // 10% discount for minors
    }
    if ($age > 65) {
        return 15; // 15% discount for seniors
    }
    return 0; // No discount for other age groups
}

Here, the Early Exit ensures that the function immediately returns a value as soon as a condition is met. This avoids unnecessary else blocks and makes the code more readable.

Comparison with a nested version:

function getDiscount($age) {
    $discount = 0;
    if ($age < 18) {
        $discount = 10;
    } else {
        if ($age > 65) {
            $discount = 15;
        }
    }
    return $discount;
}

This version introduces unnecessary nesting, reducing readability.

Other Use Cases:

  • Input validation at the start of a function (return or throw for invalid input)

  • Breaking out of loops early when the desired result is found (break or return)

An Early Exit improves readability, maintainability, and performance in code.


Redux

Redux is a state management library for JavaScript applications, often used with React. It helps manage the global state of an application in a centralized way, ensuring data remains consistent and predictable.

Core Concepts of Redux

  1. Store

    • Holds the entire application state.

    • There is only one store per application.

  2. Actions

    • Represent events that trigger state changes.

    • Are simple JavaScript objects with a type property and optional data (payload).

  3. Reducers

    • Functions that calculate the new state based on an action.

    • They are pure functions, meaning they have no side effects.

  4. Dispatch

    • A method used to send actions to the store.

  5. Selectors

    • Functions that extract specific values from the state.

Why Use Redux?

  • Simplifies state management in large applications.

  • Prevents prop drilling in React components.

  • Makes state predictable by enforcing structured updates.

  • Enables debugging with tools like Redux DevTools.

Alternatives to Redux

If Redux feels too complex, here are some alternatives:

  • React Context API – suitable for smaller apps

  • Zustand – a lightweight state management library

  • Recoil – developed by Facebook, flexible for React

 


Vite

Vite is a modern build tool and development server for web applications, created by Evan You, the creator of Vue.js. It is designed to make the development and build processes faster and more efficient. The name "Vite" comes from the French word for "fast," reflecting the primary goal of the tool: a lightning-fast development environment.

The main features of Vite are:

  1. Fast Development Server: Vite uses modern ES modules (ESM), providing an ultra-fast development server. It only loads the latest module, making the initial startup much faster than traditional bundlers.

  2. Hot Module Replacement (HMR): HMR works extremely fast by updating only the changed modules, without needing to reload the entire application.

  3. Modern Build System: Vite uses Rollup under the hood to bundle the final production build, enabling optimized and efficient builds.

  4. Zero Configuration: Vite is very user-friendly and doesn’t require extensive configuration. It works immediately with the default settings, supporting many common web technologies out-of-the-box (e.g., Vue.js, React, TypeScript, CSS preprocessors, etc.).

  5. Optimized Production: For production builds, Rollup is used, which is known for creating efficient and optimized bundles.

Vite is mainly aimed at modern web applications and is particularly popular with developers working with frameworks like Vue, React, or Svelte.

 


Partial Mock

A Partial Mock is a testing technique where only certain methods of an object are mocked, while the rest of the object retains its real implementation. This is useful when you want to stub or mock specific methods but keep others functioning normally.

When to Use a Partial Mock?

  • When you want to test a class but isolate certain methods.

  • When some methods are difficult to test (e.g., they have external dependencies), but others should retain their real logic.

  • When you only need to stub specific methods to control test behavior.

Example in PHP with PHPUnit

Suppose you have a Calculator class but want to mock only the multiply() method while keeping add() as is.

class Calculator {
    public function add($a, $b) {
        return $a + $b;
    }

    public function multiply($a, $b) {
        return $a * $b;
    }
}

// PHPUnit Test with Partial Mock
class CalculatorTest extends \PHPUnit\Framework\TestCase {
    public function testPartialMock() {
        // Create a Partial Mock for Calculator
        $calculator = $this->getMockBuilder(Calculator::class)
                           ->onlyMethods(['multiply']) // Only mock this method
                           ->getMock();

        // Define behavior for multiply()
        $calculator->method('multiply')->willReturn(10);

        // Test real add() method
        $this->assertEquals(5, $calculator->add(2, 3));

        // Test mocked multiply() method
        $this->assertEquals(10, $calculator->multiply(2, 3));
    }
}

Here, add() remains unchanged and executes the real implementation, while multiply() always returns 10.

Conclusion

Partial Mocks are useful when you need to isolate specific parts of a class without fully replacing it. They help make tests more stable and efficient by mocking only selected methods.