[erlang-questions] Framework advise

41 views
Skip to first unread message

Jayson Barley

unread,
Jul 13, 2012, 10:59:39 PM7/13/12
to Erlang Questions
I need to show a POC on a rewrite/redesign of an existing Java/CPP code base. From my work with Erlang I believe it is the best choice for the job. I am seeking some advise on what frameworks would be best to start with that will meet my goals. See below for the details. I am willing to listen to any feedback on which frameworks would be best or even if Erlang isn't the best tool for the job.

Requirements
  1. Web standards based - Must support HTML 5, JS, CSS, etc. I am thinking 
  2. Authentication - Users will need to be able to move from one server to another without losing their session.
  3. Template-able - I will need to be able to perform CRUD and retrieve data as HTML, XML, JSON, and possibly other formats in the future.
  4. Scalable - It must support at least 10,000 requests per second. It could be higher but based on the next requirement I am starting out small.
  5. Capable of streaming large amounts of data - It is possible that a REST request could contain millions of rows of data. This is rare but it is a use case that the existing Tomcat/IIS/Java Frankenstein currently does.
  6. MS SQL connectivity - Our existing database is MS SQL and that won't be easy to change so it needs to be able to connect to it.
  7. Testable - I will need to be able to write and run Unit, Integration tests. I am guessing that eunit and common test will cover this.
  8. Easily deployable - A new server will need to be deployed and configured in minutes. Something like Chef would be ideal since we are already using that in other areas.
  9. In place upgrades - When a new build is ready to deployed we should be able to deploy it, leave the previous version in place to roll back should an issue be found.
  10. Easy logging.

I think that is everything I can think of. If anyone has any questions or recommendations on how to make this clearer please let me know.

Thank you in advance,
Jayson

Tim McNamara

unread,
Jul 14, 2012, 12:33:57 AM7/14/12
to Jayson Barley, Erlang Questions
Good luck developing the prototype Jayson. You may want to give some
reasons why the Frankenstein middleware isn't performing to get the
most helpful responses.

Are you just want to creating an authenticated front-end for a
database? Without knowning more, I would say that facilitating single
sign-on will be the trickest part. Creating a database front end will
be pretty easy. You might want to look at Chicago Boss's Boss_DB
project (https://github.com/evanmiller/boss_db), which will allow you
to easily create an adapter for MS SQL if one doesn't already work for
you.
> _______________________________________________
> erlang-questions mailing list
> erlang-q...@erlang.org
> http://erlang.org/mailman/listinfo/erlang-questions
>
_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

Paul Barry

unread,
Jul 14, 2012, 8:06:06 AM7/14/12
to Tim McNamara, Erlang Questions
+1 from me on Chicago Boss. It's worth spending some time with - and
I think it hits most of the items on your list (as it is built on
Erlang/OTP and "inherits" a lot of the application characteristics
that are important to you. Chicago Boss has a very friendly user
community and mailing list (just like Erlang's). :-)

Paul.

P.S. I'm just starting to go through Zachary Kessin's recent book
(http://www.amazon.com/Building-Web-Applications-Erlang-Working/dp/1449309968/)
which may be worth a look also. It's not an expensive purchase, and
touches on some of your issues.
--
Paul Barry, w: http://paulbarry.itcarlow.ie - e: paul....@itcarlow.ie
Lecturer, Computer Networking: Institute of Technology, Carlow, Ireland.

Jesse Gumm

unread,
Jul 14, 2012, 9:36:34 AM7/14/12
to Paul Barry, Erlang Questions

As far as Erlang web frameworks go, you're basically gonna have Chicago Boss (MVC), Nitrogen (event driven), and Zotonic (CMS with some event driven stuff).

You can also develop a little "closer to the metal" using yaws, cowboy, mochiweb, webmachine, or the new fandangled hybrid mochicow.

Both Nitrogen and Boss use simple_bridge to facilitate whichever underlying erlang server you'd want to use, so you can tap into the various streaming capacities of the underlying server of your choice.

As I'm familiar with Nitrogen moreso than the others, I can at least address how it can handle your requirements:

The multiserver (multi domain?) one is interesting. Nitrogen supports session sharing across a cluster, however it's default identification is with a cookie, so that's worth considering with regard to multiple domains. I can imagine a custom session handler combined with a custom security handler solving the session sharing problem. I may put together a single sign on POC just to satisfy my own curiosity.

In place upgrade with a hot swappable rollback sounds more like something you'd want to do by using multiple nodes and a reverse proxy like nginx.

As for mssql connectivity goes, nitrogen is db agnostic (provides no direct facilities for db integration), but using the erlang drivers for databases is no problem at all. The easiest method of accessing mssql from erlang might be odbc.

With those caveats mentioned, Nitrogen can handle the others just fine. I'm sure Boss and Zotonic would do just as well. Using Chicago Boss would likely require a custom BossDB adapter for mssql.

The big difference, however, will be in how you prefer to develop. Spend a few hours tinkering with each and see which development model you prefer.

--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm

Wojtek Narczyński

unread,
Jul 16, 2012, 11:17:17 AM7/16/12
to erlang-q...@erlang.org
Jayson,

> Web standards based - Must support HTML 5, JS, CSS, etc. I am
thinking

ChicagoBoss + twitter bootstrap worked well for us. You can code in such
a way, that the client is the client, and the server is the server
(serving JSON).

> MS SQL connectivity - Our existing database is MS SQL and that
won't be easy to change so it needs to be able to connect to it.

You can connect with ODBC, which runs as an external process, which
might be fast enough, or not.

> Testable - I will need to be able to write and run Unit,
Integration tests. I am guessing that eunit and common test will cover this.

The testing framework is much less important than the ability to isolate
components. In erlang you can test functions, but you can also
relatively easily isolate and test whole subsystems, because of erlang
message-passing nature.

> Easily deployable - A new server will need to be deployed and
configured in minutes. Something like Chef would be ideal since we are
already using that in other areas.
> In place upgrades - When a new build is ready to deployed we
should be able to deploy it, leave the previous version in place to roll
back should an issue be found.

If you mean adding capacity, virtualization is difficult to beat. Erlang
hot code updates are useful for patching. For a major roll-out of a new
version, where the database schema changes, there is no silver bullet.

> Easy logging.

It depends on your requirements for the logging subsystem, but in
logging in erlang is pretty hard.

--Regards,
Wojtek Narczynski
Reply all
Reply to author
Forward
0 new messages