C15T Logo

Database Adapters Overview

c15t Backend supports multiple database adapters, each offering different features and trade-offs. This guide helps you choose the right adapter for your needs.

Deprecated Feature

@c15t/backend v1 did not deliver the flexibility we wanted and fell short of our standards. It is now deprecated as we work on a full rewrite, with v2 entering canary soon. This does not affect Consent.io deployments, which remain stable.

Comparison Table

FeatureMemoryKyselyPrismaDrizzle
Best forDevelopmentProduction SQLFull ORMLightweight ORM
Type safetyBasicGoodExcellentExcellent
Schema managementNoneManualAutomaticManual + Tools
MigrationsNoneManualAutomaticCLI tools
Query complexityBasicAdvancedAdvancedAdvanced
Transaction supportNoYesYesYes
PerformanceFast (in-memory)FastModerateFast
Bundle sizeMinimalModerateLargeSmall
Database supportN/APostgreSQL, MySQL, SQLiteManyPostgreSQL, MySQL, SQLite

Choosing the Right Adapter

  • Memory Adapter: Perfect for development, testing, and demos. Not suitable for production.
  • Kysely Adapter: Great for applications that need direct SQL access with type safety and performance.
  • Prisma Adapter: Ideal for applications that benefit from a full-featured ORM with schema management.
  • Drizzle Adapter: Good balance between performance and features with a lightweight footprint.

Migration Path

You can switch between adapters as your application needs evolve:

  1. Development → Production: Start with Memory adapter, then migrate to Kysely, Prisma, or Drizzle
  2. Changing Adapters: The common adapter interface makes it relatively easy to switch between implementations

Next Steps

Edit on GitHub

Last updated: April 15, 2025