Skip to content

Instantly share code, notes, and snippets.

@itsMapleLeaf
Last active August 26, 2024 04:52
Show Gist options
  • Save itsMapleLeaf/0fea3021b6e29fc86f6111bd5fec9659 to your computer and use it in GitHub Desktop.
Save itsMapleLeaf/0fea3021b6e29fc86f6111bd5fec9659 to your computer and use it in GitHub Desktop.
Instant & Convex

Comparison between two modern BaaS services

Convex

Good:

  • Realtime
  • Alongside DB, also supports auth, file uploads, server functions, and background tasks
  • Experience from end to end is very typesafe
  • Backend is open-source
  • DB is very strictly validated by the schema
  • Very extensible

Not good:

  • No direct database access outside of mutations
    • Convex requires queries, mutations, and actions for technical reasons, but not being able to let trusted backends directly access the database is a huge pain sometimes
  • No built-in support for relationships beyond ID pointers, e.g. cascading deletes, enforced related documents
    • This is a design decision, and this exists in the form of the convex-ents third party library, but is not enforced at the DB level
  • The Convex Auth library only has backend support for Next.js
  • No v.record() validator (it exists, but it's not a part of the public API for some reason)
  • No v.unknown() validator, only the very unsafe v.any()

Instant

Good:

  • Very good onboarding experience
  • DB queries and updates can be made from anywhere, including the backend
  • A robust permissions system which makes free database access less scary
  • Builtin auth support
  • Builtin app devtools - very cool!
  • No enforced frontend/backend separation makes it really quick and painless to iterate and add features

Not good:

  • Type safety is lacking and feels like an afterthought:
    • No way to sync your schema type with instant.schema.ts
    • instant.perms.ts is untyped
    • DB updates are completely untyped
  • Types in instant.schema.ts are not enforced on the backend; you can insert invalid documents without any warnings or errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment