1

I'm trying to build a website myself but I also want to build a native mobile application that will access the same DB in the future.

What I'm thinking now is using Node.js to build Web Services wrapper for the DB and every DB operation will be executed via web service API. And for the website framework, I'm going to use Rails.

Please let me know whether this is a good architecture or not. I'm not sure whether encapsulate data with Web Services is a good idea. Will there be any performance issue? And if it's feasible, which DB should I use? And can rails communicate with DB via web services?

Thanks a lot!

Update

Why do people down vote this question??

user2440712
  • 719
  • 2
  • 9
  • 16
  • Are you thinking this is the type of application that will grow rapidly and need to scale? Are you an existing Rails developer or do you have time to use this project to learn new technology? Pretty much any modern language can be used to expose an API you design. Your API is a layer through your language to talk to the database and perform functions. Have you considered a NoSQL DB like MongoDB? – Steve Jun 04 '13 at 14:26
  • Hi Steven, Thanks for your reply. I just want to build a website myself and it might potentially grow and need some scalability. I'm a java programmer in my job and want to learn rails. I've heard that Node.js can be easily scaled. Will there be any performance issue when rails communicate with Node.js+MangoDB? – user2440712 Jun 04 '13 at 15:08

1 Answers1

1

I think you have more technology than needed in your architecture right now.

Personally I would create a REST api on top of the DB (using either node or Rails - both are super easy to do this with and both can use pretty well any db)

Then you can write any number of "apps" for the front end process, whether they are web apps, ios apps, android apps, etc... They will all get their data from your REST api on the backend.

You might even consider writing the front end as a single page app using Angular, Knockout or Backbone, something like that. If you do that with node, your entire stack will essentially be written in javascript. It can get confusing for a newb, but it's super powerful.

Strat
  • 171
  • 5