{"id":13837055,"url":"https://github.com/igrigorik/tokyo-recipes","last_synced_at":"2025-07-11T09:35:20.325Z","repository":{"id":608650,"uuid":"245879","full_name":"igrigorik/tokyo-recipes","owner":"igrigorik","description":"Lean \u0026 mean Tokyo Cabinet recipes (with Lua)","archived":false,"fork":false,"pushed_at":"2010-08-14T15:07:39.000Z","size":111,"stargazers_count":143,"open_issues_count":0,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-08T02:40:30.513Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/igrigorik.png","metadata":{"files":{"readme":"README.rdoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-07-08T04:56:25.000Z","updated_at":"2024-07-05T08:37:51.000Z","dependencies_parsed_at":"2022-08-06T09:16:06.801Z","dependency_job_id":null,"html_url":"https://github.com/igrigorik/tokyo-recipes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/igrigorik/tokyo-recipes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrigorik%2Ftokyo-recipes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrigorik%2Ftokyo-recipes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrigorik%2Ftokyo-recipes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrigorik%2Ftokyo-recipes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igrigorik","download_url":"https://codeload.github.com/igrigorik/tokyo-recipes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrigorik%2Ftokyo-recipes/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264777820,"owners_count":23662555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T15:01:00.026Z","updated_at":"2025-07-11T09:35:20.300Z","avatar_url":"https://github.com/igrigorik.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"Video of FutureRuby talk (\"Lean \u0026 Mean Tokyo Cabinet Recipes\") on InfoQ:\n- http://www.infoq.com/presentations/grigorik-tokyo-cabinet-recipes\n\n\nTokyo Cabinet is a library of routines for managing a database. The database is a simple data file\ncontaining records, each is a pair of a key and a value. Every key and value is serial bytes with \nvariable length. Both binary data and character string can be used as a key and a value. There is \nneither concept of data tables nor data types. Records are organized in hash table, B+ tree, or \nfixed-length array.\n\n== User Defined Functions (UDF's) via Lua\n\nAs of mid '08, Hirabayashi-san embedded Lua into Tokyo Cabinet's runtime to allow for easy\nextensibility of the database. There is a common set of Lua API's built in, which allow you to\ninteract with the underlying data, execute your extensions remotely, or even on a timer. This\nallows us to build additional functionality on top of the Tokyo Cabinet database with Lua! \n\nA few examples you will find in this repository:\n- Simple echo application\n- Implemention of sets operations (like Redis) on top of TC\n- Example of executing Map-Reduce jobs on data within TC\n- TTL / Expire functionality (like memcached) \n- and many others...\n\nPlease do fork the repo and add your recipes to the list! \n\n- Lua API: http://tokyocabinet.sourceforge.net/tyrantdoc/#luaext\n- Announcement blog post: http://alpha.mixi.co.jp/blog/?p=236\n\n== Installing Tokyo Cabinet with Lua\n  yum install lua lua-devel\n\n  git clone git://github.com/etrepum/tokyo-cabinet.git\n  git clone git://github.com/etrepum/tokyo-tyrant.git\n\n  (or get latest files from sourceforge: http://sourceforge.net/projects/tokyocabinet/files/)\n\n  cd tokyo-cabinet\n  ./configure \n  make \u0026\u0026 make install\n\n  cd tokyo-tyrant\n  ./configure --enable-lua\n  make \u0026\u0026 make install\n\n  gem install rufus-tokyo\n\nSource: http://openwferu.rubyforge.org/tokyo.html\n\n== Invoking Lua extensions via the HTTP interface\n\nIt is possible to invoke custom Lua functions via direct HTTP calls. For example, using the\necho-command example, we can invoke the function via:\n\n  $ curl -i -X POST -H “X-TT-XNAME: echo” http://localhost:1978/foo -d “bar”\n\n  HTTP/1.1 200 OK\n  Content-Type: application/octet-stream\n  Content-Length: 7\n\n  foo:bar\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figrigorik%2Ftokyo-recipes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figrigorik%2Ftokyo-recipes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figrigorik%2Ftokyo-recipes/lists"}