<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: sriramsub</title>
    <description>The latest articles on DEV Community by sriramsub (@sriramsub).</description>
    <link>https://dev.to/sriramsub</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F794061%2F4e36c8a3-7951-4ba6-b0b2-f777ba1e9d0a.jpeg</url>
      <title>DEV Community: sriramsub</title>
      <link>https://dev.to/sriramsub</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sriramsub"/>
    <language>en</language>
    <item>
      <title>🚀 We just shipped Nile-Auth v4.0: Account Linking, CORS Support, and More</title>
      <dc:creator>sriramsub</dc:creator>
      <pubDate>Fri, 11 Apr 2025 19:28:07 +0000</pubDate>
      <link>https://dev.to/sriramsub/we-just-shipped-nile-auth-v40-account-linking-cors-support-and-more-1ci6</link>
      <guid>https://dev.to/sriramsub/we-just-shipped-nile-auth-v40-account-linking-cors-support-and-more-1ci6</guid>
      <description>&lt;p&gt;We just released a major update to &lt;a href="https://github.com/niledatabase/nile-auth" rel="noopener noreferrer"&gt;Nile-Auth&lt;/a&gt;, an open-source authentication service for B2B apps.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.thenile.dev/docs/auth/quickstart" rel="noopener noreferrer"&gt;Try it out&lt;/a&gt; and let us know&lt;/p&gt;

&lt;h3&gt;
  
  
  🆕 What’s New in v4.0:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Account Linking&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Users can now authenticate with multiple providers (e.g., GitHub + Google) under one identity.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Cross-Origin Request Support&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Auth now works across frontends/backends on different domains or hosts.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Configurable Routes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Define and customize your auth flow endpoints.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Tailwind V4&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Updated styles for our prebuilt auth UI components.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;New JavaScript SDK Docs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.thenile.dev/docs/auth/sdk-reference/nile-js/overview" rel="noopener noreferrer"&gt;SDK Reference&lt;/a&gt; is clearer, more complete, and easier to follow.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Tons of New Examples&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We’ve added &lt;a href="https://www.thenile.dev/docs/auth/examples" rel="noopener noreferrer"&gt;auth workflow examples&lt;/a&gt; to help you implement common scenarios fast.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📜 &lt;strong&gt;Full Release Notes:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/niledatabase/nile-js/releases/tag/v4.0.0" rel="noopener noreferrer"&gt;https://github.com/niledatabase/nile-js/releases/tag/v4.0.0&lt;/a&gt;&lt;/p&gt;

</description>
      <category>b2b</category>
      <category>postgres</category>
      <category>authjs</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>Introducing Nile Auth for B2B apps</title>
      <dc:creator>sriramsub</dc:creator>
      <pubDate>Fri, 28 Mar 2025 13:55:10 +0000</pubDate>
      <link>https://dev.to/sriramsub/introducing-nile-auth-for-b2b-apps-5jm</link>
      <guid>https://dev.to/sriramsub/introducing-nile-auth-for-b2b-apps-5jm</guid>
      <description>&lt;p&gt;Today, we are excited to introduce &lt;a href="https://github.com/niledatabase/nile-auth" rel="noopener noreferrer"&gt;Nile Auth&lt;/a&gt;, a comprehensive B2B authentication solution explicitly designed for multi-tenant applications. Nile Auth is fully open source and built on top of Nile’s Postgres. It allows you to store user and customer data in your Postgres database, giving you complete control over your information. You can choose to self-host Nile Auth or utilize our cloud version.&lt;/p&gt;

&lt;p&gt;Integrating authentication into your B2B application on the front and back end takes just a few minutes with Nile Auth’s B2B authentication features and customizable UI components. If you choose the hosted version, you can enjoy unlimited active users for authentication at no additional cost; you only pay for the database.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://console.thenile.dev/" rel="noopener noreferrer"&gt;Try it out today&lt;/a&gt; and effortlessly &lt;a href="http://thenile.dev/docs/auth/introduction" rel="noopener noreferrer"&gt;add authentication&lt;/a&gt; to your B2B app in just a few minutes!&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding B2B Auth to your app in 2 minutes
&lt;/h2&gt;

