在Tar​​antool中,您可以将超快速数据库和一个应用程序结合在一起使用。这很容易

五年前,我尝试使用Tarantool,但后来却没想到。但是最近我主持了一个网络研讨会,讨论了Hadoop,以及MapReduce的工作原理。有人问我一个问题:“为什么不使用Tarantool来完成这项任务?”



为了好奇,我决定返回到它,测试最新版本-这次我真的很喜欢这个项目。现在,我将向您展示如何在Tarantool中编写一个简单的应用程序,加载它并测试性能,并且您将看到那里的所有内容多么容易和酷。







什么是Tarantool



Tarantool将自己定位为超快速数据库。您可以在此处推送任何数据。另外,对它们进行分片复制-即在多个服务器之间拆分大量数据,并合并来自它们的结果-以生成容错的“主-主”捆绑包。



其次,它是一个应用服务器。您可以在上面编写应用程序,使用数据,例如,根据某些规则在后台删除旧记录。您可以直接在Tarantula中编写一个Http服务器,该服务器将处理数据:发出它们的数量,在其中写入新数据,然后将其全部减少至主服务器。



我读了一篇有关这些家伙如何建立一个300行的消息队列的文章,这些消息队列只是泪流满面-他们的最低性能为每秒20,000条消息。在这里,您确实可以扩展和编写一个非常大的应用程序,并且它不会像在PostgreS中那样存储。



关于这样的服务器,很简单,我将尝试在本文中进行描述。



安装



为了进行测试,我启动了三个标准虚拟机-一个20 GB的硬盘驱动器,Ubuntu 18.04。 2个虚拟CPU和4 GB内存。



