Data

Data

3 pieces of work

Tagly

Fifty-table schema

Designed Tagly's whole database, from accounts to the ledger and the job queues. The database has 50 tables and runs on RDS. Job queues live in their own schema, apart from the money and account data that has to last. Prisma handles the schema and ordinary queries, and Kysely handles the queries an ORM can't express. A few of the design decisions:

  • Half-finished sign-ups live in separate pending tables. A real customer row only exists once it has a name, a verified email and a signed agreement. Abandoned sign-ups are deleted on a schedule without touching real accounts.
  • Money is stored in whole cents and multipliers in basis points, so important data never uses a float. Balances are built per currency, so supporting a new currency means adding a column, not converting data.
  • Important data is never denormalised. Lifetime spend, and which balance paid for a post, are both derived from the ledger.
  • Public uids are random and start with a prefix that says what kind of record they belong to. Internal ids stay plain integers.
  • PostgreSQL and PostGIS
  • Prisma
  • Kysely
  • AWS

Tagly

Seventy-four migrations

Shipped 74 schema migrations to Tagly's live database. The new shape goes live next to the old one first, the old columns and tables are only dropped later, once nothing reads them and the workers have moved to the new shape.

  • Prisma
  • PostgreSQL and PostGIS
  • AWS

Tagly

Completely restructured onboarding based on funnel data

Rebuilt Tagly's onboarding after the funnel showed a big drop-off at the first step, connecting Instagram. Onboarding now starts with an email code, or Apple or Google sign-in. Connecting Instagram moved to the end and became optional, which doubled the onboarding completion rate.

  • PostHog
  • React Native