&lt;p&gt;Before I explain the principles behind Nile Auth, let's examine how easy it is to integrate it into your B2B app.&lt;br&gt;
Install the Nile SDK that will handle the authentication logic for you.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F65caaq7fl05smvurjjwu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F65caaq7fl05smvurjjwu.png" alt="Install Nile"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will create a NextJS app with an app router and integrate Nile Auth.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F182brn5bkpf5y501orp0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F182brn5bkpf5y501orp0.png" alt="Create Next App"&gt;&lt;/a&gt;&lt;br&gt;
Create two files{" "}&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;'nile.ts' will expose the nile instance to the rest of the app.&lt;/li&gt;
&lt;li&gt;'route.ts' handles the calls to Nile on the server side.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9045kkc58pe8q4ejco49.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9045kkc58pe8q4ejco49.png" alt="Set Routes"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your application will interact with the above authentication routes using SDK components. Replace the boilerplate app/page.tsx with the following code that adds signup, sign-post out, tenant selector, and user info components to your app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr881u8ufp1gw6lf418a9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr881u8ufp1gw6lf418a9.png" alt="Components"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc6gv4tfxewi0u93t8rbf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc6gv4tfxewi0u93t8rbf.png" alt="More Components"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With just these lines of code, you have a fully functional authentication system for your B2B app.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why Nile Auth?
&lt;/h2&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/RaBjmU7tlfs"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Purpose-built for multi-tenant apps
&lt;/h3&gt;

&lt;p&gt;Nile re-engineers Postgres to make it easy to build and scale B2B apps. Our Auth product is also designed from the ground up to support multi-tenant applications on top of Nile's Postgres.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyjb1mm5z3eky0l53x9s1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyjb1mm5z3eky0l53x9s1.png" alt="Tenant component"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Auth solutions usually don’t support B2B apps, or the focus is not full-time. In Nile’s Auth case, we have designed the product for only B2B apps. Nile Auth will support the entire tenant lifecycle, including managing tenants, inviting users to tenants, overriding tenant-specific settings, tenant domains, and more.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq6nrdbeaka2cytrq9un2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq6nrdbeaka2cytrq9un2.png" alt="Tenant api"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Authenticated users can access data from any tenant they have access to - this access control is enforced at all layers - from the browser to the authentication service to the database itself. All authentication features can be enabled at the application level or disabled for a specific tenant.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhfvhtctrdhu5sbflco0q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhfvhtctrdhu5sbflco0q.png" alt="Tenant sql"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Unlimited active users
&lt;/h3&gt;

&lt;p&gt;One of our key focuses in developing Nile Auth was to offer the ability to support unlimited active users. Traditionally, authentication providers set a fixed limit on the number of active users, often requiring additional payments as you scale up. However, with Nile Auth, there are no extra charges for active users. You will only pay for the PostgreSQL database, allowing you to store and scale to an unlimited number of active users without incurring additional costs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fww3xq29sj4kjtqud504f.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fww3xq29sj4kjtqud504f.gif" alt="counter"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Customer and user data stored in your DB
&lt;/h3&gt;

&lt;p&gt;One of the challenges we have faced with third-party auth providers is that user and customer data are locked in behind third-party APIs. There are a few issues with this approach&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Referencing and joining user data with other tables in your database. It gets hard to refer to the user data using foreign key constraints or SQL joins to query across user and other business tables.&lt;/li&gt;
&lt;li&gt;The synchronization process is async and poses consistency challenges. You could synchronize using a webhook or capture events into a changelog and apply them to the primary DB. Both approaches eventually create consistency problems. If other tables reference your application's customer or user data, users will face weird delays or could even lose data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While Nile Postgres will integrate with third-party auth providers as well, we believe the ideal approach is to just have the Auth solution store the data in the primary DB.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgcnpesc3tgkhijgfvk9i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgcnpesc3tgkhijgfvk9i.png" alt="store in db"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are also other benefits of building Nile Auth on Nile’s Postgres. Tenant management is not just an Auth problem. It is a data problem. Nile’s Postgres has taken a first principles approach to solving multi-tenant problems by isolating tenant data, addressing noisy neighbor problems, providing usage and cost insights by tenants, placing tenants on different compute types and regions, and supporting all the DB operations at the tenant level. Using Nile Auth and Nile’s Postgres provides a truly end-to-end solution to building and scaling B2B apps.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs2hb7i5qses5twzljc2x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs2hb7i5qses5twzljc2x.png" alt="db tables"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqjezu1ubn76qy16qgrlu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqjezu1ubn76qy16qgrlu.png" alt="more tables"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Comprehensive B2B auth features
&lt;/h3&gt;

&lt;p&gt;Access a full suite of authentication features to secure your application thoroughly. Here are some of the features you get out of the box:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Organization management&lt;/li&gt;
&lt;li&gt;User profiles&lt;/li&gt;
&lt;li&gt;Dashboard for managing users and organizations&lt;/li&gt;
&lt;li&gt;Tenant overrides - manage auth for each tenant individually&lt;/li&gt;
&lt;li&gt;Multi-framework support - NextJS, Express, React, etc&lt;/li&gt;
&lt;li&gt;Wide range of authentication methods - email/password, social login, magic link, etc&lt;/li&gt;
&lt;li&gt;UI components for embedding in your application - simple, beautiful, and flexible&lt;/li&gt;
&lt;li&gt;Cookie-Based Authentication: Secure session management using HTTP-only cookies&lt;/li&gt;
&lt;li&gt;JWT and Session Support: Uses cookies to maintain user sessions and optionally issues JWTs for client-side validation&lt;/li&gt;
&lt;li&gt;Single Sign-On (SSO) Support: Optional integration with external identity providers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Auth services really have to be comprehensive. Unlike other parts of the app where mixing and matching libraries and services is normal, mixing and matching two auth solutions is very challenging from a security POV - you need to keep them in sync, you need to make sure you correctly handle responses from two services, juggle multiple cookies and tokens (possibly with different expirations). Much safer to find one auth service that does everything you need and use that.&lt;/p&gt;

&lt;p&gt;There is more on the roadmap, and our goal is to support a comprehensive list of features for B2B apps. We would &lt;a href="https://github.com/orgs/niledatabase/discussions?discussions_q=is%3Aopen+label%3Aauth" rel="noopener noreferrer"&gt;love to know&lt;/a&gt; if you need any specific features not currently available. We also welcome community contributions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fakly8z558gx1zsiamds4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fakly8z558gx1zsiamds4.png" alt="session"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Self-host or let Nile manage it&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;One of our design goals was to make it easy to self-host Nile Auth. We believe we have made it easy for developers to use our managed solution or self-host the auth service. The auth service will still use hosted Nile’s Postgres, but one can get the benefit of running core security logic within their account in the cloud. For development purposes, the entire Nile stack, including Postgres and Nile Auth, is available as a &lt;a href="https://www.thenile.dev/docs/getting-started/postgres_testing" rel="noopener noreferrer"&gt;docker image&lt;/a&gt;. Developers can test locally and use the hosted offering when deploying to production.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fobfaeh4x888bhkqrg7o4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fobfaeh4x888bhkqrg7o4.png" alt="self host"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Drop-in fully customizable auth UI modules
&lt;/h3&gt;

&lt;p&gt;Easily integrate pre-built authentication UI modules into your application in five minutes. Add support for Google, GitHub, and more and override per-tenant. Nile’s open-source SDK includes beautiful and flexible React components that can be embedded in your application and customized to your liking. This includes the signup, login, organization switcher, user profile, social login buttons, and more.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7mgu1l1kpti8b2crrbbt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7mgu1l1kpti8b2crrbbt.png" alt="ui components"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9jseyyfpqqf1z7sgk0ot.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9jseyyfpqqf1z7sgk0ot.png" alt="more ui components"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Other design principles of Nile Auth
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Support multiple languages
&lt;/h3&gt;

