Coder Social home page Coder Social logo

tair's Introduction

Product Overview

Tair is fast-access memory (MDB)/persistent (LDB) storage service. Using a high-performance and high-availability distributed cluster architecture, Tair can meet businesses' high requirements for read/write performance and scalable capacity.

Architecture

System architecture

A Tair cluster has three necessary modules: the ConfigServer, DataServer and client.

Generally, a Tair cluster includes two ConfigServers and multiple DataServers. The two ConfigServers act as primary and standby servers. Heartbeat checks between the DataServer and ConfigServer are used to check live and available DataServers in the cluster to establish the distribution of data in the cluster (comparison table). DataServers store, copy and migrate data as directed by the ConfigServer. When a client is launched, it obtains data distribution information from the ConfigServer. Based on this data distribution information, the client interacts with the corresponding DataServers to perform the user's requests.

In terms of architecture, the role of ConfigServer is similar to the central node in traditional application systems. The whole cluster service depends on the ConfigServer. In fact, Tair's ConfigServers are extremely lightweight. When a working ConfigServer is experiencing downtime, another ConfigServer automatically takes over within seconds. Even if two ConfigServers are experiencing downtime simultaneously, Tair can run normally as long as there is no change in the DataServers. Users only need to connect apps to ConfigServers and do not need to know the details of the internal nodes.

ConfigServers

  • Two ConfigServers act as primary and standby.
  • Live and available DataServer node information for the cluster is determined using a heartbeat check between the ConfigServer and DataServer.
  • Based on the DataServer node information, the ConfigServer constructs a data distribution table which shows how data is distributed in the cluster.
  • The ConfigServer provides a data distribution table query service.
  • The ConfigServer schedules data migration and copying between DataServers.

DataServers

  • DataServers provide storage engines.
  • DataServers receive operations initiated by clients, such as put/get/remove.
  • DataServers migrate and copy data.
  • DataServers provide access statistics.

Clients

  • Clients provide APIs for accessing the Tair cluster.
  • Clients update and cache data distribution tables.
  • Clients provide LocalCache to prevent overheated data access from affecting the Tair cluster service.
  • Clients control traffic.

Product features

Distributed architecture

  • A distributed cluster architecture is used to provide automatic disaster recovery and failover.
  • Load balancing is supported and data is distributed evenly.
  • System storage space and throughput performance can be scaled elastically, resolving data volume and QPS performance limitations.
  • Fully-featured and user-friendly access
  • The data structure is rich. Single level key-value structures and secondary indexing structures are supported.
  • Various uses are supported. Counter mode is also supported.
  • Data expiration and version control are supported.

Uses

Database caching

As business volume increases, the number of concurrent requests to the database system is increasing and the load on the database system is becoming heavier. When the database system is overloaded, response speeds are slower and, in extreme situations, the service may even be interrupted. To address this problem, Tair MDB can be deployed together with database products to provide high throughput and low latency storage. MDB can respond quickly, and generally completes requests within milliseconds. Moreover, MDB supports a higher QPS rate and can process more concurrent requests than databases. By observing the business, the user can store hotspot data in MDB and significantly lessen the load on the database. This not only reduces database costs but also improves system availability.

Temporary data storage

Applications such as social websites, e-commerce websites, games, and advertisements need to maintain a large volume of temporary data. Storing temporary data in MDB can reduce the memory management overheads and application load. In a distributed environment, MDB can be used as uniform global storage which can prevent data loss caused by a single point of failure and resolve issues relating to synchronization between multiple applications. A common example is to use MDB as a session manager. If the website uses distributed deployment and the traffic is huge, different requests from the same user may be sent to different web servers. In this case, MDB can be used as a global storage solution to save session data, user tokens, permission information and other data.

Data Storage

  • The recommendation and advertising businesses generally need to compute huge amounts of data offline. LDB supports persistent storage and provides superb performance. Online services are supported, allowing the user to regularly import offline data to LDB for online services.
  • After computing, list businesses can store the final lists in LDB to be directly displayed to front-end apps. In this way, LDB meets storage and high-speed access needs.

Blacklist/whitelist

Security apps have many blacklist/whitelist scenarios. These blacklist/whitelist scenarios are characterized by low hit rates, large access volumes, and business loss caused by data loss. LDB supports data persistence and high access volume, so it is widely used in these scenarios.

Distributed locks

Distributed locks are usually used to prevent data inconsistency and logical chaos caused by multi thread concurrence. Distributed locks can be implemented using Tair's version feature or computing function. Thanks to LBS's persistence, the locks aren't lost and can be released normally even if the service goes down.

Contribution

The source code is available user the GPL version 2. We are avtively looking for contributors so if you have any ideas, bug reports, or patchs you would like to contribute please do not hesitate to do so.

tair's People

Contributors

dutor avatar hurley25 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tair's Issues

关于tair3.2.4

hi team!
我们现在正在使用tair2.3.x版本,并且部署到了产线,想问问若升级到tair3.2.4版本,底层协议与是否是兼容老版本,我试了试tair2.3.x的tairclient连接到tair3.2.4的configserver,目前是没问题的,有没有需要注意的地方?这方面我看文档没有这么阐述。另外这两个版本的差别有多大?
感谢,望回复。

Go client

Are there any plans on supplying a Go client for it?

哪里找文档呢?

