0

I am working on a project that will have multiple databases (users, billing, application data) and I am not sure the best way of going about this. I was thinking of multiple applications but that seems like there has to be an easier/better way.

I want it so that a user in can create or delete a sub user (update the users and billing databases) and that original user or sub user can interact with the application data database. Idea being that I will have a route /api/login which gets a post request and log the user in using passport (maybe adding in passport totp eventually). The user then could read and write to both the application data and users database.

I also need it so that a user can load a page (say /users/profile) and it will pull from the users database but then can go to another page (say /time/request) and could then send a POST request to that route and write data to the application database.

I hope this is not too far outside the typical help found here. I know it is not a bug or directly code question but more of a software design question. Any help would be greatly appreciated.

The stack I am planning to work with is mongo, express, react and node.js.

Edit

I have already seen the 'possible duplicate' thread and it did not address my question in a way I felt was satisfactory for me. Please stop with a simple google search assuming it is the solution.

joshk132
  • 1,011
  • 12
  • 37
  • Possible duplicate of [Mongoose and multiple database in single node.js project](https://stackoverflow.com/questions/19474712/mongoose-and-multiple-database-in-single-node-js-project) – Sam Holmes Jul 15 '18 at 23:59
  • @SamHolmes I saw that and felt it did not address my question in a way that was good enough for me. So no, not a duplicate question. I really hate how people on here just assume that a quick google will solve everyone's questions. – joshk132 Jul 16 '18 at 00:02
  • I totally get your frustration, but for the most part, a quick google search _does_ solve the _majority_ of people's questions. There's good reason behind that assumption. Also, the wording of "possible duplicate" is intentional to allow for the fact that it might not be a duplicate, as _so many_ duplicate questions get asked on here. – Sam Holmes Jul 16 '18 at 00:06
  • Now, when you say it didn't address your question in a way you felt was satisfactory for you, can you tell us why? (so we can answer this question in way you _do_ find satisfactory) – Sam Holmes Jul 16 '18 at 00:08
  • @SamHolmes Feels like half the questions I post people come back assuming a duplicate without much thought into it. I could get it suggesting I look at a certain thread but I have noticed that when a 'possible duplicate' is posted I as well as others tend to get less replies and overall only serves to make the posting often pointless. I have had to repost many times on this account and others that I have seen certain posts and keep track of everything I look at just to ensure I don't get 'possible duplicate' replies. Really sucks I have to post a long list of the threads I have looked at. – joshk132 Jul 16 '18 at 00:09
  • How you feel is valid, but also often inaccurate for a lot of people. You are looking to create multiple connections with mongoose; the linked possible duplicate has answers for how to do that. Would I be right in assuming you want more specific implementation detail for your exact setup, and that's why it's not satisfactory? – Sam Holmes Jul 16 '18 at 00:13
  • I read your "question" a few times, but I'm not sure what you're asking. Did you even ask a question? – azium Jul 16 '18 at 00:35

0 Answers0