[ANN] Tarantalk - Smalltalk + Lua + Tuple DB

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[ANN] Tarantalk - Smalltalk + Lua + Tuple DB

Masashi UMEZAWA-2
Hi all,

I've developed a new database connectivity library for Pharo, called Tarantalk.
https://github.com/mumez/Tarantalk

Tarantalk is a connector for Tarantool.
https://tarantool.org/

Tarantool is a Lua engine with tuple persistence. It is like a GemStone in Lua.

Firstly, Tarantalk can be used as a tuple-centric DBMS. You can store
arbitrary Smalltalk objects as tuples, and retrieve them by multiple
indexes.

tarantalk := TrTarantalk connect: 'taran:talk@localhost:3301'.
space := tarantalk ensureSpaceNamed: 'bookmarks'.
primaryIndex := space ensurePrimaryIndexSetting: [ :options | options
tree; partsTypes: #(#string)].
space insert: #('Tarantool' 'https://tarantool.org' 'Tarantool main site').
space insert: #('Pharo' 'http://pharo.org' 'Pharo main site').
primaryIndex selectHaving: #('Pharo').
  " => #(#('Pharo' 'http://pharo.org' 'Pharo main site'))"

What is more interesting is that Tarantalk can call remote Lua
functions and can evaluate Lua expressions.
So you can extend your database system freely with Lua and Smalltalk!

-- Lua
function bookmarkUrls()
    local urls = {}
    for k,v in box.space.bookmarks:pairs() do
        table.insert(urls, v[2])
    end
    return urls
end
box.schema.func.create('bookmarkUrls')

"Smalltalk"
tarantalk call: 'bookmarkUrls'.
  " => #(#('http://pharo.org' 'https://tarantool.org'))"

(tarantalk evalWithReturn: '(require("digest").sha512_hex(...))'
arguments: {'Hello, Smalltalk'}) value.
  " => #('ec599e128831b282f6f7a833834c90a3eb2e61453e5757ca3c2bc8a26e94d7c2f76bd6a7ce33df2427f3821e44a12d26781d39eac6782b59a649950ea59f9e13')"

Moreover, Tarantalk is pretty fast compared to some other NoSQL databases.
https://github.com/mumez/Tarantalk#performance

A simple micro benchmark shows that Tarantalk is about 5x faster than
RediStick Redis client.

Enjoy!
--
[:masashi | ^umezawa]

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Tarantalk - Smalltalk + Lua + Tuple DB

Ben Coman
Looks interesting. Thanks for sharing.
cheers -ben

On Wed, Dec 28, 2016 at 11:42 AM, Masashi UMEZAWA
<[hidden email]> wrote:

> Hi all,
>
> I've developed a new database connectivity library for Pharo, called Tarantalk.
> https://github.com/mumez/Tarantalk
>
> Tarantalk is a connector for Tarantool.
> https://tarantool.org/
>
> Tarantool is a Lua engine with tuple persistence. It is like a GemStone in Lua.
>
> Firstly, Tarantalk can be used as a tuple-centric DBMS. You can store
> arbitrary Smalltalk objects as tuples, and retrieve them by multiple
> indexes.
>
> tarantalk := TrTarantalk connect: 'taran:talk@localhost:3301'.
> space := tarantalk ensureSpaceNamed: 'bookmarks'.
> primaryIndex := space ensurePrimaryIndexSetting: [ :options | options
> tree; partsTypes: #(#string)].
> space insert: #('Tarantool' 'https://tarantool.org' 'Tarantool main site').
> space insert: #('Pharo' 'http://pharo.org' 'Pharo main site').
> primaryIndex selectHaving: #('Pharo').
>   " => #(#('Pharo' 'http://pharo.org' 'Pharo main site'))"
>
> What is more interesting is that Tarantalk can call remote Lua
> functions and can evaluate Lua expressions.
> So you can extend your database system freely with Lua and Smalltalk!
>
> -- Lua
> function bookmarkUrls()
>     local urls = {}
>     for k,v in box.space.bookmarks:pairs() do
>         table.insert(urls, v[2])
>     end
>     return urls
> end
> box.schema.func.create('bookmarkUrls')
>
> "Smalltalk"
> tarantalk call: 'bookmarkUrls'.
>   " => #(#('http://pharo.org' 'https://tarantool.org'))"
>
> (tarantalk evalWithReturn: '(require("digest").sha512_hex(...))'
> arguments: {'Hello, Smalltalk'}) value.
>   " => #('ec599e128831b282f6f7a833834c90a3eb2e61453e5757ca3c2bc8a26e94d7c2f76bd6a7ce33df2427f3821e44a12d26781d39eac6782b59a649950ea59f9e13')"
>
> Moreover, Tarantalk is pretty fast compared to some other NoSQL databases.
> https://github.com/mumez/Tarantalk#performance
>
> A simple micro benchmark shows that Tarantalk is about 5x faster than
> RediStick Redis client.
>
> Enjoy!
> --
> [:masashi | ^umezawa]
>