A Serverless AWS AppSync Events Broadcasting Driver for Laravel

https://opengraph.githubassets.com/70092b9337715852f5e8fc859bcc65456f92e594efce0331913610382476bb4d/hschimpf/laravel-appsync-events

Laravel AppSync Events

Broadcast Laravel events over AWS AppSync Event APIs — managed, serverless WebSocket fan-out — with a matching Laravel Echo 2 connector on the client. The package publishes events with SigV4-signed HTTP calls, authorizes connections and subscriptions through an AppSync Lambda authorizer that verifies HMAC tokens issued by your app, and ships the Echo connector as @hds-solutions/laravel-echo-appsync.

CI
Packagist Version
npm Version
License

Warning

This package is in beta. The API may change between releases — pin an exact version in composer.json/package.json and check the changelog before upgrading. Found a bug or rough edge? Report it on GitHub.

AWS AppSync Event APIs give you a managed WebSocket endpoint: AWS holds the sockets, routes published events to channel subscribers, and scales the fan-out for you. This package plugs that into Laravel’s broadcasting layer — ShouldBroadcast events, routes/channels.php authorization, Broadcast::channel() — so you get realtime delivery without running Reverb, Pusher, or any WebSocket server of your own.

Use it when you want Laravel-native broadcasting but can’t (or don’t want to) operate a WebSocket fleet. AppSync Events is billed per published event and per connection time — check the AWS pricing page for current numbers.

The community package 7amoood/laravel-appsync-broadcaster solves the same problem with a different shape: Cognito OAuth for auth, a Redis-backed worker, and a Pawl WebSocket client that keeps a persistent publish connection; it ships no Echo connector. This package instead:

  • publishes over HTTP with SigV4/IAM — a stateless POST /event, no persistent publisher socket, no worker;
  • authorizes connections/subscriptions with a Lambda authorizer that verifies HMAC tokens your app issues (no Cognito, no Redis);
  • ships an Echo 2 connector so the frontend stays echo.private('orders.1').listen(...).
flowchart LR
    subgraph Laravel
        E["Event (ShouldBroadcast)"] --> B["AppSyncBroadcaster (SigV4)"]
        R["/broadcasting/auth"] --> TS["TokenSigner (HMAC secret)"]
    end
    subgraph AWS
        B -- "POST /event (IAM)" --> A["AppSync Event API"]
        A -- "EVENT_CONNECT / EVENT_SUBSCRIBE" --> L["Lambda authorizer"]
        L -. "verifies" .- TS
        A -- "WebSocket" --> C["Echo connector"]
    end
    C -. "{socket_id, channel_name}" .-> R
    R -. "{auth: subscribeToken}" .-> C
    TS -. "clientConfig: connectToken" .-> C



Loading


  1. A ShouldBroadcast event fires; AppSyncBroadcaster SigV4-signs a POST /event to the Event API’s HTTP endpoint with IAM credentials.
  2. AppSync delivers the event to every client subscribed to the mapped channel path (/private/orders/1 for private-orders.1).
  3. The browser connects with a connect token (from AppSyncEvents::clientConfig()) and asks your app for a per-channel subscribe token via POST /broadcasting/auth — the standard Echo channel-auth flow.
  4. AppSync calls your Lambda authorizer for EVENT_CONNECT and EVENT_SUBSCRIBE; AppSyncAuthorizer verifies the token’s HMAC signature, purpose and channel.
  5. EVENT_PUBLISH is always denied — clients can never publish; publishing is a server-side, IAM-only operation.
Component Version
PHP ^8.2
Laravel / Illuminate ^11.0 | ^12.0 | ^13.0
laravel-echo (peer) ^2.0
Node.js (build & test the js/ package) >= 22 — the published package runs in browsers
AWS An AppSync Event API (not a GraphQL API) — see AWS setup
composer require hds-solutions/laravel-appsync-events
php artisan appsync-events:install      # publishes config, adds .env placeholders
php artisan appsync-events:secret       # generates APPSYNC_CHANNEL_SIGNING_SECRET

npm install laravel-echo @hds-solutions/laravel-echo-appsync

Then set the environment values (the install command adds the placeholders to .env.example):

BROADCAST_CONNECTION=appsync

APPSYNC_HTTP_ENDPOINT=https://<id>.appsync-api.<region>.amazonaws.com/event
APPSYNC_REALTIME_ENDPOINT=wss://<id>.appsync-realtime-api.<region>.amazonaws.com/event/realtime
APPSYNC_CHANNEL_SIGNING_SECRET=<64 hex chars from appsync-events:secret>

appsync-events:secret --show prints a secret without touching .env; --force overwrites an existing one. The same secret must be deployed to the Lambda authorizer — it is never sent to AWS or to clients.

1. Authorize the channel — routes/channels.php:

use App\Models\User;
use Illuminate\Support\Facades\Broadcast;

Broadcast::channel('orders.{id}', function (User $user, int $id) {
    return $user->can('view-order', $id);
});

2. Broadcast an event:

use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;

class OrderShipped implements ShouldBroadcast
{
    public function __construct(public readonly int $orderId) {}

    public function broadcastOn(): array
    {
        return [new PrivateChannel('orders.'.$this->orderId)];
    }
}

3. Listen in the frontend:

import Echo from 'laravel-echo';
import { appSyncEchoOptions } from '@hds-solutions/laravel-echo-appsync';

const echo = new Echo(appSyncEchoOptions({
    wsEndpoint: 'wss://<id>.appsync-realtime-api.<region>.amazonaws.com/event/realtime',
    connectToken: () => fetchConnectToken(), // re-evaluated on every (re)connect
}));

echo.private('orders.1').listen('.OrderShipped', (e: unknown) => {
    console.log(e);
});

The Laravel channel name private-orders.1 (Echo adds private-) maps to the AppSync channel path /private/orders/1 — so a private channel namespace must exist on the Event API.

Before the driver works, AWS needs:

  • an Event API with auth providers AWS_LAMBDA + AWS_IAM (plus API_KEY only if you use public channels), connection mode AWS_LAMBDA, default publish mode AWS_IAM, default subscribe mode AWS_LAMBDA;
  • the public and private channel namespaces (or your configured names) — AppSync namespaces are the authorization boundary, so the private namespace subscribes via your Lambda authorizer while public may also allow API_KEY;
  • a Lambda authorizer holding the same APPSYNC_CHANNEL_SIGNING_SECRET, with a lambda:InvokeFunction resource policy for appsync.amazonaws.com scoped to the API ARN;
  • an IAM policy granting your app’s role appsync:EventPublish on arn:aws:appsync:<region>:<account>:apis/<api-id>/channelNamespace/<namespace>.

Full walkthrough plus CloudFormation, Serverless Framework, Terraform and CDK examples: docs/aws-setup.md.

AppSync Events offers five authorization types; this package uses three of them:

Type Used for Supported
AWS_IAM Your app publishing events (SigV4 POST /event) Yes — required
AWS_LAMBDA Clients connecting and subscribing to private channels, with Laravel’s Broadcast::channel() callbacks deciding access Yes — required for private channels
API_KEY Anonymous, read-only public channels Yes — optional
OPENID_CONNECT Clients authenticating with an OIDC provider No
AMAZON_COGNITO_USER_POOLS Clients authenticating with Cognito No

The package is PHP-strict: your Laravel users and routes/channels.php stay the source of truth, so Cognito and OIDC client authentication are out of scope. AppSync lets you set the authorization mode per namespace, so public channels (API_KEY) and private channels (AWS_LAMBDA) can live side by side on the same Event API.

Your Laravel app is not tied to a particular host. The broadcaster signs publish requests with the AWS SDK’s default credential chain (environment variables, web identity, ECS task role, EC2 instance profile), so wherever your app runs with an IAM role, it should need no keys in config — the role only needs appsync:EventPublish. /broadcasting/auth needs no AWS access.

Note

The platform notes below come from the platform documentation and the SDK’s credential chain; they have not been tested on a real Laravel Vapor or ECS deployment. Please verify them in your environment.

  • Laravel Vapor — per Vapor’s docs, your app’s Lambda runs under the laravel-vapor-role role and reserves the AWS_* credential and region variables. You will likely need to add appsync:EventPublish to that role; Vapor manages it itself, so see Laravel’s Customize Default Role post before editing it. Don’t set AWS_* keys yourself; APPSYNC_REGION can override the region.
  • Docker / ECS — grant the permission to the task role instead of configuring keys.

The authorizer below is the one piece AppSync invokes directly, so it must run on Lambda. As far as we know Vapor only deploys your Laravel app’s own functions, so plan to deploy the authorizer with another tool (Serverless Framework with Bref, CloudFormation, Terraform or CDK — see docs/aws-setup.md); it only needs the same APPSYNC_CHANNEL_SIGNING_SECRET.

AppSyncAuthorizer::authorize(array $event): array (HDSSolutions\Laravel\AppSyncEvents\Lambda) verifies the authorizer event and returns the AppSync contract {isAuthorized, ttlOverride, handlerContext?}:

  • EVENT_CONNECT → verified, unexpired token with purpose: connect.
  • EVENT_SUBSCRIBE → verified, unexpired purpose: subscribe token whose channel claim equals requestContext.channel.
  • EVENT_PUBLISH (and anything else) → always denied.

The class is framework-agnostic — constructor-injected secret, no container access — so it runs under any PHP Lambda runtime.

<?php

use HDSSolutions\Laravel\AppSyncEvents\Lambda\AppSyncAuthorizer;

