lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi
The application has two characteristics:

1. DB access intensive - almost everypage has data fetching and a lot of tables
2. Real-time monitor - many pages have real-time interaction with a back-end server using AJAX.

Budget is small so I can't afford a large cluster of Apache server, but high availability is still required. 

I have done a lot of work with PHP before, but I feel Lua is lighter and can be more scalable for what my application.

Regards,
Pete

On Sat, May 17, 2008 at 6:28 AM, Eike Decker <eike@cube3d.de> wrote:
>...
> things.  While PHP has its advantages, elegance is hardly one of them.

PHP is the opposite meaning of elegance. ...

>
> > Sputnik, an extensible wiki, is based on the Kepler stack:
> >
> > http://sputnik.freewisdom.org/
>
> Sputnik uses Kepler's WSAPI and can run on top of CGILua, but is not
> written as a CGILua application, since I generally try to stay away
> from page-oriented web development style.  CGILua's "Lua Pages" allows
> you to embed chunks of code in an HTML page, PHP-style.  This approach
> is good when you want to add a little bit of dynamic action to an
> existing static site, but for developing a web application this mixes
> content and presentation too much, for my taste at least.

I second that. It's nice to embed code in a webpage, but for any more complex
application, it tends to be a drawback. With the result that most PHP scripts
start with <? and end with ?>.

I also like about lua that you can load additional libs during runtime. Your
environment is also not affected by some weird configuration scripts which can
defect your scripts in some weird ways (switching on warning/error levels for
ambiguous operations that are normally ignored).

If your application needs to implement some libraries that are not supported by
PHP (special IO stuff for example) or if you need to do heavy number crunching
that should better be done in some highly optimized C code, you might prefer
Lua as well since it's quite easy to compile and use a custom lib that can be
used in lua.

I also find it easier to debug lua scripts via simple print outputs by changing
certain functions. I.e. I want to know which piece of code is calling a certain
function - simply done in lua by overloading the initial function and do a
stacktrace lookup when it's called.

However it strongly depends on your project you are working on, so maybe you
could write a bit more about in which ways performance / memory footprint is
important for you.

-- eike