Is statebase framework such as Lift Scalable? - scala

I've watch Harry Heymann, from Foursquare, gave a presentation on Lift to BASE usergroup. He mention something about how Lift being statebase isn't going to scale well in that video.
Is that true? If so why is that? Note: I know very little about state base.
I can't seem to find the google, I'll look for it later. Thank you in advance.

When this questions comes up on the Lift Mailing list, what the author of the framework usually replies with is a blog post he wrote some time ago, which explains why Lift is Stateful, but at the same time how you can use Lift as a stateless framework.
This is the link

David Pollack has a good answer to this at this this Quora thread, in a comment to Jackson Davis's answer:
In practice, scaling a Lift site is much much easier than scaling a LAMP site. Why? Well, state exists someplace. If it exists in the JVM, you get a lot of performance benefits and stability as well as, in Lift's case, lots of security. Contrast that with sessions in memcached. "Whoop, memcached went down, there go a pile of sessions." "Whoops, we've got a new memcached hashing algorithm, there go all the session." "Whoops, Google just crawled us creating 200,000 new sessions pushing all the but the active sessions out of cache." "Whoops, the Ruby runtime just went wild, ate all the VM on one of our boxes, memcached went down..." So, you try storing sessions in some wacky shared version of MySQL. This solution requires tons of hardware and a team of make sure that the sharing code is correct, etc. Contrast that to using Nginx, Jetty and session affinity. It's about 4 hours of setup time and it just works. See http://blog.harryh.org/post/7550... So, talk to a Facebook engineer about the challenges they go through to manage state between the front end, memcached, MySQL, etc. Compare that to Twitter with the famous fail whale. Compare that to Apple's store and the iTunes store which are written on WebObject (which is highly stateful.) Lift apps running at scale typically require 7% of the front end resources of LAMP app. The Lift apps that are running at scale (Foursquare and Novell pulse are two) do not have the kind of scaling issues associated with LAMP sites that have similar traffic patterns. Scaling with Lift is neither tricky, nor risky. It's simple. It's known. It's proven. Scaling with LAMP is playing whack-a-mole with state and that only becomes a problem at scale. -David Pollak • Jul 20, 2010

I think it's pretty clear that Lift apps scale very well. Foursquare and the UK Guardian are both using Lift. Both sites are very highly trafficked and neither has had a material Lift-related outage. Please also see the link that Diego posted. It provides an in-depth discussion of scaling Lift-powered sites.

Related

Problems/questions regarding content management system implementation

I've been on this issue for probably a good two months now and really haven't found a stable solution so I thought I'd just try to ask. I have an existing site already at http://keyjaycompound.com that runs off a CMS that I designed. While it was good at the time, I've now outgrown it and looking at it now, looks sloppy XD.
So at first I started redoing the CMS when I thought and read that there are so many CMS solutions available, why spin my wheels? It seemed more logical to get a third party solution that does the mondain tasks like article CRUD and user management where I'd primarily worry about the addons.
So I searched and tried many solutions that I thought would suite my PHP development needs. As my testing base, I needed to see how well my current site would transfer over and how much hassle would ensue. While CMS's like Drupal, E107, and others were great....on paper, neither seem to suite my need. They were either too bloated, lacking in documentation or community support, seemly comprised of large hassle for simple tasks, or just downright confusing >_<.
So now the road has put me at Frameworks now in which I'm currently trying to learn Code Igniter. Now my issue becomes security! One of the advantages of CMS systems like Drupal or Joomla is that they have (and constantly are) field tested for security holes. Something a lone modest experienced developer like myself would probably never find. However what some have told me is that the fact that the CMS would be designed by me does create somewhat of a layer of security considering it's not common to the public as much as Drupal or Wordpress.
So with that here are my questions. In consideration of time and practicality:
how do pro's actually do something like this; select a content management system for their project?
Do they start with frameworks and build out, adjusting to security problems along the way?
Do they use a particular CMS solution so they dont worry as much about common security holes?
Maybe I should start with a framework like Codeigniter and growing with it as my security and user management needs change?
Thanks guys. I'd really like to finally stick with a solution to learn so I can finally get back to developing.
This might be too old to answer, but I'm shocked nobody has bothered to answer the question! I'm in the same situation and saw this.
I started out with a CMS, but after a security attack that wiped a project site clean (and the CMS forum was completely clueless) I picked up Codeigniter. Some projects later and recreating my own CMS (twice), I settled with wordpress for small-medium projects (from personal websites to online news/magazine types). As you put it, I've outgrown my own CMS for these type of projects.
Answers (in the order you asked them):
1) It depends mostly on what it is you are doing. If its something that can be deployed with open software (with a little patience learning), you could be better off with that while making sure they're updated all the time. But if you're doing something way different from all these I'm afraid you're pretty much stuck with a custom solution, which you could accelerate with frameworks.
2,3,4) With frameworks (for starters) sticking to the security guidelines of the framework in question helps a lot, while proofing the usual suspects (form validation, session hijacking, injection, etc) . I ran my first CMS through a certified hacker and he said it was rock solid (despite how paranoid I was about security while developing). Stick to the blog of the framework for security updates (they do happen)
For CI though, a major item you have to consider thoroughly would be the user management. CI AFAIK didn't come with one at the time and picking one with security in mind made me realize how important it was.
What seems to be looking like a good idea is finding a CMS working within Codeigniter that I can extend with ease. I don't know yet if this is the same as a standalone CMS that was built on codeigniter, but tackling security problems for me would amount to running tests while being as alert as I am as I go
Sorry for the long talk. Hope this helps

