Looking for advice around extending the database.

default discord avatar
magicspon
3 weeks ago
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
    tyteen4a03
    3 weeks ago

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

  • default discord avatar
    magicspon
    3 weeks ago

    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



    PixelSnap_2023-11-05_at_14.30.362x.png
  • default discord avatar
    tyteen4a03
    3 weeks ago

    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
    magicspon
    3 weeks ago

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

  • default discord avatar
    tyteen4a03
    3 weeks ago

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

  • default discord avatar
    magicspon
    3 weeks ago

    👍

  • default discord avatar
    Dhan
    3 weeks ago

    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?

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.