return function (array $event): array {
    return (new AppSyncAuthorizer(
        $_ENV['APPSYNC_CHANNEL_SIGNING_SECRET'] ?? '',
        (int) ($_ENV['APPSYNC_AUTHORIZER_CACHE_TTL'] ?? 300),
        $_ENV['APPSYNC_CHANNEL_PREVIOUS_SIGNING_SECRETS'] ?? '',
    ))->authorize($event);
};

Bref is one way to run PHP on Lambda — it is not a dependency of this package. With Bref 3, an event handler implements Bref\Event\Handler (see Bref function handlers):

<?php

namespace App\Lambda;

use Bref\Context\Context;
use Bref\Event\Handler;
use HDSSolutions\Laravel\AppSyncEvents\Lambda\AppSyncAuthorizer;

final class AppsyncEventsAuthorizer implements Handler
{
    public function handle($event, Context $context): array
    {
        // If the function boots your Laravel app (e.g. bref/laravel-bridge),
        // resolve from the container instead: app(AppSyncAuthorizer::class)
        return (new AppSyncAuthorizer(
            $_ENV['APPSYNC_CHANNEL_SIGNING_SECRET'] ?? '',
            previousSecrets: $_ENV['APPSYNC_CHANNEL_PREVIOUS_SIGNING_SECRETS'] ?? '',
        ))->authorize($event);
    }
}
functions:
    authorizer:
        handler: App\Lambda\AppsyncEventsAuthorizer
        runtime: php-82
        environment:
            APPSYNC_CHANNEL_SIGNING_SECRET: ${ssm:/my-app/appsync-signing-secret}
            # The authorizer must never broadcast itself — see warning below.
            BROADCAST_CONNECTION: log
            APPSYNC_HTTP_ENDPOINT: ''
            APPSYNC_REALTIME_ENDPOINT: ''

Warning — no self-invocation. The authorizer Lambda must never broadcast: if it boots your application, force BROADCAST_CONNECTION=log (or null) and leave the AppSync endpoint env vars empty. A function that publishes to the API it authorizes can invoke itself recursively.

config/appsync-events.php (publish with php artisan vendor:publish --tag=appsync-events-config):

Key Env var Default Description
http_endpoint APPSYNC_HTTP_ENDPOINT — Event API HTTP endpoint the broadcaster POSTs to. Required.
realtime_endpoint APPSYNC_REALTIME_ENDPOINT — WebSocket endpoint handed to the JS connector. Required for clientConfig().
signing_secret APPSYNC_CHANNEL_SIGNING_SECRET — HMAC secret shared with the Lambda authorizer. Required.
previous_signing_secrets APPSYNC_CHANNEL_PREVIOUS_SIGNING_SECRETS — Comma-separated previous secrets still accepted for verification during rotation; never used for signing. Optional.
region APPSYNC_REGION → AWS_DEFAULT_REGION us-east-1 SigV4 region fallback when it can’t be parsed from http_endpoint.
namespaces.public APPSYNC_PUBLIC_NAMESPACE public AppSync namespace public channel names map onto; must exist on the Event API.
namespaces.private APPSYNC_PRIVATE_NAMESPACE private AppSync namespace private- channel names map onto; must exist on the Event API.
tokens.connect_ttl — 43200 Connect token lifetime, seconds (12 h).
tokens.subscribe_ttl — 3600 Subscribe token lifetime, seconds (1 h).
authorizer.cache_ttl — 300 ttlOverride the authorizer returns for authorized calls.
http.timeout — 2.0 Publish request timeout, seconds.
http.connect_timeout — 1.0 Publish connect timeout, seconds.
uid_resolver — null Invokable class-string to derive the uid token claim; null = getAuthIdentifier().
client.auth_endpoint — /broadcasting/auth Where the connector requests channel authorization.
client.inactivity_timeout APPSYNC_INACTIVITY_TIMEOUT 10 Seconds; shipped in clientConfig() for your client code to consume (see Vue composable).
routes.auth.enabled — true Registers /broadcasting/auth via Broadcast::routes() (never shadows your own route).
routes.auth.middleware — ['web'] Middleware on the auth endpoint.
routes.client_config.enabled — false Opt-in JSON endpoint serving the connector config.
routes.client_config.uri — broadcasting/appsync URI of the client-config endpoint.
routes.client_config.middleware — ['web', 'auth'] Middleware on the client-config endpoint.

The appsync broadcasting connection merges over the package config, so config/broadcasting.php may override http_endpoint, signing_secret, previous_signing_secrets, region, namespaces and http.* per connection. A connection that sets its own signing_secret must also set its own previous_signing_secrets — the package-level previous list is never carried onto a different primary secret:

'connections' => [
    'appsync' => [
        'driver' => 'appsync',
        // 'http_endpoint' => env('APPSYNC_HTTP_ENDPOINT'), // optional override
    ],
],
Method Returns
AppSyncEvents::clientConfig(?Authenticatable $user = null) Connector options {wsEndpoint, httpHost, connectToken, authEndpoint, publicNamespace, privateNamespace, inactivityTimeout} — null for guests. The connectToken is a static string minted once.
AppSyncEvents::uid($user) The uid claim for tokens: runtime closure → uid_resolver class → getAuthIdentifier().
AppSyncEvents::resolveUidUsing(Closure) Set the uid strategy at runtime (config is not a place for closures).
AppSyncEvents::signer() The TokenSigner bound to signing_secret (connectToken(), subscribeToken()).
AppSyncEvents::httpHost($endpoint) The host[:port] authority the handshake authorizes.

Share the client config as a prop — App/Http/Middleware/HandleInertiaRequests.php:

public function share(Request $request): array
{
    return [
        ...parent::share($request),
        'appSync' => AppSyncEvents::clientConfig($request->user()),
    ];
}
const echo = new Echo(appSyncEchoOptions(props.appSync));

props.appSync is already the exact AppSyncConnectorOptions shape — spread or pass directly. Its connectToken is a static string; if your sessions outlive tokens.connect_ttl, wrap it in a re-fetching function (see the SPA variant below).

Enable the client-config route and protect it with your API middleware:

'routes' => [
    'client_config' => [
        'enabled' => true,
        'middleware' => ['auth:sanctum'],
    ],
],
const config = await fetch('/broadcasting/appsync', { credentials: 'include' })
    .then((r) => r.json());

const echo = new Echo(appSyncEchoOptions({
    ...config,
    credentials: 'include',          // cookies on the channel-auth POST too
    connectToken: () => fetch('/broadcasting/appsync', { credentials: 'include' })
        .then((r) => r.json())
        .then((c) => c.connectToken), // fresh token on every (re)connect
}));

Cross-origin apps need Access-Control-Allow-Credentials on both endpoints — configure Laravel’s config/cors.php accordingly.

For web-guarded auth endpoints, send the CSRF token on the channel-auth POST:

appSyncEchoOptions({
    // ...
    auth: {
        headers: { 'X-CSRF-TOKEN': csrfToken },
    },
})

Or use bearerToken for Sanctum token auth instead.

Visibility-aware Echo (Vue 3)

clientConfig().inactivityTimeout is a hint your code consumes — the connector itself doesn’t time out idle tabs. This composable disconnects a hidden tab after inactivityTimeout seconds and reconnects on return:

import Echo from 'laravel-echo';
import { appSyncEchoOptions } from '@hds-solutions/laravel-echo-appsync';
import type { AppSyncConnectorOptions } from '@hds-solutions/laravel-echo-appsync';
import { onBeforeUnmount, onMounted, readonly, ref } from 'vue';

export function useAppSyncEcho(options: AppSyncConnectorOptions, inactivityTimeout = 10) {
    const echo = new Echo(appSyncEchoOptions(options));
    const connected = ref(false);
    let timer: ReturnType<typeof setTimeout> | undefined;

    const connect = () => {
        clearTimeout(timer);
        echo.connector.connect();
        connected.value = true;
    };

    const disconnect = () => {
        clearTimeout(timer);
        echo.disconnect();
        connected.value = false;
    };

    const onVisibilityChange = () => {
        if (document.visibilityState === 'visible') connect();
        else timer = setTimeout(disconnect, inactivityTimeout * 1000);
    };

    onMounted(() => {
        document.addEventListener('visibilitychange', onVisibilityChange);
        connect();
    });

    onBeforeUnmount(() => {
        document.removeEventListener('visibilitychange', onVisibilityChange);
        disconnect();
    });

    return { echo, connected: readonly(connected), connect, disconnect };
}

For anonymous, read-only channels, add API_KEY to the Event API’s connection and subscribe auth modes and pass the key to the connector — no connect token or auth endpoint round-trip:

new Echo(appSyncEchoOptions({
    wsEndpoint: 'wss://<id>.appsync-realtime-api.<region>.amazonaws.com/event/realtime',
    publicApiKey: 'da2-xxxxxxxxxxxxxxxxxxxxxxxxxx',
}));

broadcast(new OrderShipped($order))->toOthers() is supported: the sender’s socket id (the X-Socket-ID header Echo attaches to the request that triggered the broadcast) is lifted out of the event data into a socket field on the published event envelope, and the Echo connector drops any event whose envelope socket matches its own socketId().

This is client-side filtering — AppSync has no server-side sender exclusion, so other connectors or raw subscribers still receive the event.

Channel names and AppSync channel paths

Laravel channel names map to AppSync channel paths /{namespace}/{segment}[/{segment}…] — the mapping is identical in PHP (ChannelPath) and TS (toAppSyncChannel), verified against a shared fixture:

Laravel channel name AppSync channel path
orders /public/orders
orders.1 /public/orders/1
orders.1.items /public/orders/1/items
orders.1-items /public/orders/1-items
private-orders.1 /private/orders/1
private-private.abc /private/private/abc
private-orders.1.items /private/orders/1/items
private-orders.550e8400-e29b-41d4-a716-446655440000 /private/orders/550e8400-e29b-41d4-a716-446655440000
private-solo /private/solo
privateer.x /public/privateer/x

Rules:

  • The private- prefix selects the private namespace (namespaces.private, default private); everything else maps under the public namespace (namespaces.public, default public). Prefixes are exact — privateer.x is public.
  • private-encrypted- names are rejected (InvalidArgumentException / InvalidChannelNameError) — payload encryption is not implemented by this package; use private-.
  • presence- names are rejected (InvalidArgumentException / InvalidChannelNameError) — presence channels are out of scope.
  • Each dot-part of the remaining name becomes a path segment (at most 4 — AppSync paths are capped at 5 segments total including the namespace).
  • - stays literal inside segments, so orders.1.items and orders.1-items are different channels (subscribe tokens are scoped to the path — keep that in mind when picking names).
  • Namespace names are configurable (namespaces.public / namespaces.private) but are the AppSync authorization boundary — they must match the namespaces created on the Event API, and each namespace can carry its own auth mode (e.g. API_KEY + Lambda for public, Lambda authorizer for private).
  • Subscribing or publishing to a missing namespace fails (subscribe_error / 404 BroadcastException).
  • Each segment is 1–50 chars, alphanumeric at both ends with [A-Za-z0-9-] inside — underscores are not allowed in AppSync channel paths. Invalid names throw InvalidArgumentException (PHP) / InvalidChannelNameError (JS) instead of hitting the API.
  • Token wire format — base64url(json(claims)) + '.' + hex(hmac_sha256(payload, secret)). Claims: purpose (connect/subscribe), uid, exp (unix), and channel (the AppSync path) on subscribe tokens. The secret is shared only between your app and the authorizer — never sent to AWS or clients.

  • TTLs — tokens.connect_ttl (default 12 h) and tokens.subscribe_ttl (1 h). authorizer.cache_ttl is the ttlOverride returned on authorized calls — how long AppSync may cache the decision.

  • Publish is never client-authorized — EVENT_PUBLISH is denied unconditionally; publishing requires IAM appsync:EventPublish.

  • Secret hygiene — keep APPSYNC_CHANNEL_SIGNING_SECRET out of VCS (use SSM/Secrets Manager for the Lambda side). Rotate without downtime:

    1. Generate a new secret — php artisan appsync-events:secret --show prints 64 hex chars without touching .env (or openssl rand -hex 32).
    2. Deploy the authorizer first with APPSYNC_CHANNEL_SIGNING_SECRET=<new> and APPSYNC_CHANNEL_PREVIOUS_SIGNING_SECRETS=<old> — it now verifies both.
    3. Deploy the Laravel app with the new APPSYNC_CHANNEL_SIGNING_SECRET — it signs new tokens immediately; clients receive them on their next auth/clientConfig call.
    4. Once the longest token TTL has elapsed — connect tokens default to 12 h (tokens.connect_ttl), subscribe tokens to 1 h (tokens.subscribe_ttl) — remove APPSYNC_CHANNEL_PREVIOUS_SIGNING_SECRETS from the authorizer.

    Clients holding tokens signed with the old secret simply reconnect and re-authorize with fresh tokens; already-authorized sockets are unaffected.

  • Least privilege — scope appsync:EventPublish to the namespaces you use, and the authorizer’s SourceArn to the API.

  • Testing — the AWS emulator used by the test suite does not verify SigV4 signatures, does not invoke Lambda authorizers, and does not validate token contents; those paths are covered by unit tests. Do not use the emulator for security testing.

Keep BROADCAST_CONNECTION=reverb (or log) locally and appsync in production — broadcasting is driver-agnostic, so nothing else changes. For AppSync-specific behavior, the repo runs against the AWS emulator: tests/emulator/start.sh, then composer test:emulator / npm --prefix js run test:emulator.

composer test          # Pest (unit + feature)
composer lint          # Pint
composer analyse       # PHPStan
npm --prefix js test   # Vitest

Emulator tests, fixture conventions and the PR checklist live in CONTRIBUTING.md; security reports go through SECURITY.md.

  • No presence channels — echo.join() / presenceChannel() throws, and channel names starting with presence- are rejected (InvalidArgumentException / InvalidChannelNameError); presence metadata has no AppSync Events equivalent.
  • No client events / whispers — clients cannot publish by design.
  • One Echo connector instance per socket — the connector multiplexes channels over a single AppSync WebSocket; concurrent reconnects reuse the latest connect generation only.
  • Emulator caveats — see tests/emulator/README.md.

Both packages follow SemVer and release in lockstep (0.x while the API surface stabilizes). MIT — see LICENSE. Built by Hermann D. Schimpf.

Laravel News Links

Anthropic Launches Claude Ship to Review, Fix, and Approve Code

Anthropic has unveiled Claude Ship, a new feature in Claude Code that allows AI agents to review pull requests, fix bugs, resolve merge conflicts and approve code changes according to policies established by development teams. 9to5Mac reports: Claude Ship is comprised of three agents: Code Review, PR Steward, and Claude Approvals. "Together, they take a pull request through review, fixes, and an approval decision so teams don’t have to manage each step manually," Anthropic says. "Developers can try Claude Ship on their own pull requests with the new /ship command in Claude Code," Anthropic says.


Read more of this story at Slashdot.

Slashdot

pgjumbo: A PostgreSQL Client for macOS, Windows, and Linux

https://laravelnews.s3.amazonaws.com/featured-images/pgjumbo-featured.png

pgjumbo is a new PostgreSQL client from Benjamin Ibrulj, for macOS, Windows, and Linux. Before an update, delete, or a table change runs, it tells you how many rows it will touch, which triggers fire, which foreign keys cascade, and what it will lock.

Writes Show What They Will Touch

Rest the cursor on a write in the Query Tool and a strip appears above it. The row count comes from the planner’s estimate, so nothing runs to produce it. If the estimate isn’t good enough, Count exactly runs a read-only count(*) built from the statement’s WHERE clause, for up to 10 seconds:

Rehearse runs the UPDATE, DELETE, or MERGE inside an uncommitted transaction and lists every row it changed, with old and new values side by side.

Each statement also runs under its own savepoint, so a typo halfway through a transaction undoes that one statement and leaves the earlier ones in place. A Smart commit mode waits for your first write before it opens a transaction, so a session that only reads never holds one open.

Query Plans and What If

The Explain tab draws the plan as a diagram, ties each step to the SQL it came from, and marks the slowest step:

What if compares the current plan with the plan you’d get from an index that doesn’t exist yet, or from a different planner setting like work_mem. Both plans come from a plain EXPLAIN in the tab’s session, so nothing is built and nothing changes for other connections on the server.

The Assistant

The optional Assistant runs the Claude Code installation already on your computer, signed in to your own Claude plan or API key. pgjumbo has no Claude account of its own. It’s off by default, and when it’s off, pgjumbo sends nothing anywhere.

You decide what it may read on each kind of server. By default, it reads structure and statistics, asks before reading row data on Dev and Staging, and asks every time on Production. SQL it suggests is checked with PostgreSQL’s parser, and nothing runs until you run it.

Learn More

Pgjumbo connects to PostgreSQL 14 through 19 (12 and 13 on a best-effort basis), Amazon RDS and Aurora with IAM sign-in, and servers behind an SSH tunnel.

Downloads are available for macOS 13 or newer (one build for Apple silicon and Intel), Windows 10 and 11 on x64 and ARM64, and Linux.

You can download pgjumbo and read the user guide at pgjumbo.com.

Laravel News

Using dbvr with MySQL: From First Datasource to Production Queries

 

What dbvr is, and why use it with MySQL

dbvr lets you define MySQL connections and run SQL from the command line, with no graphical interface. That makes it a fit for servers, containers, and pipelines where a desktop database tool cannot run.

DBeaver Corporation announced dbvr on March 26, 2026 as a standalone CLI built on the same multi-database engine as the DBeaver desktop products. According to that announcement, it can:

  • Run SQL queries and scripts from saved or inline connection settings, with no interactive login.
  • Run on locked-down servers, inside containers, and over SSH on remote hosts.
  • Authenticate natively to AWS, GCP, and Azure databases.
  • Export query results to S3, Google Cloud, or Azure storage.
  • Plug into CI/CD pipelines for database checks and backup/restore validation.

There are two editions. The commercial edition is an annual per-machine subscription with a 14-day trial. dbvr Community is free under the Apache License 2.0. Per the dbeaver.io product summary, Community covers MySQL, username and password authentication, SSH tunnels, local result export, and metadata management. Cloud storage export, cloud authentication, external secret managers, and the MCP server are listed for the commercial edition only.

This post covers creating a MySQL datasource, running queries, and using dbvr for production queries. Full documentation is available.

Creating a MySQL datasource

In dbvr, a datasource is a saved, named connection, so later commands can refer to it by name instead of repeating host and credentials. You create one with the datasource create command and a MySQL driver.  In the following example we are using 26.10.0 MySQL Community Server – GPL.

The full option list is in the datasource create reference.

