C
C#•8mo ago
only you know

practicing on mutliple databases

I have a model named 'User' in PostgreSQL, an 'Item' in MongoDB, and a 'Cart' in PostgreSQL. Shouldn't the 'Cart' model be relational with Item and User, should I change the mongodb? In other words, a user has a cart, and a cart has an item.
7 Replies
only you know
only you knowOP•8mo ago
@Pobiega
Pobiega
Pobiega•8mo ago
Don't randomly ping people. Rude.
only you know
only you knowOP•8mo ago
🙊 🥺 sry
V0FBU1VM
V0FBU1VM•8mo ago
A user can have many carts and a cart can hold many items.
Jimmacle
Jimmacle•8mo ago
you're using multiple databases at once? why?
only you know
only you knowOP•8mo ago
for learning how to control multiple databases when program need more dbs
Jimmacle
Jimmacle•8mo ago
well, you can't enforce relationships at all between multiple databases not without writing all that logic yourself anyway what kind of applications need "more dbs" where you've split relational data across them? not to mention mongo isn't a relational database i feel like this whole problem you've invented for yourself isn't something you'd really run into in most applications
Want results from more Discord servers?
Add your server