{"id":278915,"date":"2016-04-24T01:15:11","date_gmt":"2016-04-23T21:15:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=278915"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=278915","title":{"rendered":"\u0421\u0443\u0433\u0443\u0431\u043e \u043d\u0435\u043d\u0430\u0443\u0447\u043d\u043e: Tarantool vs Golang (\u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438)"},"content":{"rendered":"\n<p>\u0417\u0430\u0447\u0438\u0442\u0430\u043b\u0441\u044f \u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e Tarantool, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0441\u0442\u0430\u043b\u043e. \u0418\u0434\u0435\u044f \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u2014 \u043a\u043e\u0434 \u0440\u044f\u0434\u043e\u043c \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u0445\u0440\u0430\u043d\u0438\u043c\u043a\u0430 \u0432 \u0442\u0430\u043a\u043e\u0439 \u0431\u044b\u0441\u0442\u0440\u043e\u0439 Redis-\u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435.<\/p>\n<p>  <\/p>\n<p>\u0418 \u0447\u0442\u043e-\u0442\u043e \u0437\u0430\u0434\u0443\u043c\u0430\u043b\u0441\u044f \u2014 \u043c\u044b \u0432\u043e\u0442 \u0441\u0435\u0439\u0447\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435 Golang, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043c\u044b\u0441\u043b\u044c \u043f\u0440\u0438\u0448\u043b\u0430 \u0447\u0442\u043e \u043d\u0430 Go \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e, \u0432 \u0442.\u0447. \u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0431\u0430\u0437. \u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Go+LevelDB (\u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438 \u043b\u044e\u0431\u0443\u044e \u0434\u0440\u0443\u0433\u0443\u044e) \u043f\u0440\u043e\u0442\u0438\u0432 Tarantool. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0435\u0449\u0435 Go+RocksDB, \u043d\u043e \u0442\u0430\u043c \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0432\u0441\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u043e\u0442 \u0436\u0435 \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0417\u0430\u0431\u0435\u0433\u0430\u044f \u0432\u043f\u0435\u0440\u0435\u0434 \u2014 \u0432 \u043c\u043e\u0435\u043c \u043d\u0435\u043d\u0430\u0443\u0447\u043d\u043e\u043c \u0442\u0435\u0441\u0442\u0435 \u0432\u044b\u0438\u0433\u0440\u0430\u043b Golang \u0437\u0430 \u0441\u0447\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u044f\u0434\u0435\u0440 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0422\u0430\u0440\u0430\u043d\u0442\u0443\u043b\u043e\u0432 \u0438 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u2014 \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u043c\u043e\u0436\u0435\u0442 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0438 \u0431\u0443\u0434\u0435\u0442, \u043d\u043e \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e\u0431\u044b \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439\u2026 \u041d\u043e, \u043f\u0440\u0430\u0432\u0434\u0430, \u0442\u0443\u0442 \u0443\u0436\u0435 \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044e \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435. <\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 (\u043a\u0440\u0430\u0442\u043a\u043e) <code>wrk -t 4 -c 10<\/code> (4 \u043f\u043e\u0442\u043e\u043a\u0430, 10 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439):<\/p>\n<p>  <\/p>\n<p>Golang:<\/p>\n<p>  <\/p>\n<pre><code>  Latency Distribution      50%  269.00us      99%    1.64ms  Requests\/sec:  25637.26<\/code><\/pre>\n<p>  <\/p>\n<p>Tarantool:<\/p>\n<p>  <\/p>\n<pre><code>  Latency Distribution      50%  694.00us      99%    1.43ms  Requests\/sec:  10377.78<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u043e, \u0422\u0430\u0440\u0430\u043d\u0442\u0443\u043b \u0437\u0430\u043d\u044f\u043b \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443 \u044f\u0434\u0435\u0440, \u0442\u0430\u043a \u0447\u0442\u043e, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0443 \u043d\u0438\u0445 \u2014 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430\u044f. <\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0434 \u0431\u041e\u043b\u044c\u0448\u0435\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 (<code>wrk -t 10 -c 100<\/code>) \u0422\u0430\u0440\u0430\u043d\u0442\u0443\u043b \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u043d\u0430 \u043c\u0435\u0441\u0442\u0435 \u043f\u043e RPS (\u0430 \u0432\u043e\u0442 latency \u043f\u0440\u043e\u0441\u0435\u043b\u0430 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u0435\u0435 \u0447\u0435\u043c \u0443 Golang, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u0435\u0440\u0445\u043d\u044f\u044f \u0447\u0430\u0441\u0442\u044c), \u0430 Golang \u0434\u0430\u0436\u0435 \u043f\u0440\u0438\u043e\u0431\u043e\u0434\u0440\u0438\u043b\u0441\u044f (\u043d\u043e latency \u0442\u043e\u0436\u0435 \u043f\u0440\u043e\u0441\u0435\u043b\u0430, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f).<\/p>\n<p>  <\/p>\n<p>Go:<\/p>\n<p>  <\/p>\n<pre><code>  Latency Distribution      50%    2.85ms      99%    8.12ms Requests\/sec:  33226.52<\/code><\/pre>\n<p>  <\/p>\n<p>Tarantool:<\/p>\n<p>  <\/p>\n<pre><code>  Latency Distribution      50%    8.69ms      99%   73.09ms Requests\/sec:  10763.55<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423 Tarantool \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u0440\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430: secondary index, \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f\u2026 <\/p>\n<p>  <\/p>\n<p>\u0423 Go \u0436\u0435 \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u0430\u044f \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a (<a href=\"https:\/\/golanglibs.com\/\">\u043e\u043a\u043e\u043b\u043e 100 \u0442\u044b\u0441<\/a> \u043f\u043e \u043c\u043e\u0438\u043c \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430\u043c, \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 (\u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c) \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 <a href=\"https:\/\/golanglibs.com\/category\/databases\">\u043c\u043e\u0440\u0435<\/a>), \u0438, \u043a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u043e\u0442 \u0436\u0435 <a href=\"https:\/\/github.com\/blevesearch\/bleve\">bleve<\/a> \u0434\u0430\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043e\u0438\u0441\u043a (\u0447\u0435\u0433\u043e, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u043f\u043e\u043d\u044f\u043b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435\u0442 \u0432 Tarantool). <\/p>\n<p>  <\/p>\n<p>\u041f\u043e \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u044f\u043c \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0422\u0430\u0440\u0430\u043d\u0442\u0443\u043b\u0430 \u0431\u0435\u0434\u043d\u0435\u0435. \u041f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0432\u0441\u0435, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u2014 msgpack, http server, client, json, LRU cache,\u2026 \u0432 Go \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u0431\u0435\u0441\u0441\u0447\u0435\u0442\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445..<\/p>\n<p>  <\/p>\n<p>\u0422.\u0435., \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e, \u0431\u0435\u0437\u0443\u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043d\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043a\u0430 \u0447\u0442\u043e <em>\u043c\u043e\u0439 \u043b\u0438\u0447\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440<\/em> \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 Go, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0435\u0442 \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u044f \u0447\u0442\u043e \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 Tarantool \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0438\u0442 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u0432\u0440\u0435\u043c\u044f, \u0430 Go \u2014 \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u0435\u0439\u0448\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0434 \u043d\u0430 Tarantool, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043a\u043e\u0440\u043e\u0447\u0435, \u043d\u043e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u0437\u0430 \u0441\u0447\u0435\u0442 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u044f\u0437\u044b\u043a\u043e\u043c. \u0412 Go \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u0436\u0435 \u0432\u044b\u0440\u0435\u0437\u0430\u0442\u044c \u0432\u0441\u0435 <code>err<\/code> \u0438 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0436\u0435.<\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u0435\u0442 \u0443 \u043a\u043e\u0433\u043e-\u0442\u043e \u0435\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u043d\u0435\u043d\u0438\u044f?<\/p>\n<p>  <\/p>\n<p>\u0418 \u0435\u0441\u043b\u0438 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u0442\u0435\u0441\u0442.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u2014 HTTP \u0441\u0435\u0440\u0432\u0435\u0440, \u043f\u0440\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u2014 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0438\u043a \u0432 \u0431\u0430\u0437\u0443, \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0435\u0433\u043e \u0436\u0435 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 (\u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u0438\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u043d\u0430 race), \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0437\u0430\u0434 \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 JSON \u0438\u0437 \u044d\u0442\u043e\u0433\u043e value.<\/p>\n<p>  <\/p>\n<p>Golang:<\/p>\n<p>  <\/p>\n<pre><code>\u279c  ~ wrk -t 4 -c 10 -d 5 --latency http:\/\/127.0.0.1:8081\/ Running 5s test @ http:\/\/127.0.0.1:8081\/   4 threads and 10 connections   Thread Stats   Avg      Stdev     Max   +\/- Stdev     Latency   346.71us  600.80us  26.94ms   97.89%     Req\/Sec     6.54k     0.88k   13.87k    73.13%   Latency Distribution      50%  269.00us      75%  368.00us      90%  493.00us      99%    1.64ms   130717 requests in 5.10s, 15.08MB read Requests\/sec:  25637.26 Transfer\/sec:      2.96MB<\/code><\/pre>\n<p>  <\/p>\n<p>Tarantool:<\/p>\n<p>  <\/p>\n<pre><code>\u279c  ~ wrk -t 4 -c 10 -d 5 --latency http:\/\/127.0.0.1:8080\/ Running 5s test @ http:\/\/127.0.0.1:8080\/   4 threads and 10 connections   Thread Stats   Avg      Stdev     Max   +\/- Stdev     Latency   767.53us  209.64us   4.04ms   87.26%     Req\/Sec     2.61k   437.12     3.15k    45.59%   Latency Distribution      50%  694.00us      75%    0.90ms      90%    1.02ms      99%    1.43ms   52927 requests in 5.10s, 8.58MB read Requests\/sec:  10377.78 Transfer\/sec:      1.68MB<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0434 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439:<\/p>\n<p>  <\/p>\n<p>Go:<\/p>\n<p>  <\/p>\n<pre><code>\u279c  ~ wrk -t 10 -c 100 -d 5 --latency http:\/\/127.0.0.1:8081\/ Running 5s test @ http:\/\/127.0.0.1:8081\/   10 threads and 100 connections   Thread Stats   Avg      Stdev     Max   +\/- Stdev     Latency     3.04ms    1.48ms  25.53ms   80.21%     Req\/Sec     3.34k   621.43    12.52k    86.20%   Latency Distribution      50%    2.85ms      75%    3.58ms      90%    4.57ms      99%    8.12ms   166514 requests in 5.01s, 19.21MB read Requests\/sec:  33226.52 Transfer\/sec:      3.83MB<\/code><\/pre>\n<p>  <\/p>\n<p>Tarantool:<\/p>\n<p>  <\/p>\n<pre><code>\u279c  ~ wrk -t 10 -c 100 -d 5 --latency http:\/\/127.0.0.1:8080\/ Running 5s test @ http:\/\/127.0.0.1:8080\/   10 threads and 100 connections   Thread Stats   Avg      Stdev     Max   +\/- Stdev     Latency    10.65ms   14.24ms 269.85ms   98.43%     Req\/Sec     1.09k   128.17     1.73k    94.56%   Latency Distribution      50%    8.69ms      75%   10.50ms      90%   11.36ms      99%   73.09ms   53943 requests in 5.01s, 8.75MB read Requests\/sec:  10763.55 Transfer\/sec:      1.75MB<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0442\u0435\u0441\u0442\u043e\u0432:<\/p>\n<p>  <\/p>\n<p>Go:<\/p>\n<p>  <\/p>\n<pre><code>package main  import (     &quot;encoding\/json&quot;     &quot;fmt&quot;     &quot;io&quot;     &quot;net\/http&quot;      &quot;github.com\/syndtr\/goleveldb\/leveldb&quot;     &quot;github.com\/tecbot\/gorocksdb&quot; )  var db *leveldb.DB  func hello(w http.ResponseWriter, r *http.Request) {     err := db.Put([]byte(&quot;foo&quot;), []byte(&quot;bar&quot;), nil)     if err != nil {         w.WriteHeader(500)         io.WriteString(w, err.Error())         return     }      res, err := db.Get([]byte(&quot;foo&quot;), nil)     if err != nil {         w.WriteHeader(500)         io.WriteString(w, err.Error())         return     }      result, err := json.Marshal(string(res))     if err != nil {         w.WriteHeader(500)         io.WriteString(w, err.Error())         return     }      w.Write(result) }  func main() {     var err error      opts := gorocksdb.NewDefaultOptions()     opts.SetCreateIfMissing(true)     db, err = leveldb.OpenFile(&quot;level.db&quot;, nil)     if err != nil {         panic(err)     }      http.HandleFunc(&quot;\/&quot;, hello)     fmt.Println(&quot;http:\/\/127.0.0.1:8081\/&quot;)     http.ListenAndServe(&quot;127.0.0.1:8081&quot;, nil)  }<\/code><\/pre>\n<p>  <\/p>\n<p>Tarantool:<\/p>\n<p>  <\/p>\n<pre><code>#!\/usr\/bin\/env tarantool  box.cfg{logger = 'tarantool.log'} space = box.space.data if not space then     space = box.schema.create_space('data')     space:create_index('primary', { parts = {1, 'STR'} }) end  local function handler(req)   space:put({'foo','bar'})   local val = space:get('foo')   return req:render({ json = val[2] }) end  print &quot;http:\/\/127.0.0.1:8080\/&quot; require('http.server').new('127.0.0.1', 8080)     :route({ path = '\/' }, handler)     :start()<\/code><\/pre>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/282299\/\"> https:\/\/habrahabr.ru\/post\/282299\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<p>\u0417\u0430\u0447\u0438\u0442\u0430\u043b\u0441\u044f \u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e Tarantool, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0441\u0442\u0430\u043b\u043e. \u0418\u0434\u0435\u044f \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u2014 \u043a\u043e\u0434 \u0440\u044f\u0434\u043e\u043c \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u0445\u0440\u0430\u043d\u0438\u043c\u043a\u0430 \u0432 \u0442\u0430\u043a\u043e\u0439 \u0431\u044b\u0441\u0442\u0440\u043e\u0439 Redis-\u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435.<\/p>\n<p>  <\/p>\n<p>\u0418 \u0447\u0442\u043e-\u0442\u043e \u0437\u0430\u0434\u0443\u043c\u0430\u043b\u0441\u044f \u2014 \u043c\u044b \u0432\u043e\u0442 \u0441\u0435\u0439\u0447\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435 Golang, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043c\u044b\u0441\u043b\u044c \u043f\u0440\u0438\u0448\u043b\u0430 \u0447\u0442\u043e \u043d\u0430 Go \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e, \u0432 \u0442.\u0447. \u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0431\u0430\u0437. \u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Go+LevelDB (\u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438 \u043b\u044e\u0431\u0443\u044e \u0434\u0440\u0443\u0433\u0443\u044e) \u043f\u0440\u043e\u0442\u0438\u0432 Tarantool. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0435\u0449\u0435 Go+RocksDB, \u043d\u043e \u0442\u0430\u043c \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0432\u0441\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u043e\u0442 \u0436\u0435 \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-278915","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/278915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=278915"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/278915\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=278915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=278915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=278915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}