$ dbvr datasource create –driver=mysql8 –name=world –host=localhost –port=3306 –user=stoker –password=hidave –database=world
mysql8-1a1f537d8af-5a9a876cc3457ae9
$ dbvr datasource list
ID                                           NAME        DRIVER      mysql8-1a1f537d8af-5a9a876cc3457ae9          world       mysql8

Running queries

The sql command runs a query or a whole script against a datasource and prints or exports the results. Per the sql reference and cheat sheet, you can:

  • Pass a query inline, pointing at a saved datasource by name.
  • Run a .sql script file instead of an inline query.
  • Skip the saved datasource and give connection details inline, useful for one-off checks.
  • Write results to a file in a chosen format such as CSV.

The meta commands list databases, schemas, and tables and print their DDL, so you can inspect a MySQL server without a GUI. In MySQL, a schema and a database are the same thing, so expect the database and schema listings to overlap.

$ dbvr sql -ds=world "SELECT * FROM city LIMIT 5;"
|ID |Name          |CountryCode|District     |Population|
|—|————–|———–|————-|———-|
|1  |Kabul         |AFG        |Kabol        |1,780,000 |
|2  |Qandahar      |AFG        |Qandahar     |237,500   |
|3  |Herat         |AFG        |Herat        |186,800   |
|4  |Mazar-e-Sharif|AFG        |Balkh        |127,800   |
|5  |Amsterdam     |NLD        |Noord-Holland|731,200   |
Rows read: 5, (153ms)

Using dbvr for production queries

Because dbvr needs no GUI or interactive login, it can run production MySQL queries wherever your automation already runs: a scheduled job on a server, a container, or a CI/CD pipeline step.

Common production uses, based on DBeaver’s announcement and docs:

  • Scheduled reports. A cron job or scheduler runs a saved .sql script against the production datasource and exports the results to CSV.
  • Exports to cloud storage. The sql command can read scripts from and write results to S3, Google Cloud, or Azure storage URIs (commercial edition).
  • Pipeline checks. A deployment step runs validation queries, such as row counts or schema checks, and fails the build if they return unexpected results.
  • Backup and restore validation. Verification scripts run against a restored database to confirm schema integrity and data completeness.
  • AI tool access. dbvr can run as an MCP server (mcp start, commercial edition) so an AI assistant can query a datasource. For production, point it only at a read-only datasource.

To keep this safe:

  • Keep Prod in its own project. Separate projects make it harder to run a test script against production by mistake.  
  • Keep passwords off the command line. A password typed as a command option can end up in shell history and process lists. dbvr has secret-manager commands and a pre-configure credentials guide; check those for the method that fits your setup.
  • Use a read-only MySQL account. Grant it only SELECT on the databases reports need. This protects data regardless of how dbvr is configured.
  • Cap runaway queries. MySQL’s max_execution_time setting (in milliseconds) stops long-running SELECT statements. It applies to read-only SELECTs, not writes, and is set globally or per session rather than per account.
  • Version-control your scripts. Run reviewed .sql files from a repository rather than ad-hoc inline queries.

dbvr vs. the mysql client

Neither tool wins everywhere. The mysql command-line client is the more mature choice for MySQL-only work, while dbvr pays off when you need multiple databases, cloud logins, or cloud exports. The dbvr column reflects DBeaver’s own published claims, not independent testing.

dbvr

mysql client

Databases

100+ SQL and NoSQL engines

MySQL (and largely MariaDB) only

Cost

Annual per-machine subscription; free Community edition (Apache 2.0)

Free; ships with MySQL

Cloud authentication

Native AWS, GCP, and Azure (commercial edition)

Usually needs a token from the cloud provider’s CLI

Exporting results

Writes directly to S3, Google Cloud, or Azure storage (commercial edition)

Writes local output; upload separately

Saved connections

Named datasources grouped in projects, plus secret-manager

Option files (~/.my.cnf) and mysql_config_editor login paths

AI tool access

Built-in MCP server (commercial edition)

None built in

MySQL-specific features

Not verified to match the mysql client

\G vertical output, SOURCE, --safe-updates, batch mode

Maturity

Launched March 2026

Decades of production use

Pick the mysql client for MySQL-only work on servers you control. Pick dbvr when you work across several database engines, use cloud-managed databases with IAM-style login, or export straight to cloud storage. Oracle’s MySQL Shell (mysqlsh) is a third option worth evaluating if you also want scripting in JavaScript or Python.

Wrapping up

dbvr brings DBeaver’s MySQL connectivity to the command line: create a datasource once, then run and export queries from scripts, servers, and pipelines. Pair it with separate projects, stored credentials, and a read-only MySQL account, and it becomes a dependable way to run production queries.

Sources

Planet for the MySQL Community

T-Rex Arms Data Dump: Thousands Of Free Military Manuals

https://cdn-fastly.thefirearmblog.com/syndication-media/2026/11/12/10351/rex-arms-data-dump-thousands-of-free-military-manuals.jpg

Finally, you can get a manual to field-strip your old mil-surp rifle. [Zac K.]

Not many things in this world will come for free, but here is one thing that comes with no price tag—sort of. T-Rex Arms has just made a massive upload of military manuals to their website; they’re spreading the word that you can visit their page and download all these books and publications at no cost.

Mil-surp madness @ TFB:

Reading to save your life

If you’ve ever been in the armed forces, or even in an army-navy store, you know what a military manual is. Everything in the military comes with a how-to guide. Every piece of equipment and every practice. At least, that’s how it works in the U.S. military and other standardized armed forces.

United States Army Lt. Gen. John Kimmons wants you to pull off Gitmo interrogation correctly. [US Army]

Careful organization breeds competence and the military will tell you how to do everything in a way to its satisfaction. Whether that’s lacing your boots or packing a parachute or surviving a snake-infested jungle in Laos, there’s a way that Uncle Sam wants you to do it, and a manual will tell you how.

No matter what part of Army life you’re talking about, there’s a manual for it. Army surplus stores typically sell reprints of the most popular titles. [Zac K.]

This means the military has all sorts of firearms-related manuals. Whether it’s marksmanship skills, firearms maintenance or other gun stuff, the military has printed information on its best practices, and T-Rex Arms has many of those available for you for free.

Check their full list of manuals here. Much of the information covered will be of zero use to anyone, but some of it will be quite useful from a historical perspective, if nothing else.

Even opposing forces’ small arms are sometimes covered in these manuals. [Zac K.]

Of course, many manuals from the list were already available elsewhere for free if you knew where to look, but having T-Rex put the whole list in a single place makes for convenient one-stop shopping. If you want to put your AI subscription to good use, have it make an installer tool that lets you download all the files at once … if you’ve got the hard drive space.

The Firearm Blog

Distribute Amazon RDS traffic between read replicas using Network Load Balancer

https://d2908q01vomqb2.cloudfront.net/887309d048beef83ad3eabf2a79a64a389ab1c9f/2026/11/10/DBBLOG-5447-featured-image.png

In this post, you will learn how to use a Network Load Balancer (NLB) to distribute traffic across Amazon Relational Database Service (Amazon RDS) read replicas with health-aware, AZ-affinity routing. You will also learn how this architecture simplifies hybrid connectivity over AWS Direct Connect or AWS Site-to-Site VPN to your RDS read replicas. The load balancer acts as the stable entry point for read replica traffic, without AWS PrivateLink overhead. For PrivateLink-based alternatives, see Accessing Amazon RDS across VPCs and Accessing Amazon RDS across accounts.

There are several approaches to balance traffic across read replicas, including Amazon Aurora (Aurora) built-in reader endpoints, Amazon Route 53 weighted routing, and open source proxies such as ProxySQL and PgBouncer. Each comes with benefits and trade-offs, which the following section discusses.

Existing approaches for read replica load balancing

Several approaches exist today for distributing read traffic across replicas, each with its own strengths. This post presents an architecture based on Network Load Balancer as an additional option to consider alongside them.

Aurora reader endpoint

If you run Aurora, you can use its built-in reader endpoints. The Aurora reader endpoint automatically load balances read traffic across available read replicas, distributing connections without requiring client-side logic, a proxy, or a load balancer. This simplifies your architecture and improves read scalability. You can learn more about the Aurora reader endpoint distribution logic in How does Aurora MySQL or PostgreSQL distribute workload between reader nodes.

Route 53 weighted routing

Route 53 weighted routing can distribute traffic across read replicas, as described in Load balancing strategies for RDS read replicas and this AWS re:Post article. This is straightforward to set up and works across all engines supported on Amazon RDS. This approach requires a Route 53 hosted zone. It is prone to client-side DNS caching that causes uneven traffic distribution. Setting a low time to live (TTL) value helps reduce the effect. It has no awareness of the caller’s Availability Zone. For on-premises clients over Direct Connect or Site-to-Site VPN, consuming Route 53 private hosted zones adds cost and complexity with Amazon Route 53 Resolver Inbound Endpoint.

Connection pooling with ProxySQL and PgBouncer

For connection pooling and database-aware routing, open source proxies such as ProxySQL and PgBouncer are well-established solutions that support read/write splitting and can distribute connections across read replicas. For a detailed comparison of PgBouncer and Amazon RDS Proxy for PostgreSQL workload, see understanding the difference between PgBouncer and Amazon RDS Proxy for PostgreSQL connection pooling. They also support highly available configurations with HAProxy and near zero-downtime upgrades. These tools introduce operational overhead because you must deploy, patch, and scale the proxy tier yourself. A single proxy instance is pinned to one Availability Zone, so database traffic routes through that AZ regardless of where the client and RDS instance reside. This prevents AZ-affinity traffic flow. Achieving high availability requires additional components or multiple proxy instances, adding further complexity.