上一个issue被关闭说是会逐步更新文档到这里。但是至今wiki只有简单的介绍,而且淘宝code上的页面早就无法打开,返回403 forbidden了。wiki的更新有时间表吗?

log bug

      log_error("dataserver: %s UP, accept strategy is: %d illegal.",
          p_server->group_info_data->get_accept_strategy(), tbsys::CNetUtil::addrToString(req->server_id).c_str());
      server_info_rw_locker.unlock();
      group_info_rw_locker.unlock();
      return;

上层的分布式策略

上层的分布式策略较粗糙,在数据量很大的时候机器间的数据通信量较大。是否支持提交补丁?

tblog.h encoding

该头文件注释乱码(从老版本就乱,这个还有正确的编辑版本么)

there are encoding problems in "tblog.h". Could you fix them?

tair 有支持批量导入吗?

tair 有支持批量导入吗? 指标数据,一般都非常大,一般离线算好,提供线上使用,一般都是几亿条,insert 操作太慢,现在只能选择hbase ,生成hfile,批量导入。

编译不成功

经查看,是libeasy编译有问题,没有生成libeasy库。

wiki文档内容没有协议部分,应该在哪里提问?

看了一下客户端的代码是用httpclient实现的,但是提交部分的编码方式没有文档,Wiki也只有一些基础的使用问题,并没有深入的这部分的文档,如果有这部分的文档需求应该取哪里查看呢?

CentOS8 编译libeasy失败

easy_uthread.c:251:17: error: ‘SIG_BLOCK’ undeclared (first use in this function); did you mean ‘F_LOCK’?
sigprocmask(SIG_BLOCK, &zero, &t->context.uc_sigmask);
^~~~~~~~~

求解决方案,谢谢

关于client的tair_client_api_impl

想了解一下关于tair_client_api_impl提供的接口,是线程安全的吗?例如多个并发调用put等接口,因为我想利用这个impl来开发server.

编译不过

src/storage/ldb/leveldb/ax_port_leveldb.m4:15: the top level
configure.ac:113: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2590: _AC_COMPILE_IFELSE is expanded from...
../../lib/autoconf/general.m4:2606: AC_COMPILE_IFELSE is expanded from...
../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
ax_boost.m4:43: AX_BOOST is expanded from...
configure.ac:113: the top level
configure.ac:3: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated. For more info, see:
configure.ac:3: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
configure.ac:123: error: required file 'test/Makefile.in' not found
configure.ac:123: error: required file 'test/interface_test/Makefile.in' not found
configure.ac:123: error: required file 'test/unit_test/Makefile.in' not found
configure.ac:123: error: required file 'test/statistics_test/Makefile.in' not found
configure.ac:123: error: required file 'test/retry_all_test/Makefile.in' not found
Makefile.am:2: error: required directory ./test does not exist
Makefile.am:5: error: required directory ./test does not exist

Tair的心跳协议

稍稍看了下,Tair里面的ConfigServer处理正常的包和心跳包用了不同的端口。一般来说,在分布式系统里,心跳连接和业务连接一般是共享的吧?否则业务连接断掉的情况下,心跳连接仍然正常的话,心跳的意义何在?

Rdb engine

Does tair support rdb egine in its open source version?Does it have any support for collection-type data structure in other engines?

some changes fot tair to compile on ubuntu 14.04

some changes for tair to compile on ubuntu 14.04

tbsys realted changes

line 323:
CLogger::CLogger& CLogger::getLogger() => CLogger& CLogger::getLogger()

tair related changes

mainly add boost related flags for LDADD

src/mdb/Makefile.am => add -lboost_system
src/client/Makefile.am => add -lboost_system
src/dataserver/Makefile.am => add -lboost_system -lboost_thread
src/invalserver/Makefile.am => add -lboost_system -lboost_thread
src/tools/Makefile.am => add -lboost_system -lboost_thread

用tair_client_api编程,程序运行完毕退出时报错!

用tair_client_api�编程,程序运行完毕退出时报错!
代码如下:

#include
#include <boost/timer.hpp>
#include <boost/progress.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/scoped_ptr.hpp>

#include "Tair/include/tair_client_api.hpp"

using namespace std;
using namespace tair;
using namespace boost;

int main()
{
cout << "Hello World!" << endl;

boost::scoped_ptr<tair_client_api> tair_client(new tair_client_api);
tair_client->setup_cache(0);
tair_client->set_light_mode();
tair_client->set_thread_count(4);
bool bOk = tair_client->startup("192.168.100.160:5198", nullptr, "group_1");
if(LIKELY(bOk))
{
    data_entry key("k1");
    data_entry value("v1");

    int ret = 0;
    boost::progress_timer t;
    for(int i = 0; i < 10; ++i)
    {
        ret = tair_client->put(0, key, value, 0, 0);
        if(UNLIKELY(ret))
        {
            cout <<"Put Error"<<endl;
        }
    }

}else
{
    cout << "Tair Start Error"<<endl;
}

tair_client->flush_mmt();
tair_client->close();

return 0;

}

程序正确运行完毕,退出时报错如下:

The Inferior stopped because it received a signal from the operating system.
Signal name :SIGABRT
Signal meaning: Aborted

求解!
十分感谢!

启动速度慢

我们用的tair,两年没有重启了,然后重启需要半个小时,用的ldb,调查了下,看起来是ldb的manifect文件太大了,最近的版本能解决下这个问题么?例如ldb instance并行开启,或者什么的?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.