niledatabase
repository·main·Indexed 22 days ago
https://github.com/niledatabase/niledatabaseA tenant-aware, serverless, and globally distributed Postgres platform designed for B2B applications. It features decoupled storage and compute, tenant virtualization, and built-in support for multi-tenancy and AI vector embeddings.
What's inside niledatabase
- Nile provides documentation to help developers understand Postgres and common relational database concepts. This includes learning basic data structures, operations, tools, and best practices for working with Postgres within the Nile ecosystem. Key topics covered include table management, data types, indexing, joins, views, and the Postgres ecosystem tools.
Overview of SupplyAI Use Case
mainSupplyAI is a Supply Chain Management (SCM) application designed to streamline procurement, shipping, and sales. It provides end-to-end visibility and incorporates AI features to optimize costs, manage delays, and suggest new vendors or strategies.
Key capabilities include:
- Order Management: Placing and tracking orders from global vendors.
- Shipping Management: Choosing shipment options and tracking progress via fulfillment services (e.g., FedEx, UPS).
- Sales Integration: Managing sales through channels like Amazon or Shopify.
- AI-Powered Insights: Optimizing shipping costs, answering queries about shipment delays, and proposing cost-reduction strategies.
Overview of Nile Auth for B2B Applications
mainNile Auth is an open-source B2B authentication solution designed specifically for multi-tenant applications. Unlike traditional auth providers that store user data in isolated third-party APIs, Nile Auth stores user and customer data directly in your Nile Postgres database. This allows for seamless SQL joins between user data and your application's business tables using standard foreign key constraints.
Key features include:
- Multi-tenancy support: Built-in management for the entire tenant lifecycle (invitations, tenant-specific settings, domains, etc.).
- Data Ownership: User and organization data reside in your primary database, avoiding synchronization issues and consistency delays.
- Scalability: Supports unlimited active users; you only pay for the underlying PostgreSQL database.
- Security: Uses server-side authentication with Secure, HttpOnly cookies, CSRF protection, and session-backed authentication.
- Deployment Flexibility: You can use the managed cloud version or self-host the auth service.
Overview of Nile components
mainNile is a Postgres platform designed specifically for multi-tenant B2B applications. Its core components include:
- Multi-tenant Postgres: A re-engineered Postgres engine optimized for B2B workloads.
- Tenant Virtualization: Provides isolation and management for individual customer/organization data.
- Nile Auth: A drop-in B2B authentication solution that stores customer data directly within your Nile Postgres instance.
- AI Toolkit & Vector Database: A massively scalable vector database supporting customer-specific vector embeddings.
Introduction to Nile
mainNile is a PostgreSQL-based database re-engineered specifically for multi-tenant B2B applications. It provides built-in tenant virtualization, allowing developers to scale to millions of customers and billions of vector embeddings without managing complex Row Level Security (RLS) or manual permission logic in the application layer.
Key capabilities include:
- Tenant Virtualization: Built-in isolation for data and vector embeddings.
- AI-Native Features: Vector embedding with RAG support that auto-scales across customers.
- Managed Multi-tenancy: Single database usage with tenant-level backups, schema management, and customer insights.
- Flexible Scaling: Seamless autoscaling (including scaling to zero with no cold start) and the ability to place specific tenants on dedicated compute or in different regions for compliance and latency requirements.
Overview of the IP4R extension
mainThe
ip4rextension provides specialized data types and functions for working with IPv4 and IPv6 addresses and ranges. It is designed for network-related applications such as IP-based access control, geolocation services, and network range analysis.Note: The
ip4rextension is enabled by default in Nile databases.Getting started with pgvector in Nile
mainNile supports the
pgvectorextension (version0.8.0) out of the box. This extension allows you to store and perform vector operations directly within your PostgreSQL database alongside your other data. It provides ACID compliance, point-in-time recovery, and seamless integration with Nile's multi-tenant isolation, sharding, and placement rules.Key capabilities include:
- Exact and approximate nearest neighbor search (using HNSW or IVFFlat indexes).
- Support for single-precision, half-precision, binary, and sparse vectors.
- Multiple distance metrics: L2, inner product, cosine, L1, Hamming, and Jaccard.
Use the `prefix` extension for efficient prefix search
mainThe
prefixextension provides efficient prefix (starts-with) search functionality in PostgreSQL. It is particularly useful for implementing autocomplete, prefix-based filtering, and telephony applications (e.g., matching phone numbers to carrier prefixes, determining routing paths, or calculating costs).Your Nile database arrives with the
prefixextension already enabled.Use the Quantile extension for statistical analysis
mainThe
quantileextension provides efficient computation of quantiles and percentiles in PostgreSQL. It is useful for statistical analysis, performance monitoring, and understanding data distributions.Note: On Nile, the
quantileextension is already enabled by default; no manual installation is required.Available Nile SDK Modules
mainThe Nile JavaScript SDK provides several specialized modules for interacting with the Nile service. Depending on your requirements, you can use these modules to manage authentication, database operations, users, tenants, and routing:
- Auth: Securely authenticating users.
- DB: Tenant-aware querying of your database.
- Users: Managing user profiles and identities.
- Tenants: Managing tenant entities and multi-tenant structures.
- Routes: Utilizing built-in or custom routes.
Use the Xicor extension for incremental correlation
mainThexicorextension is pre-enabled in your Nile database. It provides the Xi correlation coefficient, which is a robust measure of correlation designed to handle non-linear and monotonic relationships better than traditional Pearson correlation. It returns values between0(no correlation) and1(perfect monotonic correlation).PostgreSQL 18 New Features Overview
mainPostgreSQL 18 introduces several significant performance and functional improvements, including:
- Async I/O (with io_uring): Provides 2-3x speedups on sequential scans and vacuums.
- UUIDv7 Support: Native functions for generating and extracting data from UUIDv7.
- Skip scan: Optimization for multi-column B-tree indexes and smarter OR/IN optimizations.
- Virtual generated columns.
- Enhanced EXPLAIN ANALYZE: Now displays I/O, CPU, and WAL metrics.
- New Wire Protocol: Version 3.2.
- Temporal constraints and casefolding for
LIKEon nondeterministic collation. - OAuth login support.