The Network Load Balancer architecture described in this blog post addresses health-aware routing, AZ affinity, and hybrid connectivity in a single solution. This architecture works with any Amazon RDS engine that supports read replicas. Configure the target group port to match your engine (for example, 3306 for MySQL, 5432 for PostgreSQL).

Solution overview

To distribute read traffic across replicas with health awareness and AZ affinity, this solution uses a Network Load Balancer as the stable entry point. An AWS Lambda function keeps the Network Load Balancer target group synchronized with the current IP addresses of your RDS read replicas.

Architecture overview showing an AWS Lambda function that updates a Network Load Balancer target group with the current IP addresses of Amazon RDS read replicas

Figure 1: Architecture overview

How it works

The Lambda function, triggered by Amazon EventBridge, continuously synchronizes your RDS read replica IP addresses with a Network Load Balancer target group. It monitors DNS changes, registers new replicas, and cautiously deregisters stale ones, so your application traffic always flows to healthy, available database endpoints.

Trigger mechanism

Amazon EventBridge rule triggers the Lambda function every minute (configurable to a shorter interval). This frequent polling means that changes to your read replica fleet, whether from scaling events, failovers, or maintenance, are reflected in the Network Load Balancer target group within 60 seconds.

DNS resolution process

When invoked, the Lambda function reads environment variables containing the DNS names of your RDS read replicas and the Amazon Resource Name (ARN) of the Network Load Balancer target group to manage.

The function then resolves each replica DNS name to its current IP addresses. To handle transient DNS fluctuations (temporary resolution failures or network interruptions), the code includes retry logic that prevents false positives from triggering unnecessary deregistration.

State management

Because Lambda functions are stateless, the solution persists state across invocations using two JSON files stored in Amazon Simple Storage Service (Amazon S3).

  • active_ip.json contains the IP addresses that were successfully resolved from DNS during the last invocation. This represents the known-good state of your replica fleet.
  • pending_ip.json tracks IP addresses that are candidates for deregistration, along with a counter indicating how many consecutive invocations each IP has been flagged for removal.

On the first invocation, if these files do not exist in S3, the Lambda function creates them automatically based on the current DNS resolution results and Network Load Balancer target group state.

Registration is immediate, while deregistration follows a cautious approach. Registering an IP that shouldn’t be registered carries low risk because the Network Load Balancer performs health checks on targets. If an IP is invalid or unreachable, the health check marks it as unhealthy and the Network Load Balancer won’t route traffic to it. Subsequent invocations clean up the IP when it stops appearing in DNS.

Key design decisions

AZ affinity and cross-AZ data transfer costs

Network Load Balancer supports Availability Zone DNS affinity. When you turn on this feature, clients that resolve the Network Load Balancer DNS name using Route 53 Resolver receive load balancer IP addresses within their own Availability Zone. If no healthy Network Load Balancer IP addresses exist in the client’s own Availability Zone, DNS might fall back to an IP address in another Availability Zone. For applications running on Amazon Elastic Compute Cloud (Amazon EC2), Amazon Elastic Container Service (Amazon ECS), or Amazon Elastic Kubernetes Service (Amazon EKS) within the same Amazon Virtual Private Cloud (Amazon VPC), this topology-aware routing helps reduce inter-AZ data transfer costs, lower latency, and build zonally independent application architectures.

To fully benefit from zonal affinity, keep cross-zone load balancing disabled so that traffic stays within a single Availability Zone end to end, minimizing both cost and latency.

Network Load Balancer Availability Zone DNS affinity keeping client connections within the same Availability Zone

Figure 2: NLB AZ affinity

Eliminating PrivateLink overhead

This architecture connects clients directly through the Network Load Balancer, without requiring PrivateLink. This removes the hourly endpoint charges and data processing fees associated with PrivateLink, reducing overall cost.

A Network Load Balancer provides one static IP address per enabled Availability Zone. Applications in the same or a different VPC or AWS account can reach these IP addresses directly through AWS Transit Gateway or VPC peering. On-premises clients can also connect to these IP addresses directly, without a DNS dependency.

Health detection

You can configure health checks as frequently as every 5 seconds (the shortest interval Network Load Balancer supports, with a default of 30 seconds). When a replica fails its health check, the Network Load Balancer stops sending traffic to it, keeping requests flowing only to healthy targets.

Hybrid and on-premises connectivity

If you connect from on-premises over Direct Connect or Site-to-Site VPN, the Network Load Balancer approach reduces the setup needed for database connectivity.

If you want a custom domain name pointing to your private RDS endpoints, consider how on-premises clients resolve DNS. On-premises clients don’t natively resolve a Route 53 private hosted zone for the weighted records. You have several options.

  • Maintain a public domain name mapped to private infrastructure IP address, effectively revealing your internal topology through public DNS.
  • Find a DNS configuration that supports multiple CNAME chaining for the same domain.
  • Deploy Route 53 Resolver inbound endpoints paired with on-premises DNS forwarders and Route 53 private hosted zones, which adds significant operational overhead.

A private Network Load Balancer receives a publicly DNS-resolvable host name. Although the Network Load Balancer DNS name resolves through public DNS, it returns private IP addresses. These are reachable from within the VPC (and VPC peering or Transit Gateway). For on-premises clients, reachability requires Direct Connect or a Site-to-Site VPN. The Network Load Balancer provides a single host name across all enabled Availability Zones, compared to individual read replicas that each have their own endpoint host name. On-premises clients resolve this host name through standard DNS, and traffic flows over your existing Direct Connect or Site-to-Site VPN connection to the static IP addresses of Network Load Balancer.

If mapping a custom domain to your existing infrastructure isn’t a requirement, then no additional DNS infrastructure, no Resolver endpoints, and no private hosted zone configuration are needed.

Since Network Load Balancer IP addresses are static, on-premises clients can also connect directly by IP address.

On-premises clients connecting to Network Load Balancer static IP addresses over AWS Direct Connect or AWS Site-to-Site VPN

Figure 3: On-premises connectivity

Implementation

Prerequisites

  • An AWS account with permissions to create Network Load Balancer, Lambda, Amazon S3, and Amazon EventBridge resources.
  • An Amazon RDS instance with one or more read replicas across multiple Availability Zones.
  • A VPC with subnets in at least two Availability Zones.
  • Familiarity with AWS CloudFormation.
  • AWS Command Line Interface (AWS CLI) installed and configured.

Deployment

The solution is available in the RDS read replica NLB registration GitHub repository. The repository contains the Lambda function (populate_NLB_TG_with_RDS_RR.py), a CloudFormation template, and a detailed Deployment Guide.

Quick start:

  1. Clone the repository and run the included deploy.sh script, which packages the Lambda code and uploads it to Amazon S3:
  2. Deploy the CloudFormation stack using the template URL printed by the script. Key parameters include:
  • RDSReplicaDNSNames – Comma-separated DNS endpoints of your read replicas.
  • NLBTargetGroupARN – ARN of your existing Network Load Balancer target group (or set CreateTargetGroup=true to create one).
  • S3BucketName – Bucket for Lambda state persistence (or set CreateS3Bucket=true).
  1. Verify that targets are registered and healthy:

You should see each replica IP listed with "State": "healthy".

For the full parameter reference, optional resource creation flags, CLI deployment, troubleshooting, and cleanup, see the Deployment Guide.

The following screenshot shows an example Amazon CloudWatch log entry when the Lambda function runs successfully.

Amazon CloudWatch log entry showing a successful Lambda function run that synchronized the target group

Figure 4: Amazon CloudWatch log for a successful Lambda run

The following screenshot shows the registered targets in the Network Load Balancer target group.

Network Load Balancer target group showing registered read replica IP targets in a healthy state

Figure 5: Registered targets in the Network Load Balancer target group

Note: Make sure the RDS security group allows inbound TCP traffic on your database port from the Network Load Balancer subnets. For the AWS Identity and Access Management (IAM) policy for the Lambda function and S3 bucket security configuration, see the Deployment Guide.

Cost estimate

This cost estimate covers the resources used with Network Load Balancer handling TCP traffic across three AZs, a Lambda function running every minute to resolve RDS endpoint IPs and update Network Load Balancer target groups, an S3 bucket to store DNS resolution results between invocations, and three RDS read replicas (db.r6g.large with 100 GB gp3 storage each).

The following is an estimated total cost of ownership for this architecture in a deployment (three AZs, three read replicas, moderate traffic) where application server traffic to read replicas is distributed evenly across AZs. This considers only the additional overhead cost without the RDS cost, at the time of writing (subject to change).

NLB and Lambda IP sync cost

Service Configuration
Network Load Balancer 1 NLB, 3 AZs, ~10 GB/hr TCP throughput, ~500 new connections/sec, ~120 s avg connection duration
AWS Lambda 1 invocation/min (IP sync function), x86, 512 MB memory
Amazon S3 ~0.5 GB storage, ~43,200 PUT/GET requests/month
Data Transfer (Lambda) Minimal outbound (DNS resolution + S3 API calls)

Note: Use the AWS Pricing Calculator with the preceding configuration to estimate the monthly cost for your Region and traffic pattern.

When connections use round-robin or uniform load balancing without AZ awareness, each application server has an equal probability of connecting to any of the three read replicas. Only one out of three connections lands in the same AZ as the caller. The remaining two-thirds (66.7 percent) of connections cross AZ boundaries.

For example, at 10 GB/hour (about 7 TB/month) through the Network Load Balancer: 7 TB × 0.667 ≈ 4.7 TB of inter-AZ traffic per month. For current inter-AZ data transfer rates, see EC2 data transfer pricing.

With AZ DNS affinity enabled and cross-zone load balancing disabled, traffic stays within the same AZ end to end in the steady state, reducing inter-AZ data transfer.

Note: To estimate the impact for your workload, review your current inter-AZ data transfer costs to RDS and compare them against the Network Load Balancer architecture overhead. This helps you determine whether the architecture results in net savings or additional overhead for your specific traffic patterns.

Clean up

To avoid ongoing charges, remove the resources created for this solution.

  • Delete the CloudFormation stack. This removes the Network Load Balancer, Lambda function, Amazon EventBridge rule, and IAM roles.
  • Verify that the Network Load Balancer and target groups are deleted. You can use the AWS CLI command aws elbv2 describe-load-balancers to confirm.
  • Delete the S3 bucket or state files that the Lambda function used for DNS resolution results.
  • If you created read replicas for testing, delete them using the AWS CLI or CloudFormation.

Considerations and limitations

  • Note that the Network Load Balancer balances connections, not queries. Open or recycle connections periodically for query redistribution logic.
  • In Amazon EKS environments, pod DNS queries handled by CoreDNS can break the Network Load Balancer zonal DNS affinity. When a pod and its CoreDNS node are in different AZs, the DNS response returns the Network Load Balancer IP for the CoreDNS node’s AZ rather than the application node’s AZ. To preserve AZ-local routing, deploy NodeLocal DNSCache so each pod resolves DNS through a cache daemon running on its own node. For setup steps, see Install NodeLocal DNSCache in Amazon EKS.
  • When a replica IP is deregistered, the Network Load Balancer applies the target group’s deregistration delay (default 300 seconds, configurable). This gives existing connections time to complete gracefully before the target is removed from the load balancer.

Conclusion

In this post, you learned how to use a Network Load Balancer and a Lambda function to spread read traffic across Amazon RDS read replicas. The Lambda function keeps the target group in sync with your replica IP addresses. Network Load Balancer health checks send traffic only to replicas that pass their checks. Availability Zone DNS affinity, with cross-zone load balancing turned off, keeps traffic within the client’s Availability Zone. This architecture also gives on-premises clients a single stable host name and static IP addresses over Direct Connect or Site-to-Site VPN, without PrivateLink or Route 53 Resolver endpoints.

To get started, deploy the CloudFormation template from the GitHub repository. Then check that the target group lists your read replicas. After deployment, watch Amazon CloudWatch metrics for Lambda errors and unhealthy target counts to confirm the synchronization works.

 


About the authors

Vijay Chakraborty

Vijay is a Technical Account Manager at AWS, based in India. He helps customers design, develop, and operate secure, scalable, and innovative solutions using the breadth and depth of AWS capabilities to deliver measurable business outcomes. He provides strategic technical guidance across the cloud journey from architecture reviews and migration planning to cost optimization and operational excellence.

Debapriyo Jogi

Debapriyo, an AWS Technical Account Manager specializing in cloud networking, adeptly fosters strong customer relationships while offering expert technical guidance. He assists organizations in designing resilient, efficient, and adaptable cloud and network architectures. He provides strategic insights and tailored recommendations to optimize AWS usage, enhance network performance, and facilitate seamless cloud adoption.

Arun Kumar N C

Arun, an AWS Technical Account Manager specializing in cloud networking, excels at building strategic customer relationships and providing expert guidance. He helps customers develop scalable, secure, and cost-effective cloud solutions, offering proactive support and tailored advice to optimize AWS environments and drive successful cloud adoption.

Planet for the MySQL Community

Before You Write Your Next Laravel Migration, Design Your Database

https://media2.dev.to/dynamic/image/width=1200,height=627,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fschemasketch.dev%2Fog-image.png

We’ve all done it.

You start a new Laravel project, create your first migration, add a few relationships, and move on to building features.

A few weeks later, the database starts getting complicated.

You discover relationships you didn’t consider, tables that need restructuring, missing indexes, and migrations that are becoming increasingly difficult to maintain.

Suddenly, changing the database becomes much harder than it should be.

What if we spent a little more time understanding the database before writing the code?



Database design shouldn’t be an afterthought

A database schema is one of the most important parts of an application.

It defines how your data is structured, how different entities relate to each other, and how your application will evolve.

Yet many developers approach database design incrementally, figuring things out as they implement features.

There is nothing inherently wrong with that approach. But having a visual representation of your database can make a significant difference.

Before implementing a new system, consider:

  • What are the main entities?
  • How are they related?
  • Are the relationships correct?
  • Are there unnecessary or duplicated fields?
  • Will the structure support future requirements?
  • Can another developer understand the database without digging through dozens of migrations?

A database diagram helps answer these questions before they become development problems.



From database structure to visual diagrams

This is one of the reasons I started building SchemaSketch.

SchemaSketch is a database diagramming platform designed to help developers understand, visualize, and work with database structures.

You can:

  • Generate database diagrams from SQL.
  • Visualize tables, columns, and relationships.
  • Work with DBML.
  • Convert SQL into DBML using free online tools.
  • Integrate database workflows into your development process.

The goal is simple: make database structure easier to understand and maintain.

Explore: https://schemasketch.dev



Working with Laravel?

If you’re a Laravel developer, there’s also a dedicated SchemaSketch Laravel package.

It provides an Artisan command:

php artisan schemasketch:export

This brings SchemaSketch into your Laravel development workflow and makes it easier to work with your application’s database structure.

You can find the package and installation instructions here:

SchemaSketch Laravel Package



Think beyond individual migrations

One thing I’ve learned from working on larger applications is that understanding the overall database structure is just as important as understanding individual tables.

As applications grow, database knowledge can become scattered across migrations, models, documentation, and developers’ heads.

Having a visual representation helps create a shared understanding of the system.

It is useful during:

  • New feature planning.
  • Code reviews.
  • Database refactoring.
  • Onboarding new developers.
  • Architecture discussions.
  • Long-term maintenance.



A small change in workflow can make a big difference

You don’t necessarily need to change how you build Laravel applications.

You can simply introduce one additional step:

Understand the database structure before implementing the feature.

Draw it. Review it. Discuss it. Then start coding.

If you’re working with databases and want to give this approach a try, check out SchemaSketch.

I’d also love to hear how other Laravel developers approach database design.

Do you design your database before writing migrations, or do you prefer to figure it out as the application evolves?

Laravel News Links

Open-Source ESP32 remote controls thousands of devices

https://cdn-blog.adafruit.com/uploads/2026/11/open-source-esp32-remote-controls-thousands-of-devices.jpg

Open-Source ESP32 remote controls thousands of devices

Ananthu Ashok, writing for Open Source For You, covers IRis, an open-source universal infrared remote built around an ESP32 by Nicolas Ruiz Neiman. It learns commands from existing remotes, stores them and replays them to control other devices.

The build uses an ESP32-WROOM-32 module, a 1.3 inch OLED screen and five push buttons for the menu. A TSOP38238 receiver picks up the incoming signals, and two infrared LEDs driven by a 2N2222 transistor send them back out. The parts are in a 3D-printed case powered by an 18650 lithium-ion cell.

IRis decodes NEC, Samsung, Sony SIRC, RC5 and JVC, saving the protocol, address and command. Signals it can’t identify are recorded raw. Captured commands can be grouped into virtual remotes, and the project can pull from the Flipper-IRDB code database. A Python tool converts LIRC files and Pronto hex codes to .ir files. A “Be Gone” mode sends the power commands for a whole category of remotes.

The project is under GPL v3.0, with firmware, wiring diagrams, a bill of materials, assembly notes and the 3D files published. Pre-compiled firmware is offered too.

See more at opensourceforu.com and content on GitHub.

3D printing – Adafruit Industries – Makers, hackers, artists, designers and engineers!

beziworld/laravel-proxmox

http://packalyst.com/assets/img/logo.png

Laravel Proxmox VE

tests
Latest Version
License

Laravel client for the Proxmox VE API: nodes, QEMU
virtual machines and LXC containers (lifecycle, configuration, cloning, snapshots, backups, migration), storage,
asynchronous tasks with a UPID waiter, cluster resources and access control, for one or many clusters.

Polska wersja dokumentacji

Features

  • API tokens (PVEAPIToken=user@realm!id=secret) or username/password tickets with the
    CSRFPreventionToken, cached and renewed automatically
  • Multiple named clusters plus using([...]) for clusters stored in your database
  • TLS verification on by default, per connection verify_ssl true, false or a CA bundle path
    (/etc/pve/pve-root-ca.pem)
  • Guests addressed by VMID: Proxmox::vm(100) finds the node in the cluster resources
  • Every asynchronous call returns a Task (UPID) with wait(), status(), log() and stop(); failures raise
    TaskFailed with the last log lines, long tasks TaskTimeout
  • Typed DTOs (Node, ClusterResource, GuestStatus, Snapshot, TaskStatus, Storage, StorageVolume,
    ApiToken, User) that keep the raw payload
  • Reads retried on connection errors, HTTP 5xx and 595/596, writes never retried; validation errors exposed per
    parameter
  • php artisan proxmox:check and php artisan proxmox:task {upid}
  • PHP 8.3+, Laravel 12 and 13, PHPStan level 8, works with Http::fake() and Sleep::fake()

Why this package

