• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

这是API太了

用户头像
it1352
帮助1

问题说明

有键值存储的大量可用。目前,你必须选择其中之一,并坚持下去。我相信,一个独立的开放式API,而不是由一个key-value存储供应商进行将使存储之间更容易切换。

There are a multitude of key-value stores available. Currently you need to choose one and stick with it. I believe an independent open API, not made by a key-value store vendor would make switching between stores much easier.

所以我建立一个数据存储抽象层(如ODBC而是专注于简单的键值店),从而使他人建立一个应用程序一次,并在必要时修改键值存储。这是API太简单了?

Therefore I'm building a datastore abstraction layer (like ODBC but focused on simpler key value stores) so that someone build an app once, and change key-value stores if necessary. Is this API too simple?

get(Key)
set(Key, Value)
exists(Key)
delete(Key)

由于所有到目前为止,我所看到的的API似乎增加这么多,我想知道很多其他方法怎么是必要的?

As all the APIs I have seen so far seem to add so much I was wondering how many additional methods were necessary?

我已经收到了一些回复说集(空)可以用来删除一个项目,如果获得返回null,这意味着一个项目不存在。这是不好的原因有两个。首先,是不是好混的返回类型和状态,其次,并不是所有语言都有空的概念。参见:

I have received some replies saying that set(null) could be used to delete an item and if get returns null then this means that an item doesn't exist. This is bad for two reasons. Firstly, is it not good to mix return types and statuses, and secondly, not all languages have the concept of null. See:

<一个href=\"http://stackoverflow.com/questions/2324337/do-all-programming-languages-have-a-clear-concept-of-nil-null-or-undefined\">http://stackoverflow.com/questions/2324337/do-all-programming-languages-have-a-clear-concept-of-nil-null-or-undefined

我也希望能够对数据进行多种类型的操作,但据我所知它什么都可以建立在一个关键值存储之上。它是否正确?我应该提供这些增值功能呢?例如:像马preduce,或索引

I do want to be able to perform many types of operation on the data, but as I understand it everything can be built up on top of a key value store. Is this correct? And should I provide these value added functions too? e.g: like mapreduce, or indexes

在内部,我们已经有这种用Erlang和Ruby一个基本的版本,它为我们节省了大量的时间,而且还使我们能够测试不同的关键值存储的特定使用案例

Internally we already have a basic version of this in Erlang and Ruby and it has saved us alot of time, and also enabled us to test performance for specific use cases of different key value stores

正确答案

#1

您的API缺少像hasKey和清除一些有用的功能。你可能想看看,说,Python的破解它, HTTP://docs.python .ORG /教程/ datastructures.html#词典和挑选的附加功能。

Your API lacks some useful functions like "hasKey" and "clear". You might want to look at, say, Python's hack at it, http://docs.python.org/tutorial/datastructures.html#dictionaries, and pick and choose additional functions.

每个人都在说,简单就是好,直到这是真的简单太简单了。

Everyone is saying, "simple is good" and that's true until "simple is too simple."

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhcfickh
系列文章
更多 icon
同类精品
更多 icon
继续加载