开发者

Tell me why I shouldn't do this: Sinatra API with Full JS/HTML Frontend

开发者 https://www.devze.com 2023-04-02 15:02 出处:网络
I\'m about to be designing a social website that must be able to handle a high volume of users. Here\'s how I want to design it:

I'm about to be designing a social website that must be able to handle a high volume of users.

Here's how I want to design it:

  • Sinatra on the backend with a full REST api to do all o开发者_如何学Pythonf the operations on the website
  • JQuery/HTML front end web app that communicates exclusively with the REST API

In this way, I only have to make one central API that other apps (iPhone, Android) app will communicate with.

Also, it seems like it will be less load on the server, since the server only has to serve the minimum amount of info and everything else is done client side.

How come more sites aren't done this way?

Why wouldn't I want to do this? It seems like a good idea to me...


Because it is fragile and search engines won't index your content.


37signals are working on a framework called Cinco for this kind of architecture:

http://thinkvitamin.com/code/javascript/37signals-cinco-framework-to-be-open-sourced/

But if you stick to just jQuery I think you'd miss a lot things you take for granted when using a framework, which you might have to re-implement. But it really depends on your app.


It's not too hard to get basic functionality without JS, and after add Ajax stuff to your application. For example - you can create your API to respond as plain html markup and to respond JSON.

I like idea to do all stuff around API with JS\ajax, it maybe easy and more elegant with new technologies, it giving you more capabilites, but even google can't indexing full ajax sites now.

Read: http://www.google.com/support/webmasters/bin/answer.py?answer=81766

0

精彩评论

暂无评论...
验证码 换一张
取 消