On Packagist (November 2026) corsinvest/cv4pve-api-php has about 1.37M downloads: a complete generated client,
framework-agnostic and curl-based. Laravel packages are rare: irabbi360/laravel-php-proxmox (about 4.6k downloads)
always disables TLS verification, supports only password tickets for a single server and has no task handling;
h1g/proxmox (160 downloads) is a 2016 Laravel 5 binding. This package adds:

  • API token authentication and ticket caching shared by queue workers
  • several clusters, each with its own credentials, node and TLS settings
  • a UPID task waiter, so provisioning flows (clone, configure, start) can be written top to bottom
  • Laravel’s HTTP client (testable with Http::fake()), typed exceptions and DTOs

Installation

composer require beziworld/laravel-proxmox
php artisan vendor:publish --tag=proxmox-config   # optional
PROXMOX_URL=https://pve1.example.com:8006
PROXMOX_TOKEN_ID=automation@pve!laravel          # Datacenter > Permissions > API Tokens
PROXMOX_TOKEN_SECRET=b3c6a8e2-....
PROXMOX_NODE=pve1                                # default node for create/list calls
PROXMOX_VERIFY_SSL=/etc/ssl/pve-root-ca.pem      # true, false or a CA bundle path

# or a ticket login instead of the token:
# PROXMOX_USERNAME=root@pam
# PROXMOX_PASSWORD=
php artisan proxmox:check

API tokens with privilege separation only hold the permissions granted to the token itself: grant a role (for
example PVEVMAdmin on /vms and PVEDatastoreUser on /storage) to the token, not only to its user.

More clusters go into config/proxmox.php:

'connections' => [
    'default' => [...],
    'dc2' => [
        'url' => 'https://dc2-pve1.example.com:8006',
        'token_id' => env('PROXMOX_DC2_TOKEN_ID'),
        'token_secret' => env('PROXMOX_DC2_TOKEN_SECRET'),
        'node' => 'dc2-pve1',
        'verify_ssl' => storage_path('certs/dc2-pve-root-ca.pem'),
    ],
],

Usage

Provision a VM from a template

use Beziworld\Proxmox\Facades\Proxmox;

$vmid = Proxmox::cluster()->nextId();

Proxmox::vm(9000)->clone($vmid, ['name' => 'shop-42', 'full' => true, 'storage' => 'local-lvm'])->wait();

$vm = Proxmox::vm($vmid);
$vm->updateConfig(['memory' => 4096, 'cores' => 2, 'ipconfig0' => 'ip=10.0.0.42/24,gw=10.0.0.1'])?->wait();
$vm->resize('scsi0', '+20G')?->wait();
$vm->start()->wait();

Lifecycle

$vm = Proxmox::vm(100);                      // node looked up in /cluster/resources
$vm = Proxmox::vm(100, 'pve1');              // or given explicitly
$ct = Proxmox::container(200);
$guest = Proxmox::guest(100);                // type and node detected

$vm->status()->isRunning();
$vm->start(); $vm->shutdown(timeout: 120, forceStop: true); $vm->stop();
$vm->reboot(); $vm->reset(); $vm->suspend(); $vm->resume();
$vm->config(); $vm->config(current: true);
$vm->migrate('pve2', online: true)->wait(timeout: 3600);
$vm->convertToTemplate();
$vm->destroy(purge: true);

Snapshots and backups

$vm->snapshot('before-upgrade', 'PHP 8.4 upgrade', withRam: false)->wait();
$vm->snapshots();                              // list<Snapshot>
$vm->rollback('before-upgrade', start: true)->wait();
$vm->deleteSnapshot('before-upgrade');

$vm->backup('pbs', mode: 'snapshot', compress: 'zstd', options: ['notes-template' => ''])->wait();
$vm->backups('pbs');                           // list<StorageVolume>
Proxmox::storage('pve1')->deleteVolume('pbs', $backup->volid);

Tasks (UPID)

$task = $vm->start();                          // Task
$upid = (string) $task;                        // store it, e.g. in a queued job

$status = Proxmox::task($upid)->wait(timeout: 600, interval: 2, onPoll: fn($s) => logger()->info($s->status));
$status->succeeded(); $status->exitStatus;     // "OK", "WARNINGS: 1" or the error message

Proxmox::task($upid)->log();                   // list<string>
Proxmox::tasks()->forNode('pve1', ['vmid' => 100, 'errors' => true]);
Proxmox::tasks()->recent();                    // cluster tasks
php artisan proxmox:task "UPID:pve1:000A1B2C:0123ABCD:6730A1B2:qmstart:100:root@pam:" --timeout=300

Nodes, cluster and storage

Proxmox::nodes()->list();                      // list<Node>
Proxmox::nodes()->status('pve1');
Proxmox::cluster()->resources('vm');           // list<ClusterResource>
Proxmox::cluster()->guests();
Proxmox::cluster()->isIdFree(150);
Proxmox::qemu('pve1')->list();                 // list<GuestStatus>
Proxmox::lxc('pve1')->create([
    'hostname' => 'ct1',
    'ostemplate' => 'local:vztmpl/debian-12-standard_12.7-1_amd64.tar.zst',
    'rootfs' => 'local-lvm:8',
    'net0' => 'name=eth0,bridge=vmbr0,ip=dhcp',
])->wait();
Proxmox::storage('pve1')->list('backup');      // list<Storage>
Proxmox::storage('pve1')->content('local', 'iso');

Access control

$token = Proxmox::access()->createToken('ci@pve', 'deploy', comment: 'CI', expiresAt: now()->addYear());
$token->value;                                 // shown only once, store it
Proxmox::access()->updateAcl('/vms/100', ['PVEVMUser'], tokens: [$token->fullTokenId]);
Proxmox::access()->can('/vms/100', 'VM.PowerMgmt');
Proxmox::access()->users();

Runtime clusters and anything else

Proxmox::using([
    'url' => $cluster->url,
    'token_id' => $cluster->token_id,
    'token_secret' => decrypt($cluster->token_secret),
])->vm(100)->status();

Proxmox::request('GET', '/cluster/ha/resources');
Proxmox::request('POST', '/nodes/pve1/qemu/100/agent/ping');

Exceptions

All exceptions extend Beziworld\Proxmox\Exceptions\ProxmoxException:

Exception When
AuthenticationException Token, ticket or login rejected (HTTP 401). A rejected login is never repeated.
PermissionDenied Missing privilege (HTTP 403)
ApiException Other error status; httpStatus(), errors() (per parameter), payload()
RateLimitException HTTP 429 from a proxy in front of the cluster; retryAfter()
ConnectionFailed DNS, TCP, TLS or timeout error (after read retries)
TaskFailed wait() saw an exit status other than OK; status() and the last log lines
TaskTimeout wait() gave up; the task keeps running (upid())
GuestNotFound VMID not in the cluster resources (or not visible to the token)
InvalidConfiguration Unknown connection, missing URL, credentials or node

Notes

  • Calls are synchronous and tasks such as clones, backups and migrations take minutes: run them in queued jobs and
    keep the UPID, or use wait() with a timeout that fits the job.
  • updateConfig() uses the asynchronous POST endpoint for VMs (needed for hotplug and disk allocation) and
    returns a task only when Proxmox started one.
  • Two-factor authentication is not supported for ticket logins: use an API token.

Development

composer install
composer ci   # pint --test, phpstan (level 8), pest

Author

Created and maintained by Kamil Ćwiertnia, beziworld.eu.

Need an integration? Get in touch through beziworld.eu.

Other packages by the author

License

MIT. See LICENSE.md. This package is not affiliated with, endorsed by or sponsored by Proxmox Server
Solutions GmbH. Proxmox is a registered trademark of Proxmox Server Solutions GmbH.

Packalyst :: Latest Packages

Demoted National Parks: 10 Nearly Forgotten Sites You Can Still Visit Today

https://i0.wp.com/s3.amazonaws.com/images.gearjunkie.com/uploads/2026/11/Untitled-Design-2026-11-09T114609.550.jpg?w=700&ssl=1

