Zedis Documentation

repository·main·Indexed 23 days ago

https://github.com/vicanso/zedis

A high-performance, native Redis GUI built with Rust and the GPUI rendering engine. Zedis is designed to handle millions of keys at 60+ FPS with low memory usage, featuring a smart data viewer for various formats (JSON, Protobuf, MessagePack), real-time observability metrics, and support for TLS/SSL, SSH tunnels, Cluster, and Sentinel. The project includes specialized crates such as zedis-core for shared logic, zedis-db for local storage, and zedis-connection for Redis ACL management.

Tokens
37.6K
Snippets
41
Records
253
Agent score
84%

What's inside Zedis

  1. Overview of zedis-core

    main
    zedis-core is a GUI-free, pure logic crate shared by the Zedis project. It provides essential utility functions and logic components without any UI dependencies (no gpui) or internationalization (i18n) overhead. It is designed to be used as a foundational logic layer for other Zedis components or standalone tools requiring its specific utility sets.
  2. Overview of zedis-db

    main
    The zedis-db crate serves as the local storage layer for Zedis. It provides redb-backed managers for managing various data types including tags, favorites, history, trash, and scripts. It also handles proto descriptors and defines its own specialized error type for database operations.
  3. Overview of Zedis features

    main

    Zedis is a native, GPU-accelerated Redis GUI built with Rust and GPUI. Key capabilities include:

    Data Management & Viewing

    • Smart Data Viewer: Auto-decompresses (LZ4, Snappy, GZIP, ZSTD) and decodes JSON/JSONPath, Protobuf, MessagePack, timestamps, images, and hex.
    • Type-Specific Viewers: Specialized views for Bitmap, HyperLogLog, Vector Set (KNN), Geo maps, Bloom/Cuckoo/Count-Min/Top-K filters, Time Series, Streams (live-tail), Pub/Sub, RediSearch, and Functions.
    • Key Operations: Namespace tree with TTL chips, tags, notes, favorites, field-level TTL, version history, and a local recycle bin (24h retention).

    Observability & Performance

    • Real-time Metrics: Live GPU-accelerated charts for CPU, memory, and network with 7-day history.
    • Analysis Tools: Memory analyzer with AI-driven recommendations, Slow Log ↔ Latency correlation, and MONITOR support.
    • High Performance: Uses virtual-scrolled SCAN to handle millions of keys at 60+ FPS with a minimal memory footprint.

    Connectivity & Productivity

    • Protocols: Supports TLS/SSL, SSH tunnels (including passphrase-protected keys), Cluster, and Sentinel.
    • Power User Tools: ⌘K command palette, ⌘⇧F multi-database key search, redis-cli with completion, and multi-line batch mode.
  4. Capabilities and utilities provided by zedis-core

    main

    The zedis-core crate provides the following core logic and utility modules:

    • Capability Permission Matrix: Logic for managing and evaluating permissions.
    • Fuzzy Matching: Algorithms for fuzzy string matching.
    • Data Helpers: Utilities for handling Hex, CSV, and Diff formats.
    • JSONPath Utilities: Tools for querying and navigating JSON data.
    • TTL Formatting: Logic for formatting Time-To-Live durations.
    • System Helpers: Utilities for interacting with the filesystem and environment variables.
  5. Manage a Lua Script Library

    main

    Zedis includes a local library to save, reuse, and manage Lua scripts independently of server-side Redis Functions.

    Features:

    • Execution: One-click EVALSHA-first execution for performance.
    • Templates: Includes starter templates for new scripts.
    • Defaults: Save KEYS and ARGS defaults for quick re-runs.
    • Cache Monitoring: Tracks lifetime hit/miss counters to help identify if scripts are being evicted from the Redis cache.
    • Cache Control:
      • Warm: Uses SCRIPT LOAD to pre-load a script without executing it.
      • Flush: Provides a guarded SCRIPT FLUSH operation.
    • Portability: Supports library import and export.
  6. How the decoding pipeline works

    main

    Zedis uses a deterministic decoding pipeline to format string values. When ViewerMode::Auto is active, every string value passes through the same pipeline. The priority is as follows (highest to lowest):

    1. Protobuf Viewer: Matches the key against registered .proto schemas.
    2. Custom Script Viewer: Matches the key against user-configured shell scripts.
    3. Native Format Detection: Automatically detects MessagePack, GZIP, ZSTD, Snappy, Unix timestamps, or images (PNG/JPG/WEBP/SVG/GIF).
    4. LZ4: Specifically for non-UTF-8 data with a length prefix.
    5. Text / Beautified JSON: The fallback for standard text or JSON.

    If a viewer matches but decoding fails, Zedis falls back to native processing. Manual switching to hex view always shows raw bytes.

  7. How the Smart Data Viewer decode pipeline works

    main

    Zedis uses a deterministic decode pipeline to format payload values. When a value is viewed, it passes through the following stages in order. The first viewer to successfully decode the value wins. If a viewer matches a key but fails to decode, the pipeline falls through to the next stage.

    Decode Order:

    1. Protobuf viewer: Uses a registered .proto schema matched to the key.
    2. Custom script viewer: Uses a configured external shell command.
    3. Native format detection: Automatically detects MessagePack, GZIP, ZSTD, Snappy, Unix timestamps, or images (PNG/JPG/WEBP/SVG/GIF).
    4. LZ4: Specifically for non-UTF-8 payloads with size-prepending.
    5. Text / JSON fallback: Pretty-printed JSON or plain text.

    Manual Overrides:

    • The hex view always displays the raw bytes.
    • Small opaque strings provide a bitmap toggle.
  8. Search for keys by value content

    main

    Since Redis does not index values, Zedis performs a sampled scan to find keys containing specific text. To prevent performance impact, the following 'guardrails' are enforced:

    • A key prefix must be provided.
    • A limit of 10,000 keys or 10 seconds is enforced (can be canceled).
    • Values larger than 1 MiB are skipped.

    This search covers String values, Hash fields, and List/Set/ZSet members.

  9. Use JSONPath for searching values

    main
    Zedis supports JSONPath queries (e.g., $.user.email or $.items[?(@.price > 100)]) to navigate and filter data. This functionality works on plain string keys without requiring a specific module, making it highly versatile for inspecting JSON-formatted strings stored in Redis.
  10. Understand the Zedis website structure and layout

    main

    The Zedis website is a static site with the following structure:

    • index.html: English landing page (includes logic to redirect zh* paths to the Chinese version).
    • zh/index.html: Chinese landing page.
    • styles.css: Shared CSS styles.
    • images/*.png: Local screenshot assets.
    • FEATURES.md / FEATURES_zh.md: Detailed feature documentation linked from the site.

    Language Preference: The site uses localStorage with the key zedis-lang to store the user's language choice (en or zh) when they interact with the language switcher.

  11. Use specialized viewers for complex data types

    main

    Zedis provides interactive, dedicated viewers for non-opaque data types:

    • Bitmaps/Bitfields: Visualizes bits on a GPU grid (supports SETBIT, BITCOUNT, BITFIELD).
    • HyperLogLog: Displays cardinality via PFCOUNT.
    • Vector Sets + KNN (Redis 8): Traverses HNSW graphs via VSIM.
    • Geospatial: Renders sorted sets on a radar map (supports GEOSEARCH).
    • Probabilistic Types: Dedicated cards for RedisBloom (Bloom, Cuckoo, Count-Min, Top-K, t-digest).
    • Time Series: Visualizes TS.INFO and TS.RANGE data via charts.
  12. How Zedis handles connection security and secrets

    main

    Zedis follows a privacy-first approach to security:

    • Secret Storage: Passwords and SSH keys are encrypted using a random per-machine key.
      • macOS: Uses the macOS Keychain.
      • Windows: Uses the Windows Credential Manager.
      • Linux: Uses a 0600-permission key file located under the config directory (no dependency on Secret Service or D-Bus).
    • Portability: Because secrets are tied to a per-machine key, a standard config copy will not decrypt on a different machine. To move connections between machines, use the passphrase-protected export feature.
    • Safety: Destructive actions in production environments trigger escalated confirmation prompts. You can also enable a read-only lock.