我们安装Tarantool-运行bash脚本或添加存储库,然后执行install Tarantool的安装。脚本的链接是(curl -L https://tarantool.io/installer.sh | VER = 2.4 sudo -E bash)。我们有以下命令:



tarantoolctl-用于管理Tarantula实例的主要命令。

/ etc / tarantool-所有配置都在这里。

var / log / tarantool-日志存储在此处。

var / lib / tarantool-这是存储数据的位置,然后将其拆分为实例。



有实例可用和实例启用的文件夹-它包含将要启动的文件夹-一个带有lua代码的实例配置文件,该文件描述了它侦听的端口,可用的内存,Vinyl引擎设置以及启动时触发的代码服务器,分片,队列,删除过时的数据等。



实例的工作方式类似于PostgreS。例如,您要运行一个挂在不同端口上的数据库的多个副本。事实证明,在同一服务器上启动了多个数据库实例,这些实例挂在不同的端口上。它们可以具有完全不同的设置-一个实例实现一个逻辑,第二个实例-另一个。



实例管理



我们有tarantoolctl命令,可用于管理Tarantula实例。例如,tarantoolctl检查示例将检查配置文件并说-如果没有语法错误,则该文件正常。



您可以看到实例的状态-tarantoolctl状态示例。您可以用相同的方式启动,停止和重新启动。



运行实例时,有两种连接方法。



1.管理控制台



默认情况下,Tarantool打开一个套接字,在该套接字中传输纯ASCII文本以控制Tarantula。与控制台的连接始终是在admin用户的情况下完成的,没有身份验证,因此您无需将控制台端口移出即可管理Tarantula。



要以这种方式连接,请输入Tarantoolctl输入实例名称。该命令将启动控制台并以管理员用户身份连接。切勿将控制台端口暴露在外面-最好将其作为单元插座放置。这样,只有那些对套接字具有写访问权的人才能连接到塔兰图拉毒蛛。



行政事务需要此方法。要处理数据,请使用第二种方法-二进制协议。



2.使用二进制协议连接到特定端口配置中



有一个listen指令,它将打开端口以进行外部通信。该端口与二进制协议一起使用,并在其中启用了身份验证。



对于此连接,使用tarantoolctl connect to端口号。使用它,您可以连接到远程服务器,使用身份验证并提供各种访问权限。



数据记录器和Box模块



由于Tarantool既是数据库又是应用程序服务器,因此它具有各种模块。我们对box模块感兴趣-它实现了数据处理。当您将某些内容写入框时,Tarantool会将数据写入磁盘,将其存储在内存中或对其进行其他处理。



记录



例如,我们进入box模块并调用box.once函数。初始化服务器后,它将使Tarantool运行我们的代码。我们创建一个空间来存储我们的数据。



local function bootstrap()
    local space = box.schema.create_space('example')
    space:create_index('primary')
    box.schema.user.grant('guest', 'read,write,execute', 'universe')

    -- Keep things safe by default
    --  box.schema.user.create('example', { password = 'secret' })
    --  box.schema.user.grant('example', 'replication')
    --  box.schema.user.grant('example', 'read,write,execute', 'space', 'example')
end


之后,我们创建一个主索引-primary-通过它可以搜索数据。默认情况下,如果未指定任何参数,则将使用引物索引的每个条目中的第一个字段。



然后,我们向来宾用户授予许可,然后通过二进制协议进行连接。允许在整个实例上进行读取,写入和执行。



与常规数据库相比,这里的一切都很简单。我们有一个空间-一个仅存储数据的区域。每个条目称为元组。它包装在MessagePack中。这是一种非常酷的格式-它是二进制文件,占用的空间更少-18个字节对27个字节。使用







起来非常方便。几乎每一行,每条数据记录都可以具有完全不同的列。



我们可以使用Box.space命令查看所有空间。要选择特定实例,请编写box.space示例并获取有关其的完整信息。



Tarantool具有两个内置引擎:Memory和Vinyl。内存将所有数据存储在内存中。因此,一切工作都简单而迅速。数据被转储到磁盘,并且还有预写日志机制,因此,如果服务器崩溃,我们将不会丢失任何信息。



Vinyl以更熟悉的形式将数据存储在磁盘上-也就是说,您可以存储的数据多于我们的内存,Tarantula将从磁盘读取数据。



现在,我们将使用内存。



unix/:/var/run/tarantool/example.control> box.space.example
---
- engine: memtx
  before_replace: 'function: 0x41eb02c8'
  on_replace: 'function: 0x41eb0568'
  ck_constraint: []
  field_count: 0
  temporary: false
  index:
    0: &0
      unique: true
      parts:
      - type: unsigned
        is_nullable: false
        fieldno: 1
      id: 0
      space_id: 512
      type: TREE
      name: primary
    primary: *0
  is_local: false
  enabled: true
  name: example
  id: 512
...

unix/:/var/run/tarantool/example.control>


索引:



应该为任何空间创建主索引,因为没有主索引将无法工作。与任何数据库一样,我们创建第一个字段-记录ID。



零件:



在这里,我们指示索引的组成。它由一个部分组成-我们将使用的第一个字段是无符号的,一个正整数。我从文档中记得,最大数量可以是18亿亿。好厉害



然后,我们可以使用insert命令插入数据。



unix/:/var/run/tarantool/example.control> box.space.example:insert{1, 'test1', 'test2'}
---
- [1, 'test1', 'test2']
...

unix/:/var/run/tarantool/example.control> box.space.example:insert{2, 'test2', 'test3', 'test4'}
---
- [2, 'test2', 'test3', 'test4']
...

unix/:/var/run/tarantool/example.control> box.space.example:insert{3, 'test3'}
---
- [3, 'test3']
...

unix/:/var/run/tarantool/example.control> box.space.example:insert{4, 'test4'}
---
- [4, 'test4']
...

unix/:/var/run/tarantool/example.control>


第一个字段用作主键,因此它必须是唯一的。我们不受列数的限制,因此我们可以插入任意多的数据。它们以我上面描述的MessagePack格式指定。



数据输出



然后,我们可以使用select命令显示数据。



使用键{1}进行Box.example.select将显示所需的记录。如果我们省略键,我们将看到我们拥有的所有记录。它们的列数都不同,但是原则上这里没有列的概念-字段号。



绝对会有很多数据。例如,我们需要在第二个字段中搜索它们。为此,我们创建了一个新的二级索引。




box.space.example:create_index( ‘secondary’, { type = ‘TREE’, unique = false, parts = {{field = 2, type =’string’} }}) 


我们使用Create_index命令。

我们称它为次要的。



之后,您需要指定参数。索引类型为TREE。它可能不是唯一的,所以我们输入Unique = false。



然后,我们指示索引包含哪些部分。Field是我们将索引绑定到并指定类型字符串的字段的编号。这样就创建了。



unix/:/var/run/tarantool/example.control> box.space.example:create_index('secondary', { type = 'TREE', unique = false, parts = {{field = 2, type = 'string'}}})
---
- unique: false
  parts:
  - type: string
    is_nullable: false
    fieldno: 2
  id: 1
  space_id: 512
  type: TREE
  name: secondary
...

unix/:/var/run/tarantool/example.control>


现在,我们可以这样称呼它:



unix/:/var/run/tarantool/example.control> box.space.example.index.secondary:select('test1')
---
- - [1, 'test1', 'test2']
...


保存



如果重新启动实例并尝试再次调用数据,我们将看到它们不存在-一切为空。发生这种情况是因为Tarantool创建了检查点并将数据保存到磁盘,但是如果我们在下一次保存之前停止工作,则会丢失所有操作-因为我们将从例如两个小时前的最后一个检查点恢复。



每秒保存也不起作用-因为不断地将20 GB的数据转储到磁盘是一般的。



为此,发明并实施了预写日志概念。它为每个数据更改在一个小的预写日志文件中创建一个条目。



检查点之前的每个条目都保存在其中。对于这些文件,我们设置大小-例如64 MB。填满后,录音开始进入第二个文件。重新启动后,Tarantool从最后一个检查点还原,然后将所有以后的事务翻转直到停止。







要进行这样的记录,您需要在box.cfg设置(在example.lua文件中)中指定选项:



wal_mode = “write”;


数据使用



使用我们现在编写的内容,您可以使用Tarantula来存储数据,并且它将作为数据库非常快速地工作。现在,蛋糕上的樱桃-您能做些什么。



编写应用程序



例如,让我们为狼蛛编写这样的应用程序



见扰流板下的应用
box.cfg {
    listen = '0.0.0.0:3301';
    io_collect_interval = nil;
    readahead = 16320;
    memtx_memory = 128 * 1024 * 1024; -- 128Mb
    memtx_min_tuple_size = 16;
    memtx_max_tuple_size = 128 * 1024 * 1024; -- 128Mb
    vinyl_memory = 128 * 1024 * 1024; -- 128Mb
    vinyl_cache = 128 * 1024 * 1024; -- 128Mb
    vinyl_max_tuple_size = 128 * 1024 * 1024; -- 128Mb
    vinyl_write_threads = 2;
    wal_mode = "write";
    wal_max_size = 256 * 1024 * 1024;
    checkpoint_interval = 60 * 60; -- one hour
    checkpoint_count = 6;
    force_recovery = true;
    log_level = 5;
    log_nonblock = false;
    too_long_threshold = 0.5;
    read_only   = false
}

local function bootstrap()
    local space = box.schema.create_space('example')
    space:create_index('primary')

    box.schema.user.create('example', { password = 'secret' })
    box.schema.user.grant('example', 'read,write,execute', 'space', 'example')

    box.schema.user.create('repl', { password = 'replication' })
    box.schema.user.grant('repl', 'replication')
end

-- for first run create a space and add set up grants
box.once('replica', bootstrap)

-- enabling console access
console = require('console')
console.listen('127.0.0.1:3302')

-- http config
local charset = {}  do -- [0-9a-zA-Z]
    for c = 48, 57  do table.insert(charset, string.char(c)) end
    for c = 65, 90  do table.insert(charset, string.char(c)) end
    for c = 97, 122 do table.insert(charset, string.char(c)) end
end

local function randomString(length)
    if not length or length <= 0 then return '' end
    math.randomseed(os.clock()^5)
    return randomString(length - 1) .. charset[math.random(1, #charset)]
end

local http_router = require('http.router')
local http_server = require('http.server')
local json = require('json')

local httpd = http_server.new('0.0.0.0', 8080, {
    log_requests = true,
    log_errors = true
})

local router = http_router.new()

local function get_count()
 local cnt = box.space.example:len()
 return cnt
end

router:route({method = 'GET', path = '/count'}, function()
    return {status = 200, body = json.encode({count = get_count()})}
end)

router:route({method = 'GET', path = '/token'}, function()
    local token = randomString(32)
    local last = box.space.example:len()
    box.space.example:insert{ last + 1, token }
    return {status = 200, body = json.encode({token = token})}
end)

prometheus = require('prometheus')

fiber = require('fiber')
tokens_count = prometheus.gauge("tarantool_tokens_count",
                              "API Tokens Count")

function monitor_tokens_count()
  while true do
    tokens_count:set(get_count())
    fiber.sleep(5)
  end
end
fiber.create(monitor_tokens_count)

router:route( { method = 'GET', path = '/metrics' }, prometheus.collect_http)

httpd:set_router(router)
httpd:start()




我们在lua中声明一些定义符号的标签。需要该板来产生随机线。



local charset = {}  do -- [0-9a-zA-Z]
    for c = 48, 57  do table.insert(charset, string.char(c)) end
    for c = 65, 90  do table.insert(charset, string.char(c)) end
    for c = 97, 122 do table.insert(charset, string.char(c)) end
end


之后,我们声明一个函数-randomString并在括号中给出长度值。



local function randomString(length)
    if not length or length <= 0 then return '' end
    math.randomseed(os.clock()^5)
    return randomString(length - 1) .. charset[math.random(1, #charset)]
end


然后,我们将http路由器和http服务器连接到我们的Tarantula服务器JSON,并将其发送给客户端。



local http_router = require('http.router')
local http_server = require('http.server')
local json = require('json')


之后,我们从http服务器所有接口上的端口8080开始,它将记录所有请求和错误。



local httpd = http_server.new('0.0.0.0', 8080, {
    log_requests = true,
    log_errors = true
})


接下来,我们声明路由,如果使用GET方法的请求到达端口8080 / count,则从一行开始调用该函数。它返回状态-200、404、403或我们指定的任何状态。



router:route({method = 'GET', path = '/count'}, function()
    return {status = 200, body = json.encode({count = get_count()})}
end)


在正文中,我们返回json.encode,在其中我们指定count和getcount,这将被调用并显示数据库中的记录数。



方法二



router:route({method = 'GET', path = '/token'}, function() 
    local token = randomString(32) 
    local last = box.space.example:len() 
    box.space.example:insert{ last + 1, token } 
    return {status = 200, body = json.encode({token = token})}
end)


其中在线路路由器:路线({方法=“ GET”,路径=“/令牌”},()的函数,我们称之为功能和生成令牌。



酒吧本地标记= randomString(32) -是32个字符Randomnaya字符串。

线local last = box.space.example:len()我们取出最后一个元素,

然后在box.space.example行中:insert {last + 1,token}我们写入数据库,也就是说,我们只需将ID增加1。这可以完成顺便说一句,不仅如此笨拙,在塔兰图拉毒蛛中有这种情况的序列,我们



在那里写了一个令牌,



因此,我们在一个文件中编写了一个应用程序,在其中您可以立即处理数据,而box模块将为您完成所有脏活...



它侦听http并处理数据,所有内容都在一个实例中-应用程序和数据都在一个实例中。因此,一切发生得足够快。



要运行,我们安装http模块:



我们如何做到的,看一下扰流板
root@test2:/# tarantoolctl rocks install http
Installing http://rocks.tarantool.org/http-scm-1.src.rock
Missing dependencies for http scm-1:
   checks >= 3.0.1 (not installed)

http scm-1 depends on checks >= 3.0.1 (not installed)
Installing http://rocks.tarantool.org/checks-3.0.1-1.rockspec

Cloning into 'checks'...
remote: Enumerating objects: 28, done.
remote: Counting objects: 100% (28/28), done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 28 (delta 1), reused 16 (delta 1), pack-reused 0
Receiving objects: 100% (28/28), 12.69 KiB | 12.69 MiB/s, done.
Resolving deltas: 100% (1/1), done.
Note: checking out '580388773ef11085015b5a06fe52d61acf16b201'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

No existing manifest. Attempting to rebuild...
checks 3.0.1-1 is now installed in /.rocks (license: BSD)

-- The C compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found TARANTOOL: /usr/include (found version "2.4.2-80-g18f2bc82d")
-- Tarantool LUADIR is /.rocks/share/tarantool/rocks/http/scm-1/lua
-- Tarantool LIBDIR is /.rocks/share/tarantool/rocks/http/scm-1/lib
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    version


-- Build files have been written to: /tmp/luarocks_http-scm-1-V4P9SM/http/build.luarocks
Scanning dependencies of target httpd
[ 50%] Building C object http/CMakeFiles/httpd.dir/lib.c.o
In file included from /tmp/luarocks_http-scm-1-V4P9SM/http/http/lib.c:32:0:
/tmp/luarocks_http-scm-1-V4P9SM/http/http/lib.c: In functiontpl_term’:
/usr/include/tarantool/lauxlib.h:144:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
    (*(B)->p++ = (char)(c)))
    ~~~~~~~~~~~^~~~~~~~~~~~
/tmp/luarocks_http-scm-1-V4P9SM/http/http/lib.c:62:7: note: in expansion of macro ‘luaL_addchar’
       luaL_addchar(b, '\\');
       ^~~~~~~~~~~~
/tmp/luarocks_http-scm-1-V4P9SM/http/http/lib.c:63:6: note: here
      default:
      ^~~~~~~
In file included from /tmp/luarocks_http-scm-1-V4P9SM/http/http/lib.c:39:0:
/tmp/luarocks_http-scm-1-V4P9SM/http/http/tpleval.h: In functiontpe_parse’:
/tmp/luarocks_http-scm-1-V4P9SM/http/http/tpleval.h:147:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
    type = TPE_TEXT;
    ~~~~~^~~~~~~~~~
/tmp/luarocks_http-scm-1-V4P9SM/http/http/tpleval.h:149:3: note: here
   case TPE_LINECODE:
   ^~~~
In file included from /tmp/luarocks_http-scm-1-V4P9SM/http/http/lib.c:40:0:
/tmp/luarocks_http-scm-1-V4P9SM/http/http/httpfast.h: In functionhttpfast_parse’:
/tmp/luarocks_http-scm-1-V4P9SM/http/http/httpfast.h:372:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
                 code = 0;
                 ~~~~~^~~
/tmp/luarocks_http-scm-1-V4P9SM/http/http/httpfast.h:374:13: note: here
             case status:
             ^~~~
/tmp/luarocks_http-scm-1-V4P9SM/http/http/httpfast.h:393:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
                 state = message;
                 ~~~~~~^~~~~~~~~
/tmp/luarocks_http-scm-1-V4P9SM/http/http/httpfast.h:395:13: note: here
             case message:
             ^~~~
[100%] Linking C shared library lib.so
[100%] Built target httpd
[100%] Built target httpd
Install the project...
-- Install configuration: "Debug"
-- Installing: /.rocks/share/tarantool/rocks/http/scm-1/lua/http/VERSION.lua
-- Installing: /.rocks/share/tarantool/rocks/http/scm-1/lib/http/lib.so
-- Installing: /.rocks/share/tarantool/rocks/http/scm-1/lua/http/server/init.lua
-- Installing: /.rocks/share/tarantool/rocks/http/scm-1/lua/http/server/tsgi_adapter.lua
-- Installing: /.rocks/share/tarantool/rocks/http/scm-1/lua/http/nginx_server/init.lua
-- Installing: /.rocks/share/tarantool/rocks/http/scm-1/lua/http/router/init.lua
-- Installing: /.rocks/share/tarantool/rocks/http/scm-1/lua/http/router/fs.lua
-- Installing: /.rocks/share/tarantool/rocks/http/scm-1/lua/http/router/matching.lua
-- Installing: /.rocks/share/tarantool/rocks/http/scm-1/lua/http/router/middleware.lua
-- Installing: /.rocks/share/tarantool/rocks/http/scm-1/lua/http/router/request.lua
-- Installing: /.rocks/share/tarantool/rocks/http/scm-1/lua/http/router/response.lua
-- Installing: /.rocks/share/tarantool/rocks/http/scm-1/lua/http/tsgi.lua
-- Installing: /.rocks/share/tarantool/rocks/http/scm-1/lua/http/utils.lua
-- Installing: /.rocks/share/tarantool/rocks/http/scm-1/lua/http/mime_types.lua
-- Installing: /.rocks/share/tarantool/rocks/http/scm-1/lua/http/codes.lua
http scm-1 is now installed in /.rocks (license: BSD)

root@test2:/#




我们还需要运行普罗米修斯:



root@test2:/# tarantoolctl rocks install prometheus
Installing http://rocks.tarantool.org/prometheus-scm-1.rockspec

Cloning into 'prometheus'...
remote: Enumerating objects: 19, done.
remote: Counting objects: 100% (19/19), done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 19 (delta 2), reused 5 (delta 0), pack-reused 0
Receiving objects: 100% (19/19), 10.73 KiB | 10.73 MiB/s, done.
Resolving deltas: 100% (2/2), done.
prometheus scm-1 is now installed in /.rocks (license: BSD)

root@test2:/#


我们开始并可以访问模块



root@test2:/# curl -D - -s http://127.0.0.1:8080/token
HTTP/1.1 200 Ok
Content-length: 44
Server: Tarantool http (tarantool v2.4.2-80-g18f2bc82d)
Connection: keep-alive

{"token":"e2tPq9l5Z3QZrewRf6uuoJUl3lJgSLOI"}

root@test2:/# curl -D - -s http://127.0.0.1:8080/token
HTTP/1.1 200 Ok
Content-length: 44
Server: Tarantool http (tarantool v2.4.2-80-g18f2bc82d)
Connection: keep-alive

{"token":"fR5aCA84gj9eZI3gJcV0LEDl9XZAG2Iu"}

root@test2:/# curl -D - -s http://127.0.0.1:8080/count
HTTP/1.1 200 Ok
Content-length: 11
Server: Tarantool http (tarantool v2.4.2-80-g18f2bc82d)
Connection: keep-alive

{"count":2}root@test2:/#


/ count给我们200状态

/令牌发行令牌并将其写入数据库。



测试速度



让我们运行一个包含50,000个查询的基准测试。将有500个竞争要求。



root@test2:/# ab -c 500 -n 50000 http://127.0.0.1:8080/token
This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Completed 40000 requests
Completed 45000 requests
Completed 50000 requests
Finished 50000 requests


Server Software:        Tarantool
Server Hostname:        127.0.0.1
Server Port:            8080

Document Path:          /token
Document Length:        44 bytes

Concurrency Level:      500
Time taken for tests:   14.578 seconds
Complete requests:      50000
Failed requests:        0
Total transferred:      7950000 bytes
HTML transferred:       2200000 bytes
Requests per second:    3429.87 [#/sec] (mean)
Time per request:       145.778 [ms] (mean)
Time per request:       0.292 [ms] (mean, across all concurrent requests)
Transfer rate:          532.57 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   10 103.2      0    3048
Processing:    12   69 685.1     15   13538
Waiting:       12   69 685.1     15   13538
Total:         12   78 768.2     15   14573

Percentage of the requests served within a certain time (ms)
  50%     15
  66%     15
  75%     16
  80%     16
  90%     16
  95%     16
  98%     21
  99%     42
 100%  14573 (longest request)
root@test2:/#


令牌已发行。而且我们一直在记录数据。 99%的请求在42毫秒内完成。因此,在一台小型计算机上,每秒有3500个请求,其中有2个内核和4 GB的内存。



您还可以选择大约50,000个令牌并查看其价值。



您不仅可以使用http,还可以运行处理数据的后台功能。另外,还有各种触发器。例如,您可以在更新时调用函数,检查某些内容-解决冲突。



您可以直接在数据库服务器本身中编写应用程序脚本,而不受任何限制,连接任何模块并实现任何逻辑。



应用程序服务器可以访问外部服务器,收集数据并将其存储在其数据库中。来自该数据库的数据将被其他应用程序使用。



这将由Tarantula本身完成,您不必编写单独的应用程序。



最后



这只是很多工作的第一步。第二篇文章将很快在Mail.ru Group博客上发布,我们一定会在本文中添加一个链接。



如果您有兴趣参加我们在线创建此类活动并实时提问的活动,请加入DevOps by REBRAIN频道



如果您需要迁移到云或对基础架构有疑问,请随时提出请求



附言:我们每月有2次免费审核,也许您的项目就在其中。



All Articles