user1106811
user1106811

Reputation: 297

backbone.js and the need of a back-end engine

reading this days about backbone.js (documentation, examples, etc), and as far as i have understood, this framework lets you code directly on the front-end, almost all the back-end engine, since you can structure a MVC architecture. You can create your data model, controllers, etc.

My question is: if you already have the MVC architecture built on the Front-End (engine), you just need a DataBase (SQL) in the cloud from where you can fetch or store data, why do you need a back-end engine (RoR3,Java,etc) to persist document data?

thanks in advance

Upvotes: 4

Views: 1397

Answers (4)

Cody
Cody

Reputation: 10015

Front-End MVC frameworks (Backbone, Angular, etc) all rely on a backend service to provide the data that, say Backbone, would then use as its model.

You could have an entire MVC pattern on the backend that accepts requests and spits out some JSON for a frontend MVC framework to use.

If you just want a database without creating a server, I would recommend using Google FusionTables - but you need OAuth and maybe even ClientLogin (depending) on top of that.

Upvotes: 1

Fernando Diaz Garrido
Fernando Diaz Garrido

Reputation: 3995

You are confusing two different meanings of front end, the model in the backbone framework is not able to connect to a database directly, this model are designed to connect to an API (that would be your backend) that is connected to a database

Upvotes: 7

kernelpanic
kernelpanic

Reputation: 2956

Because as far as I know Backbone works with RESTful services and it needs a server to handle the requests:

get: to list data from the db
post: to add new stuff to the db
put: to update current data
delete: to remove data from the db.

.. and also perform all sorts of server related stuff if you like

For instance I'm using Restful server based on Code Igniter to handle that stuff. From there you can choose the DB you want to work with. I already tried using MySQL and MongoDB

Upvotes: 0

clyfe
clyfe

Reputation: 23770

Things you still need to do on the server:

  • authentication
  • authorization
  • data sanitation and filtering

Possiby

  • interact to third parties
  • business logic that involves modules other than UI

etc.

Upvotes: 2

Related Questions