&lt;p&gt;To truly democratize B2B authentication, we wanted to build a solution that can be leveraged with as many languages as possible. We currently support the Typescript/Javascript ecosystem but plan to support more languages. We have published our &lt;a href="http://thenile.dev/auth/api-reference/auth/sign-in-to-the-application" rel="noopener noreferrer"&gt;public Auth APIs&lt;/a&gt; and hope to provide more language coverage. We would also love the community to build and contribute SDKs for their favorite language.&lt;/p&gt;

&lt;h3&gt;
  
  
  Auth as a service vs a library
&lt;/h3&gt;

&lt;p&gt;Auth solutions have been tackled as a service and as a library. Based on our experience, a service-first approach is the most secure solution for B2B Authentication for several reasons.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Libraries are convenient till the new CISO in a B2B company mandates that auth has to be moved to a service for security reasons. Having the auth logic across many services is usually not what CISOs want. Security teams prefer to control the authentication logic centrally.&lt;/li&gt;
&lt;li&gt;Security hotfixes are a nightmare with thick clients. When a security hole is identified, it becomes critical for B2B companies to deploy the fix immediately. It is much easier to hotfix the central service vs upgrading the library in multiple services.&lt;/li&gt;
&lt;li&gt;In most cases, B2B Companies need to support multiple languages from the start. For example, companies build their data plane with Typescript but their control plane using Go. Users will authenticate against both the control plane and the data plane.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We have invested in making it easy to launch and operate the Nile Auth service.&lt;/p&gt;

&lt;h3&gt;
  
  
  Server side authentication
&lt;/h3&gt;

&lt;p&gt;Server-side authentication is a core design principle of Nile Auth, ensuring flexibility, security, and broad applicability. By focusing on server-side APIs and auto-generated routes, developers can build their own UI without being locked into a specific framework. This approach also enables authentication for API-only services, ensuring secure endpoint protection. Additionally, Nile Auth is built on strong security primitives, including Secure, HttpOnly cookies to prevent XSS, CSRF protection, and session-backed authentication instead of relying solely on JWTs. This aligns with best security practices, addressing concerns like those raised by CISOs who prioritize moving authentication logic to the backend for consistency and security across web, API, and CLI environment&lt;/p&gt;

&lt;h3&gt;
  
  
  Open source
&lt;/h3&gt;

&lt;p&gt;We have spent years doing open-source and believe this is the right path for Nile Auth. Open source will help build trust and make Nile Auth extremely secure. It raises the bar to build a world-class service and enables the community to contribute. We want to build a developer-first community around Nile Auth and make it easy to contribute. You can look at our &lt;a href="https://github.com/niledatabase/nile-auth/blob/main/CONTRIBUTING.md" rel="noopener noreferrer"&gt;contributing guidelines&lt;/a&gt; if you are interested in adding features or fixing issues.&lt;/p&gt;

&lt;p&gt;Try out &lt;a href="https://console.thenile.dev/" rel="noopener noreferrer"&gt;Nile Auth today&lt;/a&gt; and let us know what you think! You can also &lt;a href="https://discord.com/invite/8UuBB84tTy" rel="noopener noreferrer"&gt;join our community&lt;/a&gt; to discuss Nile Auth and give us feedback. We are looking forward to collaborating with the community to make this successful.&lt;/p&gt;

</description>
      <category>b2b</category>
      <category>postgres</category>
      <category>authjs</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>PostgreSQL re-engineered for multi-tenant apps</title>
      <dc:creator>sriramsub</dc:creator>
      <pubDate>Tue, 24 Sep 2024 07:30:24 +0000</pubDate>
      <link>https://dev.to/sriramsub/it-is-time-for-postgres-to-care-about-customers-489n</link>
      <guid>https://dev.to/sriramsub/it-is-time-for-postgres-to-care-about-customers-489n</guid>
      <description>&lt;p&gt;This is my first post on dev.to. We recently launched a new Postgres offering, and I wanted to share it here. Nile is a Postgres platform that decouples storage from compute, virtualizes tenants, and supports vertical and horizontal scaling globally to ship AI-native B2B applications fast while being safe with limitless scale. Nile is in public preview, and we look forward to all the feedback as we move towards GA. &lt;a href="https://www.thenile.dev/" rel="noopener noreferrer"&gt;Sign up to Nile&lt;/a&gt; and try our quickstarts, or use one of our numerous AI examples or use cases.&lt;/p&gt;

