English 中文(简体)
分享云层中点子(应用服务器)的数据
原标题:Sharing data between nodes (app servers) in cloud

我在建造一座由单一服务器提供服务的“灰色”/Pylons网络应用程序时,现在我想调查如何在配备某种装货平衡器的若干服务器中推广。

主要的关切当然是服务器方面的状态。 其中包括用户会议数据、用户上载数据(图像等)和海滩。 我希望服务器能够分享海滩,因此,如果其他服务器已经这样做的话,一台服务器就不必做额外工作。 缩小规模可能不会很快成为一个问题,但似乎像一项大型建筑决定那样,在开始时就更能使其具有半权。

关于会议,我可以使用基于厨师的会议:

供用户上载的数据和海滩(目前存放在地方档案系统) 我需要一种不同的办法,我不敢确定哪一种办法最适合。 我所审议的一些备选办法:

  • Distributed filesystem
    • Amazon S3 in particular, since I m targeting Amazon as cloud provider. However, I d like to avoid my code becoming overly vendor-specific, so changing cloud provider later is feasible.
  • [distributed] key-value store, would require to rewrite/abstract-out parts of my code that assume all data goes on filesystem
  • Somehow avoid sharing data at all, load balancer could be very clever to direct requests to nodes that have neccessary user data / cache locally. Wait, this is called sharding, right?
  • Network-accessible filesystem, NFS in particular: NFS directory exported on one (possibly dedicated) node, all others mounting it. Possible problems I can think of:
    • Bandwidth to NFS host could become a bottleneck
    • Race conditions when several clients try to access same files at the same time

我现在考虑与“国家财政预算”挂钩,似乎是最容易的解决办法,可能发挥作用。 但是,如果我不知道,也许还会有更多的警告,使这项决定成为一项短视决定? 你们的经验是什么,什么形式的数据储存和分享你用于云层的 app,预计会横向扩大?

问题回答

caching is easily accomplished using standard memecached - which can be distributed over multiple servers. NFS sounds like a bad idea since you ll need to implement your own locking mechanism to avoid race conditions. I would go for one of the distributed no-sql solutions like cassandra.

我强烈建议你看看一个分布式的关键/价值仓库,而不是国家食品安全局。

I d probably use redis rather than cassandra since you are currently on one system and want to scale up to 2 systems. Cassandra while cool, is designed for systems with more writes than reads, and works best when you have 3 or more nodes. Redis on the other hand works very well with a single node deamon, essentially like memcached but with fallible persistence.

红星很容易在座下使用,但它非常干.,因此,在你提出数百万项要求之前,你就不必担心红星本身的hard缩或缩小规模,但这很可能是最大的问题。 我没有亲自部署,因此我不敢肯定,如果所有数据都失败,而且你不能再重复,那么它会多么有效。 如果你认为可能的话,我会进行调查。

如果你想储存更复杂的数据结构,我看上去的是Mongo或其中之一。





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签