On Fri, May 9, 2008 at 10:32 PM, bill robertson
<[EMAIL PROTECTED]> wrote:
>
> Thanks to all for the for the responses. It's been a rough week, so I
> had not had the chance to get back to this thread.
>
> First though, a quick aside to David. :-) That's pretty robust. You
> should see what happens to MQ when you start getting a lot of requests
> piled up because the mainframe in the back end begins to slow down.
> No fun when the failures start to cascade up the chain...
>
> I have been reading about yaws, and there is one thing that I really
> don't quite understand. Please bear with me, because this is an
> honest question. What does using Erlyweb buy me over just using
> yaws? It seems quite easy to structure code in yaws so it would
> follow an mvc architecture. My interest is still high, but I have not
> done lots of web development in the past, so I just don't see it. If
> anybody could explain what is "better" about Erlyweb, I would
> appreciate it.
- ErlyDB. Yaws doesn't provide a database abstraction layer. If you're
only using Mnesia, though, you're probably ok.
- ErlTL. I personally much prefer ErlTL to Yaws pages and ehtml.
- url->controller->view mapping. Sure, you can do it yourself, but
why? It's already done for you in ErlyWeb.
- Component system. This is very useful for code modularity in
non-trivial applications.
- Phased rendering. It's a very neat feature once you start playing with it.
These are the main points for me...
>
> Also, Yariv, if I may ask you about the mysql driver with your name on
> it. IIRC, you added the ability to do prepared statements with the
> driver. This is fantastic and great, but I don't see an example of
> how to use that feature in the code that I got off of google code.
> Can you please post an example here if you don't mind? Or tell me
> where to look if I just missed it?
I did add that feature to the driver... however, I later realized it's
impractical to use it in ErlyDB. The reason is the great number of
potential queries that can be generated for each module, and also that
many of those queries are generated from runtime data, e.g.
person:find({name,'=',"joe"})
This would be translated at runtime into
"select * from person where name='joe'"
It wouldn't be practical to use prepared such statements at compile
time because of the huge number of possibilities. Doing this lazily at
runtime is an option, but it would add the complexity of adding a
prepared statements cache... ultimately, it seemed like a premature
optimization that didn't add enough value to try to solve.
>
> I need to do a relatively quick web project, and I'd like to use
> Erlang (which is quite new to me), but I'm on the verge of taking
> another path because I'm having difficulty figuring out how to get
> access to a reasonable database. Mnesia is nice for what it is, but
> makes for a lot of work because I would be forced to code all
> constraints in the data access layer of the code. Mysql is always a
> good option for something like this, but if I can't use prepared
> statements in Erlang, then I'm going to have to use something else,
> because I don't want to spend a lot of time writing code to prevent
> sql injections attacks.
ErlyDB protects you from SQL injection attacks by automatically
quoting all strings. In fact, unless you tell ErlyWeb to allow unsafe
statements, you wouldn't be able to write code that's vulnerable to
such attacks even if you tried.
Yariv
>
> Thanks!
>
> On May 4, 11:32 pm, "Yariv Sadan" <[EMAIL PROTECTED]> wrote:
>> On Thu, May 1, 2008 at 8:25 PM, bill robertson
>>
>> <[EMAIL PROTECTED]> wrote:
>>
>> > If I can ask a few questions.
>>
>> > How stable is the current API? Is it expected to change much?
>>
>> ErlyWeb is quite stable and I don't have plans for changing it very
>> much. The only API change I'm considering is to avoid generating so
>> many aggregate functions in ErlyDB modules (currently, a few per each
>> function such as sum, avg, etc) but this change would have a backwards
>> compatibility flag if I implement it. Other than that, I'm always
>> happy to accept patches for new features or improvements from other
>> developers.
>>
>>
>>
>> > How stable is Erlyweb when running? I guess I expect minor issues
>> > that can be worked around since it is new, but are there any larger
>> > problems? What about yaws?
>>
>> I've been running Vimagi for weeks now without any issues. I have had
>> a couple of outages but I think they were due to my VPS provider. I
>> don't think you should worry about stability with ErlyWeb and Yaws.
>>
>>
>>
>> > I have noticed that many tutorials are from late 2006. Are these
>> > still valid, or has it changed a lot since then? Can somebody
>> > recommend a good tutorial?
>>
>> Yeah, the tutorials are pretty old and outdated. The documentation is
>> the most recent and valid reference source for ErlyWeb. There's a
>> nice, new tutorial
here:http://code.google.com/p/erlyweb/wiki/IntroductionTutorial, but
it
>> doesn't cover everything unfortunately. There really needs to be a
>> sample app that's open source...
>>
>>
>>
>> > Are there any "live" Erlyweb sites out there today?
>>
>> BeerRiot, Vimagi, the I Play WOW facebook app, wrotit.com (I think it
>> uses ErlyWeb), maybe some others that I don't know about.
>>
>>
>>
>> > If I can ask about yaws too, does it do SSL?
>>
>> Yes, it does do SSL.
>>
>>
>>
>> > Thanks.
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"erlyweb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---