&lt;p&gt;Nile’s goal is simple - &lt;strong&gt;To be the best platform to build and scale multi-tenant AI applications.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We are taking a new approach to building databases that have not been attempted before. We are virtualizing the concept of a customer (or tenant) into Postgres, making Postgres and its ecosystem perfect for creating B2B AI companies. We have been working on this for the past eighteen months, and we believe it is the fastest and safest way to develop AI-native B2B applications and scale globally.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why B2B, Why AI, and Why Postgres?
&lt;/h2&gt;

&lt;p&gt;Modern relational databases have been in existence for several decades. They have undergone numerous improvements, becoming significantly faster and capable of supporting more relational features. However, the gap between the application and the database has continued to grow. There are a significant number of problems that are being tackled by B2B developers, which should be solved within the database. A general-purpose DB will always be designed to solve only the lowest common denominator and push a lot of problems unique to B2B to the application layer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Multi-tenant architectures - can you have the cake and eat it too?
&lt;/h3&gt;

&lt;p&gt;The foundation of B2B applications is a multi-tenant architecture, where each tenant typically represents a customer, workspace, organization, etc. The main challenge is how to store and query many customers/tenants in the database. Various patterns have been proposed, but there are two main approaches at a high level.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foivcnbvvafwyw213lolp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foivcnbvvafwyw213lolp.png" alt="Multi-tenant architecture types" width="800" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On one extreme, you can use one database per tenant. This approach has several benefits but also entails many pain points.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Benefits&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Full isolation across customers, making it very difficult to leak data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Backups, performance insights, and read replicas are all specific to each customer which is a huge advantage for low MTTR per customer.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Drawbacks&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Significant cost: each database is typically deployed into its own virtual machine and has a minimum size. While you could bring the databases down when the tenants are inactive to save costs, this does not work well due to cold start time, and many tenants have low utilization (as opposed to no utilization).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Schema migration across tenants is difficult, especially when adding tenants in a self-serve manner. Deploying a new database and applying schema in a self-serve product becomes complex.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No ability to query across tenants. There is always a need to build internal customer dashboards and query across tenants for analytical purposes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The application has to be designed to work with multiple databases, custom routing, and multiple connection pools.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lots of tooling is needed to do fleet upgrades, metrics aggregation, alerting, and data ingestion from back-office tools into the DB.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The other extreme is to have one database across tenants.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Benefits&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simplicity. Application is designed to talk to one database and all the operational overhead for tenant per DB does not exist.&lt;/li&gt;
&lt;li&gt;Lower cost since multiple tenants are in the same DB. You pay for one DB’s provisioned capacity.&lt;/li&gt;
&lt;li&gt;Pretty much all the drawbacks of per DB model is a plus here&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Drawbacks&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Restricting access to a tenant data is not trivial. Need to enforce complex row-level security in the DB which is hard to debug or apply authorization at the application that could easily leak.&lt;/li&gt;
&lt;li&gt;Noisy neighbor problems between tenants as some tenants grow to be active&lt;/li&gt;
&lt;li&gt;No per-tenant query insights, backups, or read replicas that are super useful to reduce MTTR&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most companies end up having to support a hybrid approach. Companies start with one of the two approaches, and grow into the other, if successful. The reason is that as companies grow they typically have to place a subset of customers in their own database or in a particular region for compliance, isolation or latency reasons. The question is can you get all the benefits of both the architecture models without any of the downsides right from the start? Would it be possible to do this 10x cheaper and with the experience of a single database?&lt;/p&gt;

&lt;h3&gt;
  
  
  Building RAG apps with customer data