Wheeler Geological Area was once a national monument; (photo/John Fowler via Flickr Creative Commons

It’s hard to imagine Yellowstone or the Grand Canyon no longer being national parks, but, technically, it could happen. The government can demote national parks and reassign them to other land managers, and they’ve done it in the past. Many national parks and monuments have lost their elevated classification over the decades, for a multitude of reasons. Sometimes, after the fact, Congress decides the area isn’t important enough to merit a special designation. Other times, the sites just never receive visitors.

Even though these areas lost their special status, the public can still visit many of them and participate in a variety of outdoor activities. Here are some of the National Park Service (NPS) sites time forgot, and how to explore them today.

Former National Parks

Mackinac National Park

This island, located on Lake Huron in between Michigan’s Upper and Lower Peninsulas, became the country’s second-ever national park in 1875. It’s home to Fort Mackinac, the state’s oldest surviving military outpost, which served an important role in the War of 1812.

The NPS wasn’t created until 1916, so the Department of War managed the park. By the 1890s, the base had become militarily unnecessary, and the agency balked at the high cost of maintaining the park. Some in the department wanted to sell the land, but locals revolted, so in 1894 they handed it off to the state of Michigan, which created Mackinac Island State Park.

bikers on road by lake
Biking is a popular activity on the island; (phtoo/Shutterstock)

Visiting today: Mackinac Island has become a beloved summer tourist destination. Visitors flock to the island to enjoy its car-free atmosphere and lake views. The state owns around 80% of the island, preserving its historic character.

The 6.3-mile Tranquil Bluff Trail is one of the most scenic on the island, with clear vistas and excellent bird watching opportunities. The Island is known as the “fudge capital of the world,” and streets abound with vintage-style candy shops that can help fuel your hikes. To understand the island’s plant life, stroll the Botanical Trail, with signage that explains the unique flora here.

Platt National Park

The history of this part of Oklahoma dates back to 1902, when the government purchased 33 mineral springs from the Choctaw and Chickasaw Nations to create the Sulphur Springs Reservation. In 1906, Congress designated it a national park, and spent decades building infrastructure and visitor services. The area was popular because the springs here were one of the few ways to find relief during hot, sweltering summers.

lake with concrete walking path
Platt Historic District Veterans Lake; (photo/NPS/Victoria Stauffenberg)

By the 1960s, the conservation movement supported leaving wild spaces natural, as opposed to the heavy development that had occurred in Platt. Since the area was small and not home to impressive natural features like mountains or rivers Congress combined it with the nearby Arbuckle Recreation Area in 1976 to create the Chickasaw National Recreation Area.

Visiting today: Chickasaw National Recreation Area is still a popular destination, with over 1.8 million visitors in 2025. It can be crowded in the summer, so try visiting in the shoulder seasons (March to May, and September to October) instead. Entry is free.

Deciduous forests meet prairies to create a unique landscape. Hiking trails abound; the 1-mile Antelope Springs trail is perfect for a casual evening stroll by the water. Check out the 2-mile West Bison Pasture Loop for a chance to see the trail’s namesake animal.

There are six campgrounds throughout the park, which cost $20 to $30/night and can be reserved online. Fishing in the area’s creeks is a popular pastime; be sure to follow all Oklahoma state fishing regulations.

Hill National Park

Conservation icon Theodore Roosevelt created this national park in North Dakota in 1904. The area served as an important big-game preserve to save species like bison. Its importance in conservation eventually led President Herbert Hoover to make it a wildlife refuge and transfer it to the agency that would become the U.S. Fish & Wildlife Service (USFWS). In 2019, it was renamed the White Horse Hill National Game Preserve.

prairie dog poking out of a hole
(Photo/Shutterstock)

Visiting today: The refuge is open daily to visitors. No overnight stays are allowed. Slowly drive along a designated 4.5-mile car route for the chance to view bison, elk, and deer. There’s also a large prairie dog town near the visitors’ center that is a short walk away. The area is home to over 210 species of birds, so be sure to bring along your binoculars.

General Grant National Park

In many cases, former NPS sites get transferred to other agencies, but in this case, one park got subsumed into another. In 1890, right after the creation of Sequoia National Park, President Benjamin Harrison created nearby General Grant National Park to protect its giant Sequoias from logging. In 1940, the government created the much larger Kings Canyon National Park, which surrounded General Grant. It didn’t make sense to have one park encircled by another, so Kings Canyon took over the smaller park.

visitors nex to large tree
The General Grant tree dwarfs visitors; (photo/NPS/Rebecca Paterson)

Visiting today: The area, now known as General Grant’s Grove, is open to visitors to Kings Canyon. Park entry requires a $35 fee or an America the Beautiful Pass ($80).

The main highlight is the gigantic tree named after the Civil War hero. General Grant’s tree is the world’s second-largest tree by trunk volume. The larger area is home to many other impressive giant Sequoias, as well as meadows and a small waterfall. Combine the North Grove Loop and Dead Giant Trail for a 2.5-mile journey through the area that also provides views of Sequoia Lake.

Former National Monuments

Papago Saguaro National Monument

Before Saguaro National Park existed, there was Papago Saguaro National Monument. Under the 1906 Antiquities Act, a president can declare a national monument with a stroke of a pen, and President Woodrow Wilson did just that in 1914. The land, which the local Maricopa and Pima Tribes once held, was home to distinct red sandstone rock formations and fields of the namesake cacti. The monument, however, quickly fell into disarray, with inadequate funding for upkeep. By 1930, the government had had enough, and passed the land over to the state.

red sandstone formation
Papago park today; (photo/Vicki Rogers via Flickr Creative Commons)

Visiting today: Papago Park has become a popular outdoor recreation destination for the residents of Phoenix and Tempe. It’s a great spot for a post-work hike; popular trails include the 2.3-mile Double Butte Loop and 2.7-mile Elliot Ramada Loop. Other must-visit attractions inside the park include the Phoenix Zoo and the Desert Botanical Garden.

Lewis & Clark Caverns National Monument

Local deer hunters first noticed this series of caves in Jefferson County, Montana, in 1898. Then, in 1911, President Howard Taft declared the impressive caverns a national monument. During the Great Depression, the Civilian Conservation Corps built much of the infrastructure and tunnels that allowed visitors to tour the caves. In 1937, Congress directed the Secretary of the Interior to hand over the land to the state, because the land did not possess enough “national significance.” It then became Montana’s first state park.

underground cavern with rock formations
Lewis & Clark Caverns State Park; (photo/Troy Smith via Flickr Creative Commons)

Visiting today: Located less than an hour from Bozeman, Lewis & Clark Caverns State Park is a great add-on stop for folks visiting Yellowstone National Park. Be sure to book a guided tour in advance, since it’s the only way to tour the massive limestone caves. Above ground, other popular activities include hiking and biking trails, fishing and canoeing on the Jefferson River, and birdwatching. There’s also campsites and cabins available for reservation online. The best time to visit is May through September.

Father Millet Cross National Monument

The nation’s smallest national monument was also one of its most short-lived. In the late 1600s, a group of French colonists endured a harrowing winter at a fort near Niagara Falls, where many died of starvation. In 1688, Father Pierre Millet, a missionary, had a cross erected there to remember the dead. In 1925, President Coolidge ordered a new cross built on the same site, and declared the 18-square-foot portion of land a national monument.

In 1949, Congress declared the tiny plot “extraneous,” and handed it over to New York as part of Fort Niagara State Park and Old Fort Niagara State Historic Site.

group of historic reenactors at fort site
A historic reenactment; (photo/gardener41 via Flickr Creative Commons)

Visiting today: The Father Millet Cross is just one of many pieces of history visitors to the state park can learn about. The French first established Fort Niagara in 1679, and it served as an important military outpost during the French & Indian War and the War of 1812. It served as an active military outpost until 1963, and visitors can tour the grounds and learn from historical interpreters and reenactors. Admission to the historic site costs $17 per adult, while admission to the larger state park costs $8 per vehicle.

Wheeler National Monument

Unique geology is sometimes the reason behind an area’s elevation to national monument status, and Wheeler National Monument is a prime example. Located in the San Juan Mountains in southern Colorado, eruptions from super volcanoes millions of years ago produced to unusual rock and tufa formations, spires, and needles. President Roosevelt signed its special status into law in 1908. The U.S. Forest Service (USFS) managed it until 1933, when the NPS took over. In 1950, Congress demoted it, and passed it back to the USFS. The area was extremely remote and difficult to access, and thus attracted very few visitors.

unusual rock formations and spires
(Photo/John Fowler via Flickr Creative Commons)

Visiting today: Wheeler Geological Area is now part of the La Garita Wilderness in the Rio Grande National Forest. Getting there involves a 7-mile hike or a rough 14-mile off-road drive. The USFS advises visitors to devote a full, long day to the trip.

For those considering driving, be prepared. “The road is extremely rough with deep ruts, narrow turns, and some steep hills. High-clearance 4×4 vehicles or ATVs are recommended. This road is not recommended for travel during monsoonal storms,” USFS warns.

Camping is not allowed among the formations, but you can disperse camp nearby for free at Hansen Mill site and at the end of Wheeler Road #600. If you’re looking for a unique, remote weekend backpacking trip, Wheeler deserves to be on your list.

Holy Cross National Monument

Mount of the Holy Cross, a 14er located in the Sawatch Range of the Rocky Mountains in Colorado, got its name for the distinctive cross-shaped snowfield on its face. President Hoover made it a national monument in 1929 in order to protect it. Unsurprisingly, given its remote location and high elevation, it didn’t bring in many visitors. In 1950, Congress handed it over to the Forest Service, and in 1980, it became a designated wilderness area.

mountain with snow
(Photo/Orion Wiseman via Flickr Creative Commons)

Visiting today: The climb up this 14,007-foot peak starts at the Half Moon Pass trailhead (10,320 feet). The 11.25-mile round-trip journey is strenuous, with over 8,000 feet of elevation gain. Weather can quickly turn for the worse, so be prepared with adequate layers and protection. The road to the trailhead is closed annually from May 1 to June 21, and its reopening date depends on when it’s cleared of snow.

Old Kasaan National Monument

National monuments often serve to protect important cultural or historic sites, and that was President Wilson’s intention when he created Old Kasaan National Monument in Alaska in 1916. The area on Prince of Wales Island was formerly a major settlement for the Haida, an Native American tribe in Alaska and Canada whose history there spanned thousands of years. Despite its monument status, Old Kasaan fell into neglect, with no resources spent on restoration.

In 1955, Congress transferred it to the USFS, which manages it as part of Tongass National Forest.

foggy mountain with wooden planks in ground
The island is quite remote; (photo/Cori Jessy via Flickr Creative Commons)

Visiting today: The Organized Village of Kasaan, run by the tribal government, offers guided tours of the Totem Pole Park and Náay I’waans Whale House. The village also owns and operates two cabins for rent located near the forest, with views of the ocean.

GearJunkie