I am a front-end developer. For many experiements I do I need to have a server that talks JSON with my client side app. Normally that server is a simple server that response to my POSTs and GETs. For example I need to setup a server that saves, modifies and read data from a "library" database like this:

  • POST /books create a book
  • GET /book/:id gets a book

and so on...

What is the fastest to set up and easiest technology stack for database and server in this case? I am open to use Ruby, Nodejs and anything that do the job fast and easy.

Is there any framework (on any language) that do stuff like this for me?

closed as not constructive by Jarrod Roberson, GrandmasterB, gnat, ChrisF Jun 21 '12 at 8:26

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. If this question can be reworded to fit the rules in the help center, please edit the question.

  • web.py is the simplest thing to get started with. – Jarrod Roberson Jun 21 '12 at 0:57
  • 1
    I'm not so much saddened by the question as I am by the answers. It's not how you're responding that matters, it's what you have to do in order to build a response. The best tools to use can vary wildly based on what hoops your server will have to jump through to prepare the response. – TehShrike Jun 21 '12 at 1:44
  • fastest to get running or fastest to process each request? – user1249 Jun 21 '12 at 5:52
  • @ThorbjørnRavnAndersen to set it up – Mohsen Jun 21 '12 at 6:35
  • @Mohsen Help others help you by editing your actual question to clarify that, rather than leaving it in a comment. – occulus Jun 21 '12 at 8:09

CouchDB. It's a document-oriented database server. Its network protocol is based on HTTP and JSON. It does exactly what you described.

The biggest drawback: it lacks a lot of the features that people take for granted when using relational databases. This may or may not be a problem for you.

  • This was informative for me. All the best. Nash – Jack Stone Jun 21 '12 at 3:06

Yes, most languages have JSON bindings available. Check out JSON.org; there's a fairly extensive list if you scroll down a few pages.

So you've basically got three problems here, and it's best to separate them into their own layers.

  • You need an HTTP server. Just about any language has one. Looks like you'll want to put some specific logic about parsing URLs into that layer.
  • You need a JSON layer that can create and read JSON. Your JSON library would go here.
  • You need business logic that defines and implements the API for your server. That part's up to you.

In pretty much any modern language, HTTP server and JSON libraries will already be available for free. Just take a look at the options. So the real question is, which language would you be best at problem #3 in? That's your answer.

  • @Mohsen mentioned fastest and easiest. With experience from PHP, IIS, Node.js, and various Java servers from Tomcat to JBoss, - I have to agree with Mr. Baranczak. CouchDB, is a good for this. The hello world takes a few minutes and you have a JSON, JavaScript REST NoSQL database...as far as I've learned it is easy to manage as it opens right up to http. Check it out. JavaScript is, flexibly, fast and easy. Another is MongoDB. All the best. Nash – Jack Stone Jun 21 '12 at 3:00

Fastest to develop whatever language your most familiar in. I can't think of a mature language without a json parser.

Fastest to run depends on your requirements (how big are the requests and how frequent?) and server architecture. Probably the fastest would be C++ or erlang but that would be a lot of work.

Personally I would be very tempted to go for Node.js and some nosql variant like MongoDb. They both have very good performance and it would be JavaScript all the way down to the database, no converting or parsing needed.

Not the answer you're looking for? Browse other questions tagged or ask your own question.