Lightcloud: Distributed key-value database

Source: Internet
Author: User
Tags lua memcached

Plurk.com on February 28 this year open source Lightcloud this distributed key-value database, according to the official website information, has the following characteristics

Based on Tokyo Tyrant (this project appears to be another network interface for a database system called Tokyo Cabinet). Tokyo Tyrant is one of the fastest key-value databases and has been developed for several years and is applied in n sites.

Very good performance (can be compared with memcached)

Millions data can be stored on a small number of servers

Simple to extend by adding nodes

Nodes can be backed up by Master-master replication. Easy to add automatic error recovery and load Balancing features

Scaling using the Lua language

No shutdown required to back up and restore data

The Lightcloud Manager tool makes it easy to manage nodes, back up nodes, and view status

Very small (client approximately 500 lines, manager about 400 lines)

Pure python development, but easy to migrate to other languages

And the difference between memcached and MySQL.

Memcached is a caching server, while the data stored in Lightcloud is persistent (in the end, the database).

MySQL and other relational database server storage key-value pairs are inefficient (certainly not lightcloud this dedicated high).

and memcached Performance Comparison

Make 10,000 sets and get for Lightcloud and memcached

Elapsed for 10000 gets: 1.74538516998 seconds  [memcache]
Elapsed for 10000 gets: 3.57339096069 seconds [lightcloud]

Elapsed for 10000 sets: 1.88236999512 seconds [memcache]
Elapsed for 10000 sets: 9.23674893379 seconds [lightcloud]

It is worth noting that memcached is fully operational in memory, while Lightcloud is read and write to the hard drive.

The data from Tokyo Tyrant's official website was even more alarming (Lightcloud increased network and Python language execution overhead on Tokyo tyrant)

1 million GETS in < 0.5 seconds

1 million SETS in < 0.5 seconds

Using Lua for Scaling

The LUA extension appears to be provided by Tokyo Tyrant

Here is a simple extension that expands out a INCR command

function incr(key, value)
  value = tonumber(value)
  if not value then
   return nil
  end
  local old = tonumber(_get(key))
  if old then
   value = value + old
  end
  if not _put(key, value) then
   return nil
  end
  return value
end

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.