C
C#•9mo 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•9mo ago
@Pobiega
Pobiega
Pobiega•9mo ago
Don't randomly ping people. Rude.
only you know
only you knowOP•9mo ago
🙊 🥺 sry
WAASUL
WAASUL•9mo ago
A user can have many carts and a cart can hold many items.
Jimmacle
Jimmacle•9mo ago
you're using multiple databases at once? why?
only you know
only you knowOP•9mo ago
for learning how to control multiple databases when program need more dbs
Jimmacle
Jimmacle•9mo 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