Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Looking for advice around extending the database.

default discord avatar
magicsponlast year
7

I'm about to start building a saas application.


I'd like to use payloadcms to handle all of the content. And then use a t3 like setup to handle to application side of things. What is the recommend way of extending the database (postgres)? Can I add new table schemas? Or is the recommended approach to define all my tables as payload collections?

  • default discord avatar
    tyteen4a03last year

    the question is: why do you need to extend the database?

  • default discord avatar
    magicsponlast year

    If i want to use a single database, but only use payloadcms to handle the marketing content



    then custom tables for the saas site of things



    or, do i go all in on payloadcms and use it for everything... marketing content + saas app



  • default discord avatar
    tyteen4a03last year

    it's a separation of concerns issue more than a technology split issue; if hackers take down your entire marketing site, it shouldn't drag down your SaaS app



    if there's no need for your marketing site to talk to the SaaS app they should be developed as two separate apps

  • default discord avatar
    magicsponlast year

    yeah, that's my thinking. so you'd use two databases... one for payload, one for the saas thinger

  • default discord avatar
    tyteen4a03last year

    you can use payload as a backend for both, but they would be separate instances

  • default discord avatar
    magicsponlast year

    👍

  • default discord avatar
    dhan8417last year

    Say I wanted a multi-type search, that gave search results from marketing content and app data... is there a suggested way to have app data in the same database as Payload? I'm thinking different tables in a Postgres database using drizzle. But, how would migrations work?

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.