我应该为此网站应用程序使用Rails还是Ruby?如何? [英] Should I be using Rails or Ruby for this website application? How?

查看:100
本文介绍了我应该为此网站应用程序使用Rails还是Ruby?如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Web编程非常陌生(或者实际上,它很老,因为上次我搞砸Web的是HTML 1.1),但是现在需要快速部署Web应用程序.似乎每次我转身时,都有新的缩写词和技术需要学习(JSON,XMLRPC,GWT,Javascript,Rails等).

I'm very new to web programming (or actually, very old to it, since the last time I messed with the web was HTML 1.1), but now need to deploy a web application quickly. It seems like every time I turn around, there's new acronyms and technologies to learn (JSON, XMLRPC, GWT, Javascript, Rails, etc).

这是我的应用程序必须执行的操作:

Here's what my app must do:

  1. 提供用户名和密码,进行身份验证(很容易,显然所有事情都会做到这一点).
  2. 允许用户上传大量数据进行处理.
  3. 处理该数据.
  4. 允许用户下载其处理过的数据.

我已经有了Java脚本和一个用于处理数据的数据库.在一台机器上,我可以运行一系列命令行程序来处理传入的数据块,然后将结果放回到mysql数据库中.那已经存在并且可以正常工作.

I've already got Java scripts and a database for handling the data. On one machine, I can run a series of command-line programs to process an incoming datablock and put the results back into a mysql database. That is already present and working.

我想使用这些现有的经过测试的方法来构建此任务的Web前端.我目前倾向于这种方法:

I want to construct a web front-end to this task, using these existing and tested methods. I'm currently leaning to this approach:

  1. 有两台计算机,一台数据库计算机和一台Web服务器.这种方法可以在需要时提供更高的可伸缩性,但是还要求我不能假定用于访问数据和操作数据的程序是本地存储的.
  2. 使用 Ruby DRb 应用程序创建服务器和客户端.客户端会将数据传递到服务器,服务器又将调用这些应用程序.
  3. 使用其他Ruby界面与Web前端的DRb交互.
  1. Have two machines, a database machine and a web server. That approach allows for later scalability, if necessary, but also requires that I can't assume that the programs that I use to access the data and manipulate it are locally stored.
  2. Use a Ruby DRb application to create a server and a client. The client would pass data to the server which would in turn call these applications.
  3. Use some other Ruby interface to interact with the DRb for the web frontend.

这是我的问题:看起来大多数Ruby的Web应用程序都会自动尝试构建某种本地数据库.我发现的所有 Rails教程您自己的数据库并与之交互,这正是我不想做的事情.

Here's my problem: it looks like most Ruby applications for the web automatically try to build some kind of local database. All the Rails tutorials I've found start with making your own database and interacting with that, which is exactly what I don't want to do.

Rails是适合我的技术,还是使用Ruby DRb?我还应该探索其他一些技术吗?

Is Rails the right technology for me, or using Ruby DRb? Is there some other technology I should be exploring?

如果Rails或Ruby是正确的选择,我应该看什么?我已经有了编程Ruby" 书,并将其用于一些后端工作以及使基本的DRb正常工作.

If Rails or Ruby is the Right Thing here, what should I be looking at? I already have the Programming Ruby book, and have used that for some of the backend stuff as well as getting basic DRb stuff working.

推荐答案

Rails之类的声音对于您的情况可能有点重.也许 Sinatra 可能更合适?这是一个超轻量级的框架:一个hello world应用可能看起来像这样:

Sounds like Rails might be a bit heavyweight for your situation. Perhaps Sinatra might be a better fit? It's an ultra-lightweight framework: a hello world app might look something like:

require 'sinatra'
get '/' do
  "Hello World!"
end

这篇关于我应该为此网站应用程序使用Rails还是Ruby?如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