&lt;/h3&gt;

&lt;p&gt;AI is fundamentally changing how applications are built and consumed. One of the core architectural patterns for AI apps is Retrieval Augmented Generation (RAG). This approach involves:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Calculating vector embeddings for your input dataset&lt;/li&gt;
&lt;li&gt;Using the user's prompt to search for relevant embeddings&lt;/li&gt;
&lt;li&gt;Finding the relevant documents or chunks within the documents&lt;/li&gt;
&lt;li&gt;Feeding these documents along with the prompt to the Large Language Model (LLM) to get the most accurate answer &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;RAGs are becoming a critical part of AI infrastructure. The vector embeddings computed from customer data must be stored, queried, and scaled to millions. AI has dramatically accelerated the speed of adoption—what once took 2–3 years to reach scale is now possible in just six months. This explosion of AI adoption and the challenge of managing vector embeddings for RAG raises numerous problems.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fanvty6xw546cn36qkax8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fanvty6xw546cn36qkax8.png" alt="RAG architecture" width="800" height="643"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Separate databases for vector embeddings and customer data&lt;/strong&gt;&lt;br&gt;
In recent years, numerous vector databases have emerged. This trend separates customers' core data and metadata from their embeddings, forcing companies to manage multiple databases. Such separation increases costs, significantly complicates application development and operation, and leads to inefficient resource utilization between vector embeddings and customer metadata. Moreover, keeping these databases synchronized with customer changes adds yet another layer of complexity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lack of isolation for customer workloads&lt;/strong&gt;&lt;br&gt;
AI workloads demand significantly more memory and compute than traditional SaaS workloads. Customer adoption and growth are much faster with AI, though some of this can be attributed to a hype cycle. Moreover, rebuilding indexes for embeddings requires additional resources and may impact production workloads. The ability to isolate customer data and their AI workloads has a significant impact on the customer's experience. Isolation is a key customer requirement (no one wants their data mixed with anyone else’s) and also critical to performance - 3 million embeddings is very large. 1000 tenants with 3000 embeddings each is very manageable - you get lower latency and 100% recall.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scaling to billions of embeddings across customers&lt;/strong&gt;&lt;br&gt;
AI workloads scale to 50-100 million embeddings and in some cases even a billion embeddings. The biggest unlock with AI is the ability to search through unstructured data. All the data in different PDFs, Images, Wikis are now searchable. In addition, these unstructured data need to be chunked to do better contextual search. The explosion of vector embeddings requires a scalable database that can store billions of embeddings at a really low cost.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Connecting all the customer’s data to the OLTP&lt;/strong&gt;&lt;br&gt;
90% of AI use cases involve extracting data from customers' various SaaS services, making it accessible to LLMs, and allowing users to write prompts against this data. For instance, Glean, an AI-first company, aggregates data from issue trackers, wikis, and Salesforce, making it searchable in one central location using LLMs. Glean must offer a streamlined process for each customer to extract data from their SaaS APIs and transfer it to Glean's database. This data needs to be stored and managed on a per-customer basis. Vector embeddings must be computed during data ingestion. In the AI era, ETL pipelines from SaaS services to OLTP databases need to be reimagined for each customer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cost of computing, storing and querying customer vector embeddings&lt;/strong&gt;&lt;br&gt;
The sheer scale of vector embeddings and their associated workloads significantly increases the cost of managing AI infrastructure. The primary expenses stem from compute and storage, which typically align with customer activity. Ideally, you'd want to pay only for the exact resources a customer uses for compute. Similarly, you'd prefer cheaper storage options when embeddings aren't being accessed. By implementing per-customer cost management for their workloads, it should be possible to reduce expenses by 10 to 20 times.&lt;/p&gt;

&lt;h3&gt;
  
  
  Agents will create more B2B apps than humans in the next decade
&lt;/h3&gt;

