游戏邦在:
杂志专栏:
gamerboom.com订阅到鲜果订阅到抓虾google reader订阅到有道订阅到QQ邮箱订阅到帮看

社交游戏使用NoSQL数据库的4个理由

发布时间:2012-08-14 16:47:39 Tags:,,,

作者:Bob Wiederhold

社交游戏是一个“成功的”行业。已制作出炉的社交游戏数量庞大,但真正把规模做大的并不多。每一个开发商的梦想就是让自己的游戏成为普及率最高、下载量最大、DAU(日活跃用户数)最多的游戏。

因此,选择一个合适的数据库对于游戏的成功就格外重要了。许多数据库都能支持少量的DAU。但是,当游戏玩家暴涨时,最好能有一个始终传递高性能同时支持更大量DAU的数据库。否则,如果你的游戏会因不能拓展而被玩家抛弃,那么你制作出这么一款有趣的游戏的努力就付诸东流了。

因为性能和延展性的优势,NoSQL数据库越来越多地用于社交游戏。但开源代码的NoSQL数据库项目似乎就像雨后春笋,在世界各地萌发,要从中做出选择可能是件棘手的工作。为社交游戏选择正确的NoSQL数据库可能非常困难,因为有各种各样的分类,如key-value、文件和纵列等。但哪一类才是最适合社交游戏的呢?

zynga-chart(from devopsangle.com)

zynga-chart(from devopsangle.com)

key-value和文件型数据库可以增强大多数NoSQL对社交游戏的资源配置能力,这很大程度上是因为它们平衡以下4个关键指标:

1、NoSQL支持高性能。文件和key-value数据模式在内存和硬盘(文件)的单一物理空间中保存相关数据。这使用户可以始终快速地获取数据——避免读取和写入时时发生延迟。现在的游戏玩家不能忍受哪怕是最短的中断时间,否则他们就会认为程序很失败,然后就不再使用了。你要寻找的就是一种可以稳定维持毫秒读取和写入的数据库。

2、NoSQL具有动态弹性。因为文件方法将记录保存在“单独的地方”(一个文件放在邻近的物理位置中),所以要从一个服务器把数据转移到另一个上,同时保持连贯性、不发生中断,就要容易得多了。为了使数据库的工作能力与程序的总体性能要求有效匹配,必须在服务器之间转移数据,数据库必须能够增加或移除群集。如此操作的同时又不中断游戏的收益流,这对游戏的盈利性有重要影响。只需轻轻点击一个按扭就把服务器添加到数据层中,不需要改变程序本身,你要寻找的就是这样的数据库。

3、NoSQL具有架构灵活性。虽然所有NoSQL数据库都具有架构灵活性,但key-value和文件型数据库在这方面的优势更明显得多。在增加新纵列和分类时,纵列型数据库仍然需要维护。key-value或文件型数据库不需要数据库维护就能改变数据库架构。

4、NoSQL支持询问变更。用询问表现力(向数据库发问的能力,比如,“返回一份记录玩家于去年购买向日葵种子的所有农场的列表”)平衡架构灵活性往往是很重要的。文件型数据库在数据库层上提供索引和查询,而key-value型数据库只允许访问与给定键相关的数据记录。

如果你在考虑开发一款社交游戏,请考虑一下支持游戏成长的基础设施要求。正如我们所说的,管理社交游戏中的数据是最重要,也是很灵活的事。并行随机读取和吞吐率、数据格式灵活性都是NoSQL文体型数据库能应对的。你的数据库技术是最重要的基础建设组成部分。(本文为游戏邦/gamerboom.com编译,拒绝任何不保留版权的转载,如需转载请联系:游戏邦

4 Reasons Makes Sense for Powering Today’s Social Games

by Bob Wiederhold

Social gaming is a “hits” business.  There are a large number of social games that are developed but a relatively small number make it big.  Every developer’s dream is to have their game go viral and shoot to the top of the download and DAU charts.

In this environment, selecting the right database is more critical to a game’s success than you might think. Many databases support a small number of DAUs.  But, when your game goes viral, you better have a database that delivers consistently high performance while scaling to support a dramatically higher number of DAUs.  Otherwise, all the hard work done to create a compelling game is wasted because your game couldn’t scale and players deserted the game in frustration.

Due to their performance and scalability advantages, NoSQL databases are increasingly being used for social games. But it seems like open-source NoSQL database projects are popping up all over the place and sorting through the options can be daunting. Selecting the right NoSQL database for your social game can be difficult, as there are various classes including key-value, document, and columnar. But which is right for your social game?

The truth is, key-value and document-oriented databases power the majority of NoSQL deployments behind social games, largely due to their balance of four key criteria:

NoSQL Supports High Performance. The document and key-value data model keeps related data in a single physical location in memory and on disk (a document). This allows consistently low-latency access to the data — reads and writes happen with little delay. Today’s game players can’t experience even the slightest downtime or else applications are deemed unsuccessful and adoption declines. Look for a database that consistently provides sub millisecond reads and writes, even as you scale.

NoSQL Provides Dynamic Elasticity. Because the document approach keeps records in “a single place” (one document in a contiguous physical location), it is much easier to move the data from one server to another while maintaining consistency and no downtime. Moving data between servers is required to add and remove cluster capacity to cost-effectively match the aggregate performance needs of the application to the performance capability of the database. Doing this without stopping the revenue flow of the game can make a big difference in game profitability.  Look for a database that allows you to add more servers to your data tier with the click of a button and doesn’t require any application changes.

NoSQL Has Schema Flexibility. While all NoSQL databases provide schema flexibility, key-value and document-oriented databases enjoy the most by far. Column-oriented databases still require maintenance to add new columns and to group them. A key-value or document-oriented database requires no database maintenance to change the database schema.

NoSQL Supports Query Changes. Balancing schema flexibility with query expressiveness (the ability to ask the database questions, for example, “return me a list of all the farms in which a player purchased a sunflower seeds last year”) is often important. While a document database provide indexing and querying at the database level, a key-value database only permits accessing the data record associated with a given key.

If you are considering building a social game, think about the infrastructure requirements to support growth. As we discussed, the most important issues for managing data in social games are elasticity, concurrent random read latency and throughput, and data format flexibility. All of which, NoSQL document-oriented databases address.

Your choice of database technology is arguably the most important infrastructure component decision you will make.

About the Author

Bob Wiederhold is the CEO of Couchbase and has more than 25 years of high technology experience. Until an acquisition by IBM in 2008, Bob served as chairman, CEO, and president of Transitive Corporation, the worldwide leader in cross-platform virtualization with over 20 million users. Previously, he was president and CEO of Tality Corporation, the worldwide leader in electronic design services, whose revenues and size grew to almost $200 million and had 1,500 worldwide employees. Bob held several executive general management positions at Cadence Design Systems, Inc., an electronic design automation company, which he joined in 1985 as an early stage start-up and helped to grow to more than $1.5 billion during his 13 years at the company. Bobalso headed High Level Design Systems, a successful electronic design automation start-up that was acquired by Cadence in 1996. Bob has extensive board experience having served on both public (Certicom, HLDS) and private company boards (Snaketech, Tality, Transitive, FanfareGroup).(source:devopsangle)


上一篇:

下一篇: