问题标签 [tarantool]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
856 浏览

tarantool - 在 tarantool 中存储日期和时间

假设我需要元组中的一个字段,该字段应该是带时间的日期。Tarantool不支持开箱即用的日期和时间类型。

我看到两个解决方案:

  1. 将日期和时间存储为字符串并解析它。
  2. 以纪元秒为单位存储日期和时间,并在需要时进行转换。

在 Tarantool 中处理日期和时间的最佳解决方案是什么?

0 投票
2 回答
2137 浏览

database - Difference between Redis AOF and Tarantool WAL log

I was reading this article about Tarantool and they seem to say that AOF and WAL log are not working the same way.

Tarantool: besides snapshots, it has a full-scale WAL (write ahead log). So it can secure data persistency after each transaction out-of-the-box. Redis: in fact, it has snapshots only. Technically, you have AOF (append-only file, where all the operations are written), but it requires manual control over it, including manual restore after reboot. Simply put, with Redis you need to manually suspend the server now and then, make snapshots and archive AOF.

Could someone explain more clearly what is the different between the 2 strategy and how each work at a high level.

I always assumed that Redis AOF was working the same way to a SQL database transaction log such as implemented in Postgresql but I might have been wrong.

0 投票
1 回答
118 浏览

tarantool - 是否可以从 Tarantool DB 中仅选择键(而不是整个元组)?

是否可以从 Tarantool DB 空间中仅选择键(而不是整个元组)?

有没有类似这样的功能: keys = box.space.tester:select_keys{55}

0 投票
1 回答
172 浏览

lua - Openresty:在初始化时创建到 Tarantool 的连接

我想在init_by_lua_blockor中创建与 Tarantool 数据库的连接init_worker_by_lua_block,然后在每个中使用该创建的连接content_by_lua_block

但是 cosocket api 在指令中被禁用init_*_by_lua*。如何创建一次连接而不是为每个请求创建连接?

0 投票
1 回答
105 浏览

tarantool - Tarantool wal 配置

我们正在使用 Tarantool 1.5 并且对配置选项有疑问:如果我们设置以下选项:

这是否意味着根本不会调用 fsync(2) ?

0 投票
0 回答
579 浏览

cmake - CMake 错误:不支持的架构 -- ppc64。在 PowerPC 上

我有 PowerMac G5。我在上面安装了 Lubuntu xenial。现在我尝试从源代码构建数据库 Tarantool。在这一步cmake .我有以下错误:

是否有可能修复此错误或在 PowerPC 上使用 Linux 没有机会?

0 投票
1 回答
455 浏览

multiple-columns - 如何在 tarantool 中创建可根据多个条件搜索的空间

我们的用例如下

我们将从来源获取文章。
每篇文章都有一定的元数据。元数据有一个字段类别,它是文章可能属于的类别名称(手机、笔记本电脑等)的列表。类似地,元数据有一个关键字字段,其中包含文章可能属于的关键字列表.

以下是我们可能需要的查询

a)获取给定类别的所有文章,并且来自某个来源,位置。来源和位置是文章的元数据字段。
b) 获取给定类别、来源、位置的所有文章。c) 获取给定类别、位置的所有文章。
d) 获取给定关键字、类别、位置的所有文章。

下面是我们如何设计空间。因此,在获取每篇文章后,我们将文章插入文章空间,并根据该文章所属的类别和关键字插入到 category_articles 和 keyword_articles 空间。

以下是我对如何有效地为给定查询模式创建二级索引的几个查询。

a) 对于二级键 {category,source,location},如果我们错过了输入值中的某些部分,那么如果 key 的其他部分相等,行会匹配吗?https://tarantool.org/doc/singlehtml.html#lua-data.index_object.parts
我知道我们不能在输入中指定第一和第三部分,即{'category','location'}作为键?或者我们在第二个位置有一个零。

b)我们能否以更好的方式对模式进行建模,以便有效地查询给定的模式。

文章

urlhash
标题
内容
url
日期

主键:{urlhash}

--
category_articles

id
类别

位置
{urlhash,..}

主键:{id}
辅助键:{类别、来源、位置}

--keyword_articles _

id
关键字
类别

位置
{urlhash,..}

主键:{id}
辅助键:{关键字、类别、来源、位置}

更新:
查询:
box.space.category_articles.index.secondary_key:select{'bollywood',nil,'india'}
输出:

[1, '宝莱坞', 'ht', '印度', ['url1', 'url2']]
[3, '宝莱坞', 'ht', '我们', ['url3', 'url4']]

0 投票
1 回答
127 浏览

tarantool - 主-主 tarantool 复制设置的正确初始脚本是什么?

我正在尝试使用相同的配置文件进行 tarantool 的主-主复制。这是 host1 和 host2 的 tester.lua。

但是当我在 host1 上运行时

在host2上

我发现这个配置文件创建了两个没有复制功能的独立 tarantool。

如果我如下更改 host2 的 tester.lua,它就可以工作。

我想知道如何使用相同的配置文件?

0 投票
2 回答
283 浏览

database-design - 如何在 tarantool 查询中实现 DISTINCT 选项

文章是从 rss 提要中解析出来的,每篇文章都可能分为许多类别。此外,每篇文章都有一些元数据,例如来源、上游等。

下面是我们如何设计空间。每篇文章都插入到文章空间中。


文章空间

网址哈希 | 文章内容
abcdef | {虚拟内容}

主键 urlhash = hash(article.url)。


在 category_articles 空间中,我们根据文章所属的类别多次插入文章

category_articles

来源 | 类别 | 网址哈希 | 时间戳
英国广播公司 | 艺术 | 文章1 | 27777 英国
广播公司 | 移动 | 第 8 条 | 27777 英国
广播公司 | 电话 | 文章3 | 纽约时报 27778
| 声音 | 第七条 | 纽约时报 36667
| 扬声器 | 第七条 | 45556

主键 = {源、类别、urlhash}
辅助键 = {源、类别、时间戳}

我需要给定来源和可能类别的最新文章。以下是我构建查询的方式。

box.space.category_articles.index.secondary:select{{'nyt','speaker'},{ iterator = 'LE', limit = 5 }}

现在我将在结果中两次获得 article7。目前我正在过滤代码中的重复结果。我如何在 tarantool 中有 distinct(urlhash) 类型的选项。

0 投票
0 回答
199 浏览

indexing - Tarantool 多部分位集索引

塔兰图尔 1.6.7-591-g7d4dbbb

我有结构表:

并且需要:

所以我可以创建 256 位 + 128 位 BITSET 索引。我怎么能做到?