&lt;p&gt;Historically, the rate of application development has been constrained by human capabilities. Increasing productivity typically involved hiring more developers or implementing tools that offered modest efficiency gains of 5-10%. However, the advent of AI and the emergence of intelligent agents are set to revolutionize this landscape. We're on the brink of witnessing a surge in B2B app creation. These agent-built applications will need to select their technology stack, with databases playing a pivotal role in this process.&lt;/p&gt;

&lt;p&gt;The main restriction to an agent world with millions of apps is database access. Currently, companies are limited by the number of databases they can have due to cost and available compute resources from cloud providers. To fundamentally change this, we need the ability to create unlimited free databases that can fully utilize available resources. This is challenging to build. It requires a true multi-tenant SQL database, rather than provisioning dedicated compute for each database or relying solely on containers or VMs. An ideal database should seamlessly move between deployments. New databases and tenants should start on serverless compute and gradually transition to provisioned compute as they grow. This approach enables a world where agents can experiment with many new applications in parallel on behalf of their users, increasing the chances of success.&lt;/p&gt;

&lt;h2&gt;
  
  
  Designing a Postgres platform from first principles for AI B2B apps
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Customer - the atomic unit of a business
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwpfrjyp3vqgiion3utr6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwpfrjyp3vqgiion3utr6.png" alt="Customer focus" width="800" height="527"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nile aims to build Postgres from the ground up, focusing specifically on B2B AI applications. The customer or tenant is a core building block of B2B companies—everything revolves around them. It's logical, then, that a data platform built for B2B companies should have the tenant as a native primitive in the database. By defining a customer in the database and extending this concept through to the storage layer, we can address the previously discussed problems at a fundamental level, potentially reducing costs by 10–20x. This approach also simplifies customer workflows that connect to other organizations. For instance, when a premium-tier customer onboards, creating a new customer in the support platform becomes straightforward, as the database can integrate with external APIs. This eliminates the risk of losing customer activity due to failed transactions with third-party services.&lt;/p&gt;

&lt;p&gt;Not all customers are created equal. In a typical B2B company, most customers start small and grow over time, while some become power users from the outset. Customer distribution across pricing tiers often follows a pattern: 50% inactive, 30% medium usage, and 20% power users. This distribution can vary based on the company's type and target market.&lt;/p&gt;

&lt;p&gt;The revenue each customer brings in differs significantly. Ideally, the cost to serve a customer should reflect this variation. A B2B-focused data platform should accommodate these differences. It should incur no costs for inactive customers, charge based on utilization for medium-usage customers, and provide dedicated compute for power users.&lt;/p&gt;

&lt;p&gt;This ability to control infrastructure costs for different customer groups enables companies to operate more efficiently. By aligning costs with customer value, businesses can optimize their resources and improve their bottom line.&lt;/p&gt;

&lt;h3&gt;
  
  
  Nile’s architecture
&lt;/h3&gt;

&lt;p&gt;Nile has built Postgres from the ground up with tenants/customers as a core building block. The key highlights of our design are:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Decoupled storage and compute.&lt;/strong&gt; The compute layer is essentially Postgres, modified to store each tenant's data in separate pages. The storage layer consists of a fleet of machines that house these pages. An external machine stores the log, while both the log and pages are archived in S3 for long-term storage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tenant-aware Postgres pages.&lt;/strong&gt; A typical Postgres database comprises objects like tables and indexes, represented by 8KB pages. In Nile, tables are either tenant-specific or shared. Each page of a tenant table belongs exclusively to one tenant, with all records within a page associated with that tenant. This decoupled storage and tenant-dedicated page system allows for instantaneous tenant migration between different Postgres compute instances. Moving a tenant simply involves transferring tenant leadership from one compute instance to another while maintaining references to the same pages in the storage layer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frv1j43rakribd1ar6d1x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frv1j43rakribd1ar6d1x.png" alt="Nile architecture" width="800" height="487"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Support for both serverless and provisioned compute.&lt;/strong&gt; The Postgres compute layer offers two types of compute. Serverless compute is built with true multitenancy, while provisioned compute is dedicated to a single Nile customer. Nile users can have any number of provisioned compute instances in the same database. Tenants can be placed on either serverless or provisioned compute.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Distributed querying across tenants and a central schema store.&lt;/strong&gt; The distributed query layer operates across tenants and functions between serverless and provisioned compute instances. A central schema store employs distributed transactions to apply schemas to every tenant during DDL execution. This ensures correct schema application and enables schema recovery for tenants during failures.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A global gateway for tenant routing, inter-region communication, and connection pooling.&lt;/strong&gt; The gateway uses the Postgres protocol to route requests to different tenants. It can communicate with gateways in other regions and serves as a connection pooling layer, eliminating the need for a separate pooler.&lt;/p&gt;

&lt;h3&gt;
  
  
  Architecture Benefits
&lt;/h3&gt;

&lt;p&gt;This architecture offers numerous surprising benefits. Nile supports various multitenant configurations within a single database, giving users fine-grained control over costs at the customer level. All tenants can be placed on serverless compute for 10–20x lower costs, or a subset can be assigned to provisioned compute for enhanced isolation and security. The system seamlessly scales horizontally across tenants and vertically per tenant, providing virtually limitless capacity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unlimited database and virtual tenant databases&lt;/strong&gt;&lt;br&gt;
In Nile, a database is a logical concept. Our serverless compute allows us to offer a truly cost-effective, multi-tenant solution that provisions new databases rapidly. This enables Nile to provide unlimited databases, even for free tiers. Serverless compute is ideal for testing, prototyping, and supporting early customers. As customers become more active, you can seamlessly transition them to provisioned compute for enhanced security or scalability. Nile's efficiency is remarkable—a new database is provisioned in under a second.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tenant placement on both serverless or provisioned compute with 10x compute cost savings&lt;/strong&gt;&lt;br&gt;
Tenants can now be placed on different types of compute within the same database. The serverless compute is extremely cost-efficient, proving cheaper than provisioning a standard instance on RDS. Built with true multitenancy, it enables Nile to use resources more efficiently across its users. Meanwhile, highly active customers can be moved to provisioned compute. The best part? The capacity needed for this is significantly lower than for an entire database housing all customers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Support billions of vector embeddings across customers with 10-20x storage savings&lt;/strong&gt;&lt;br&gt;
The architecture supports vertical scaling for tenants and horizontal scaling across tenants. For vector embeddings, the total index size is divided into smaller chunks across multiple machines. Additionally, since the storage is in S3, Nile can swap a tenant’s embeddings entirely to S3 without maintaining a local cache. The indexes themselves are smaller, and multiple machines can be leveraged to build indexes in parallel. This approach provides lower latency and nearly 100% recall by reducing the search space per customer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Secure isolation for customer’s data and embeddings&lt;/strong&gt;&lt;br&gt;
Each tenant in this architecture functions as its own virtual database. The Postgres connections understand tenants and can route to a specific one. Tenant data isolation is enforced natively in Postgres, as it recognizes tenant boundaries without the need for Row-Level Security (RLS). Furthermore, the architecture allows tenants to be moved instantly between compute instances. Performance isolation between tenants can be achieved by relocating them to other compute instances with more capacity without any downtime.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Branching, backups, query insights and read replicas by tenant/customer&lt;/strong&gt;&lt;br&gt;
Since Postgres understands tenant boundaries, we can now maintain one database for all tenants while executing database operations at the tenant level. This allows us to reproduce customer issues by simply branching the specific customer's data and replaying their workload. If a customer accidentally deletes their data, backups can be restored instantly. We can create read replicas only for customers with higher workloads, saving both compute and storage resources. Moreover, we can now debug performance for specific tenants or customers, eliminating the need to treat the database as a black box.&lt;/p&gt;

&lt;p&gt;We are excited once again to be in public preview today. &lt;a href="https://www.thenile.dev/" rel="noopener noreferrer"&gt;Try out Nile&lt;/a&gt; and build your AI B2B apps with a Postgres platform purpose built for it. We are looking forward to all the feedback!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>saas</category>
      <category>b2b</category>
      <category>postgres</category>
    </item>
  </channel>
</rss>
