Skip to content

Instantly share code, notes, and snippets.

View joschan21's full-sized avatar

Joscha Neske joschan21

View GitHub Profile
@joschan21
joschan21 / bench.mjs
Created May 20, 2026 10:19
A demo benchmark between Redis Cloud and Upstash Redis, as published on https://www.xadd.dev/comparison/upstash-vs-redis-cloud-a-2026-comparison
import Redis from "ioredis";
import { readFileSync } from "node:fs";
import { execSync } from "node:child_process";
import { hostname } from "node:os";
// Configure via env vars:
// UPSTASH_REDIS_TLS_URL=rediss://default:<token>@<host>:<port>
// REDIS_CLOUD_TLS_URL=rediss://default:<password>@<host>:<port>
// REDIS_CLOUD_CA_FILE=./redis_ca.pem (optional, defaults to ./redis_ca.pem)
const TARGETS = [
import { Client } from "@upstash/qstash"
import { NextRequest } from "next/server"
const baseUrl = process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL
? `https://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`
: "http://localhost:3000"
interface Step<I> {
create: <O>(action: (prevResult: Awaited<I>) => O) => Step<O>
finally: (action: (prevResult: Awaited<I>) => any) => any
// Chart.tsx example
'use client'
import { AreaChart, Card, Title } from '@tremor/react'
const generateData = () => {
let dataset = []
const dates = [
'Jun 30',
// page.tsx
import PaginationControls from '@/components/PaginationControls'
import Image from 'next/image'
const data = [
'entry 1',
'entry 2',
'entry 3',
'entry 4',