MODX - what can be improved?

I'm researching MODX as a CMS and found this interview with the creator of FoxyCart.
He really gives MODX a lot of positive comments and when asked about improving MODX he pointed out the following:
User management can be awkward, and
some things related to webusers have
never really been brought current.
(Newspublisher can’t handle TVs;
Weblogin is temperamental and not easy
to customize; Webusers need “TVs” for
additional fields.)
Can others on this site shed some light on this? What other kind of user management issues are there?
What are some areas of MODX that people think should be improved?
I'm trying to figure out whether to go with MODX or not. I've been reading a lot of positive things about it and want to make sure that I get the whole picture.
Brett (Foxycart) is talking about MODX Evolution, the older codebase, and makes reference to add-ons, which are (for the most part) independently authored - so definitely improvable. MODX Revolution is the newer version, currently at 2.1 RC3. I've worked with everything from Enterprise CRMs (Tridion, Rhythmyx, Mediasurface as was) to other FOSS systems Silverstripe, Wordpress etc, and it is by far the most intelligently put together and executed of the lot.
It has some niggles - the permissions system is overly abstract and complex, it lacks some plug-and-play features, fine-tuning performance is a bit of a black art, and it doesn't have the ecosystem support of bigger players like Drupal or Joomla (or even WP). But the peer support is fantastic, the core team are committed and talented, and with a modicum of php and willingness to RTFM you can make it do almost anything with MODX.
Strongly recommended.
Everything can be improved, Wordpress or Drupal included, thats generalizing the topic. MODx is awesome piece of 0's and 1's which will cut your development time so much that your head will spin. Its easy to use and develop with and its fast. As far as im concerned, its web designers dream to work with. I sat give it a local spin and try playing for a day and decide afterwards.
Here are some of tuts i compiled in URL list for easy learning:
http://urli.st/3Tg
Also, Twitter #modx is also great resource to be in sync with the matter.
Hope you'll find it good!
good luck!
I've used several Content Management Platforms, and ultimately the experience has always been similar. While I can put up a site lickety-split, I have often wanted to override functionality or its output and couldn't do so without wading through large amounts of PHP files. This has always resulted in a large unsatisfactory result, because I am not lazy, unless I have to wade through others code.
When I started ModX, one week ago, the learning curve hit me like a brick. Mostly this was because it was so simple and I had been trained to deal with CMSes in complex manners. It is much more like a true Object Oriented platform (to me), and as I am an OO programmer, this fit the bill once I realized it was not as complex as I was making it out to be.
Now, in less than a week I have two nearly complete websites (a corporate software development with a shopping cart and a development blog) in less than 1/4 of the time it took me to make my original Corporate website. I'm at the tweaking style and adding content more quickly and easily than I have ever done with a CMS. I did all of the work as well. Injecting my own PHP, HTML, and CSS was amazingly easy, and I did not have to search and rely on hacky plugins to get the job done.
That being said, there are a number of ways in which ModX could be improved. The Manager uses Ajax, but most of the time it is used way too often on a full page refresh anyway. This does slow things down. The User Management is awkward, at first, and honestly should be revisited as time and community allows. The tutorials are improving, but are weak without the videos to accompany them (in my opinion). And there is a lack of variety of useful plugins, but the plugins they have are extremely useful and can be tailored for nearly any solution.
As a final note: the most useful feature is the abstraction of the properties and property sets. This allows you to override your overall site settings, for things as simple as a template or page.
FuzzicalLogic
Putting up a simple photo gallery can be a nightmare.
There is a plug in component that is very obtuse and cumbersome to implement. This is a glaring weakness when you are comparing to, say, WordPress, who are very much MODx's competition for the hearts and minds of developers.
My 5 minutes experience with Modx (2.1.3-pl)
installed the latest (stable) version then try to run the site.
1) Error 503, site unavailable.
okay, it should show a link to the setup page but a quick search in internet showed how to open the setup manually.
2) PDO is required... well, it is starting to stink. PDO is slow
them i activated PDO in my PHP, restart apache and entered the "Connection Information" form and clicked in "Test database server connection and view collations." and
3) "Test database server connection and view collations." javascript error.. i tried with other browser and it is the same.
nuff said.

