Does Seaside scale?

烈酒焚心 提交于 2019-12-03 05:45:53

问题


Seaside is known as "the heretical web framework". One of the points that make it heretical is that it has much shared state. That however is something which, in my current understanding, hinders easy scaling.

Ruby on rails on the other hand shares as less state as possible. It has been known to scale pretty well, even if it is dog slow compared to modern smalltalk vms. flickr uses php and has scaled to an extremly big infrastructure...

So has anybody some experience in the scaling of Seaside?


回答1:


Short answer: you can scale Seaside applications like hell yah

Long answer: In the IT domain, scaling is one thing but it has two dimensions:

  1. horozontal
  2. vertical

Almost everybody thought about scaling in the vertical dimension. That was until intel and friends reached some physical barriers and started to add cores to compensate the current impossibility of adding MHz.

That's when all we started to be more aware of scaling horizontally as the way to go.

Why am I telling you this?

Because Seaside is a smalltalk image running in a VM and that is roughly the same situation of a system in a server of a monocore processor.

Taking that as foundation, you scale web apps by making a cluster of servers. It's the natural thing to do, it's the fault tolerant thing to do, is the topologically intelligent thing to do, is the flexible thing to do, I guess you get the idea...

So, if for scaling, you do the same as intel & friends, you embrace the horizontal way. And it's even cheaper that the vertical way (that will lead you to IBM and Sun servers that are as good as expensive).

RoR applications are typically scaled horizontally. Google has countless cheap servers to do their thing. It works perfectly fine no matter how dramatized people want's to impress you throwing at you a bunch of forgettable twitter whales.

If they talk to you about that, you just be polite and hear what they say but remember this:

  1. perfect is the enemy of the good
  2. the unfinished perfect will never be as value as the good thing done

BTW, Amazon does something like that too (and it kind of couple geolocation so they enhance the chances of attending your requests with the cluster that is closest to your location).

On the other hand, the way Avi scaled dabbledb (Seaside based web application company bought by twitter) was using one vm per customer account (starting up and shutting down those on demand).

Having a lot of state in an image doesn't make scaling impossible nor complicated.

Just different.

The way to go is with a load balancer that uses sticky sessions so you can have one image attenting all the requests of an user session. You make things so any worker-image behind the load balancer can attend any user of a given app. And that's pretty much it.

To be able to do that you need to share the persistent objects among workers. All the users databases needs to be accessible by the workers at anytime and need to deal well with concurrency.

We designed airflowing scalable in that way.

It's economically convenient too because you can start with N very small (depending on the RAM of your first server) and increase it on demand until you reach the hardware limit.

Once you reach the hardware limit, you just add another host to the cluster and recofigure the balancer (and the access to the databases).

Simple, economic and elegant.




回答2:


Ramon Leon shares some of his experience on upscaling seaside on his (excellent) blog. You can read very concrete ideas with sample code about configuring and tuning seaside.

Enjoy :-)

http://onsmalltalk.com/scaling-seaside-more-advanced-load-balancing-and-publishing http://onsmalltalk.com/scaling-seaside-redux-enter-the-penguin http://onsmalltalk.com/stateless-sitemap-in-seaside




回答3:


http://dabbledb.com/ seems to scale quite well. Moreover, one can use GemStone GLASS to run Seaside.




回答4:


On this interview Avi Bryant the creator of Seaside and Co founder DabbleDB Explains how they make it scale.

From what I understand:

  • each customer has it's own Squeak Image.

  • When a customer comes Apache decides based on the user name which port to send it to.

  • Based on the port it starts the customer's Squeak Image.

  • That way it can grow to an infinite number of servers.

I think this solution works for them based on the specifics of their application each customer doesn't need to share info between them. So no need for o centralized DB.

Anyway it is better to watch the interview rather than my half-made summary.




回答5:


Yes, Seaside scales down fantastically. A single developer can create and maintain complex applications for small groups very well.

[coming back to this after a few years] This actually is much more important than scaling up. Computer speed still grows a lot, and 99% of all applications can now run on one machine. Speed of development, and especially maintenance now totally dominates TCO.




回答6:


I would rephrase your question slightly to: does Seaside prevent/discourage you from creating applications that scale? I would say usually no. Seaside doesn't have a default way to store your data (just like php on its doesn't, though Seaside gives you a few extra options) and my impression is interacting with your data tends to be the biggest hurdle when it comes to scaling.

If you want to store your data in a monolithic SQL db, like with rails, you can do that. Or you can use an object database. Or you can use a separate object database for each user, or separate db for each project, or a separate db for each user and project. Or you can store everything in a series of flat files or you can just store your data as objects in your VM's memory.

And because of continuations you don't need re-fetch your data out of your datastore on every webpage call. As when you are using a desktop application you can pull data out of your datastore when your user begins interacting with it, set the appropriate variables, and then use those variables between webcalls until the user is done with the data at which point you can update the datastore. When you don't share state you have to hit the datastore on every single webcall.

Of course this doens't mean scaling is free, it just means you have a larger domain in which to search for scaling solutions.

All that said, for many applications rails will scale much easier simply because there exist large hosting solutions for rails (and php for that matter) that will offer you a huge amount of resources without having to rent and setup a custom box.

These are just my impressions from reading and talking to people.




回答7:


I just reminded that there is link on Pharo's success stories : a Seaside Web application with up to 1000 concurrent users for a large health insurance in Argentina .

Pharo success stories

Issys Tracking:

  • Load balancing: Apache as a proxy/balancer (round robin with session affinity)
  • Server setup: 5 Pharo images on 3 different servers (Linux and Windows 2003)
  • GUI: Heavily AJAX-based. All code written in Smalltak: Seaside 3.0, Seaside JQuery integration and JQWidgetBox.
  • Persistency: Glorp (OR mapper) and OpenDBX (DB client)
  • Databases: large PostgreSQL and MS SQL Server DBs



回答8:


From the Wikipedia article, it's a total pig. Prior to that, it hadn't scaled to the point where I'd heard of it. :)



来源:https://stackoverflow.com/questions/1451989/does-seaside-scale

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!