Risk evaluation for framework selection

I'm planning on starting a new project, and am evaluating various web frameworks. There is one that I'm seriously considering, but I worry about its lasting power.
When choosing a web framework, what should I look for when deciding what to go with?
Here's what I have noticed with the framework I'm looking at:
Small community. There are only a few messages on the users list each day
No news on the "news" page since the previous release, over 6 months ago
No svn commits in the last 30 days
Good documentation, but wiki not updated since previous release
Most recent release still not in a maven repository
It is not the officially sanctioned Java EE framework, but I've seen several people mention it as a good solution in answers to various questions on Stack Overflow.
I'm not going to say which framework I'm looking at, because I don't want this to get into a framework war. I want to know what other aspects of the project I should look at in my evaluation of risk. This should apply to other areas besides just Java EE web, like ORM, etc.
I'll say that so-called "dead" projects are not that great a danger as long as the project itself is solid and you like it. The thing is that if the library or framework already does everything you can think you want, then it's not such a big deal. If you get a stable project up and running then you should be done thinking about the framework (done!) and focus only on your webapp. You shouldn't be required to update the framework itself with the latest release every month.
Personally, I think the most important point is that you find one that is intuitive to your project. What makes the most sense? MVC? Should each element in the URL be a separate object? How would interactivity (AJAX) work? It makes no sense to pick something just because it's an "industry standard" or because it's used by a lot of big-name sites. Maybe they chose it for needs entirely different from yours. Read the tutorials for each framework and be critical. If it doesn't gel with your way of thinking, or you have seen it done more elegantly, then move on. What you are considering here is the design and good design is tantamount for staying flexible and scalable. There's hundreds of web frameworks out there, old and new, in every language. You're bound to find half a dozen that works just the way you want to think in your project.
Points I consider mandatory:
Extensible through plug-ins: check if there's already plug-ins for various middleware tasks such as memcache, gzip, OpenID, AJAX goodness, etc.
Simplicity and modularity: the more complex, the steeper the learning curve and the less you can trust its stability; the more "locked" to specific technologies, the higher the chances that you'll end up with a chain around your ankle.
Database agnostic: can you use sqlite3 for development and then switch to your production DB by changing a single line of code or configuration?
Platform agnostic: can you run it on Apache, lighttpd, etc.? Could you port it to run in a cloud?
Template agnostic: can you switch out the template system? Let's say you hire dedicated designers and they really want to go with something else.
Documentation: I am not that strict if it's open-source, but there would need to be enough official documentation to enable me to fully understand how to write my own plug-ins, for example. Also look to see if there's source code of working sites using the same framework.
License and source code: do you have access to the source code and are you allowed to modify it? Consider if you can use it commercially! (Even if you have no current plans to do that currently.)
All in all: flexibility. If I am satisfied with all four points, I'm pretty much done. Notice how I didn't have anything about "deadness" in there? If the core design is good and there's easily installable plug-ins for doing every web-dev 3.0-beta buzzword thing you want to do, then I don't care if the last SVN commit was in 2006.
Here are the things I look for in a framework before I decide to use it for a production environment project:
Plenty of well laid out and written documentation. Bad documentation just means I'm wasting time trying to find how everything works. This is OK if I am playing around with some cool new micro framework or something else, but not when it's for a client.
A decently sized community so that you can ask questions, etc. A fun and active IRC channel is a big plus.
Constant iteration of the product. Are bugs being closed or opened on a daily/weekly basis? Probably a good sign.
I can go through the code of the framework and understand what's going on. Good framework code means that the projects longterm life has a better chance of success.
I enjoy working with it. If I play with it for a few hours and it's the worst time of my life, I sure as hell won't be using it for a client.
I can go on, but those are some primary ones off the top of my head.
Besides looking at the framework, you also need to consider a lot of things about yourself (and any other team members) when evaluating the risks:
If the framework is a new, immature, "bleeding-edge" framework, are you going to be willing and able to debug it and fix or work around whatever problems you encounter?
If there is a small community, you'll have to do a lot of this debugging and diagnosis yourself. Will you have time to do that and still meet whatever deadlines you may have?
Have you looked at the framework yourself to determine how good it is, or are you willing to rely on what others say about it? Why do you trust their judgment?
Why do you want to use this rather than the "officially sanctioned Java EE framework"? Is it a pragmatic reason, or just a desire to try something new?
If problems with the framework cause you to miss deadlines or deliver a poor product, how will you talk about it with your boss or customer?
All the signs you've cited could be bad news for your framework choice.
Another thing that I look for are books available at Amazon and such. If there's good documentation available, it means that authors believe it has traction and you'll be able to find users that know it.
The only saving grace I can think of is relative maturity. If the framework or open source component is mature, there's a chance that it does the job as written and doesn't require further extension.
There should still be a bug tracker with some evidence of activity, because no software is without bugs (except for mine). But it need not be a gusher of requests in that case.

Caching solutions for multi-webserver configuration?

I am looking into caching solutions, for a multi webserver configuration. Thought of memcached as being cheap (free) and proven over the years. Microsoft is also developing a caching solution for webfarms, called Velocity, but this is still in CTP2.
There is a distributed caching model used in the configuration service that is part of the .NET Stocktrader sample application. This is a framework that allows you to run multiple nodes with centralised configuration management, load balancing and distributed caching. You can implement the configuration service as is or look through the code and grab what suits you. Worth a look.
When I listened to Scott Hanselman's podcast interview with the StackOverflow team, I was left with the impressions that a. they did use some kind of caching and b. they knew almost nothing about what they were doing in this respect and had fiddled with a few options and then written a blog post or two.
They currently seem to use client-side caching rather half-heartedly (short expiry times on images, for example), and I think they use a lot of ASP.NET user-mode caching, and I can't tell if they use IIS kernel-mode caching. (They didn't seem to be able to tell Scott that, either.)
However, the podcast was a while back, and I was driving at the time, so my memory might be wrong and/or out of date.
You should think HARD before bringing in something like memcached.
Caching can hide performance issues from you ("got a slow running query? just cache it and dont worry about fixing it!")
Invalidating stale data out is a nightmare.
You may spend days chasing bugs that get cleared up when you clear the cache, and it pollutes your code base.
I'm not saying don't do it, but think HARD before you do.
If you can get enough performance by adding a couple* of extra machines (which I think stackoverflow can) then do that and don't worry about caching. It'll be much cheaper in the long run.
*note I don't say 100 machines.

Memcached and Velocity

I'm investigating using either Memcached or Velocity for distributed caching over a cluster of servers after reading Scott Hanselman's answer to this question. Does anybody know of a Microsoft web site that uses Velocity for its caching? If Microsoft aren't using it then does anybody know of any relatively popular web site that's using it?
It would be pretty foolish for any substantial site to go live (in production) on a CTP of a product (edit - good point in the comments - this isn't a hard rule... there are exceptions, for example stackoverflow). Velocity is currently in CTP2, which is good for building out proof-of-concept and planning for product releases, but that's all. Once it is a supported product, I'm sure we will see plenty of usage. Follow the Velocity product team blog (http://blogs.msdn.com/velocity/) for details.
As far as memcached vs Velocity, they have somewhat overlapping but ultimately different purposes. Memcached is not reliable. That is spelled out very clearly in the documentation and by the authors. It is intended to be blazingly fast, cheap to run and simple to administer. Velocity, on the other hand, is much more familiar to the formal enterprise software crowd. It is complex, with a robust API and is better for a more formal data environment.
memcached is not natively supported on Win32. There is a project that aims to port memcached to Win32
http://jehiah.cz/projects/memcached-win32/
And while they have been successful, they lag a couple of versions (point versions at this point) behind the main release line. So if you're on Win32 I think your best bet would be Velocity.
So while I dont have an answer to your question (what sites use Velocity) I think you're better off going with Velocity over memcached.