Giter VIP home page Giter VIP logo

tim's Introduction

TIM IM Engine [中文]

The decentralized distributed architecture of Tim's instant messaging engine features decentralization, distributed data storage, support for large-scale users, instant messaging, security and privacy protection, high availability and fault tolerance, as well as scalability and flexibility. It can effectively solve the design and implementation problems of large-scale distributed systems and improve system performance, availability, and scalability. The IM engine of Tim is a decentralized distributed architecture, whose main features are detailed in the following content


Tim's open source project webtim

Webtim online access address: https://tim.tlnet.top


Features of Tim's architecture

  1. Decentralization: Tim adopts a decentralized distributed architecture without a central node or control unit. Each node is independent and has a highly autonomous characteristic. This architecture approach can reduce the risk of single point failure and improve the reliability and security of the system.
  2. Distributed data storage: Tim uses a distributed storage algorithm to store data on multiple database nodes in a decentralized manner. This storage method can improve data reliability and security, and better protect against data loss or corruption issues.
  3. Support for large-scale users: Tim can support large-scale users online at the same time and ensure timely delivery of messages. Through optimized protocols and serialization techniques, Tim can efficiently process massive amounts of data and requests, ensuring fast transmission and reliable delivery of messages.
  4. Instant messaging: Tim as an instant messaging IM engine emphasizes the timeliness and accessibility of information. It uses efficient transmission protocols and serialization techniques to optimize the delivery and reception of messages, ensuring that users can communicate and interact instantly.
  5. Security and privacy protection: Tim attaches great importance to the privacy and security of user information. Through encryption technology and decentralized authentication, it ensures the security and privacy of user data from being infringed upon. At the same time, internal developers cannot directly query user and communication information, which increases data security.
  6. High availability and fault tolerance: Tim has high availability and fault tolerance. Due to the decentralized distributed architecture, even if a node fails, other nodes can continue to work, ensuring the continuity of the overall service. This design approach improves the reliability and stability of the system.
  7. Scalability and flexibility: Tim's distributed architecture enables it to have good scalability and flexibility. As business needs grow, more nodes can be added to improve the system's processing power and storage capacity. At the same time, due to the free connection and interaction between nodes, Tim can quickly adapt to changing needs and environments.

The characteristics of Tim

Tim is a decentralized distributed instant messaging engine.

Tim implements a completely decentralized cluster mode and distributed data storage, supporting millions of databases for distributed data storage. Therefore, Tim can support ultra large clusters and online user numbers can reach ten billions.

Tim has built a basic communication mode, namely 1:1, 1: N, N: N mode, to achieve underlying stream data communication. Developers can flexibly combine and use tim's communication mode according to business requirements to meet various instant messaging needs. IM communications such as WeChat, QQ, Tiktok, etc. can be implemented with tim. Similar to live streaming rooms, real-time audio and video, multiplayer videos, multiplayer audio and video conferences, and other functions, using Tim is very simple to implement. Similar to message recall, message burning upon reading, etc., Tim supports implementation from the underlying message communication type.

The use of Tim mainly relies on the terminal calling the service interface through the Tim client, and all communication logic is completed on the Tim server. The Tim client adopts a minimalist mode to implement interface calls, and almost all Turing complete programming languages can quickly implement the Tim client.

Tim Function Introduction

  1. Decentralized distributed architecture, supporting Nat penetrate to connect to cluster nodes, natural distributed architecture, no special configuration required, no minimum node limit, zero dependency, supporting large-scale clusters.
  2. Supports multiple databases: TLDB, MySQL, PostgreSQL, SQL Server, Oracle, Oceanbase, etc
  3. Highly inductive IM communication mode, supporting 1:1, 1: N, N: N communication modes from the bottom layer
  4. Supporting streaming data transmission from the bottom layer, easily supporting the development of live streaming, real-time audio and video functions, etc
  5. Emphasize data security , from account to communication data, are converted or encrypted to ensure the security of user information
  6. Implement distributed storage of data, solve the problem of massive data storage, and support dynamic expansion of database nodes.
  7. Featuring high performance of a stand-alone machine, high protocol serialization efficiency, and small size.
  8. Support various communication types from the bottom level, including regular messages, recall messages, and messages that are burned upon reading, etc
  9. Support various custom user statuses and benchmark the status function of QQ and other types of apps
  10. Support group, benchmarking QQ, WeChat and other types of APP group functions
  11. It supports multi person real-time streaming data transmission, benchmarking Tiktok live broadcast, video connection, or multi person real-time video conference ,etc.
  12. Supports simultaneous login of multiple terminals with the same account, and supports restriction through configuration, benchmarking QQ and WeChat multiple terminal login functions
  13. Support client access using JSON protocol.

Tim's database

Tim's database can use databases such as TLDB, MySQL, PostgreSQL, SQL Server, Oracle, Oceanbase, etc.

The use of TLDB can refer to "TLDB High Performance Distributed Database"

TLDB is the default database for Tim's built-in user system. Through Tim's own data distributed storage design, TLDB no longer needs to build a distributed system, only needs to start a standalone machine mode service node. Tim can hash and store data in multiple standalone TLDB service nodes through data repository configuration.

The high-performance read and write data and support for a large number of client connections of TLDB make it relatively more suitable as a Tim database

If you do not use Tim's built-in user system, but need to access existing or self built user systems, you can access other databases such as MySQL and configure SQL to access external business data. Tim's core interface supports reading relevant external data

Tim's protocol

Tim's custom communication protocol has significant advantages over common serialization frameworks in terms of serialization efficiency and compression ratio. For more details, please refer to the "Tim Practice Series - Comparison of Tim Protocol with Other Format Agreements"

Tim not only supports custom Thrift compression protocol, but also supports JSON protocol; The advantages and disadvantages of JSON itself are quite obvious. The biggest advantage of JSON is its versatility, while its serialization efficiency and protocol package size are its disadvantages. Timjs is a tim client implemented in JSON format, please refer to the timjs implementation source code for details

Tim zero dependency Tim's deployment and startup do not rely on any third-party components or services. Tim supports both data mode and no data mode. In data mode, running Tim requires starting the database service first. In no data mode, it can be run directly.

Tim Practice Series (articles are continuously updated...)



Programs related to Tim


tim brings many advantages and functions

  1. Improve development efficiency: TIM provides rich functional modules and interfaces, simplifying the development process of instant messaging applications and reducing the time spent on reinventing the wheel and starting from scratch.
  2. Security: TIM has a strong security mechanism that can ensure the security of user data and communication content, preventing data leakage and malicious attacks.
  3. Provide stable services: TIM can provide stable and reliable instant messaging services to ensure the continuity and reliability of user communication.
  4. Support for multiple platforms: TIM can be used across platforms and devices, supporting multiple operating systems and terminal devices to meet the needs of different users.
  5. Rich scalability: Decentralized and distributed TIM has super scalability, which can be horizontally expanded according to the needs of the project, facilitating secondary development and functional upgrades.
  6. Reduce maintenance costs: TIM can reduce a large amount of operation and maintenance costs. The TIM cluster and distributed data storage rely on the TIM algorithm itself to complete, without requiring manual deployment.

  • Tim can greatly reduce the cost of developing IM and improve the efficiency of IM development.
  • I believe Tim can easily and quickly solve IM related problems. If you have any questions, please email: [email protected]

tim's People

Contributors

donnie4w 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

tim's Issues

我全部读完了。有几点疑问。求解答

1、你的 TimPbean 和 TimMBean 有什么区别 字段基本上都是一样的。 TimPBean 稍微少几个。
这块你注释也不太清楚,所以一直没看懂。完全可以复用。重复建立一个的意图是什么

2、roser花名册的作用是什么。。。
3、消息合流的作用是什么 就是为了一起发比较节约效率吗?什么时候会消息合流。似乎默认都是消息合流
4、有的地方没必要lock,似乎也被lock了。
5、没注释看的有点蛋疼。但是看完了也看懂了基本上。但是以上疑问。求解答。

如何在windows上编译

问一下,如何在windows上编译呢?报了这样的错误

tim.go:13:2: cannot find package "tim.DB" in any of:
C:\Go\src\tim.DB (from $GOROOT)
C:\Users\pc\go\src\tim.DB (from $GOPATH)
tim.go:14:2: cannot find package "tim.cluster" in any of:
C:\Go\src\tim.cluster (from $GOROOT)
C:\Users\pc\go\src\tim.cluster (from $GOPATH)

能说说如何支持视频、音频吗?

通过协议拓展,可以支持视频,音频等通讯

能简单介绍下如何支持吗?

想用React Native来写个客户端,有相关的demo吗?
谢谢。

关于群集问题

hi,看介绍,tim与redis的交换就可以实现群集?但怎样区分主从服务器呢?例如有A,B服务器,客户端连那一个?

分享一下我分析 tim 的 HBase 設計原則

https://www.facebook.com/kewang.information/posts/1799982210278145

最近在 oschina 看到有朋友用 golang 寫了一套 based on HBase 的即時通訊軟體(原設計是 MySQL),而 Qmi 也是基於 HBase 的即時通訊軟體。雖然小編不會寫 golang,但看 code 總還可以的,所以小編當然要來研究一下這個 tim 是如何設計 schema 的。

看起來 rowkey 就是用 HBase 的 increment 指令完成,然後再將 int 轉成 hex 後做為 rowkey。而 family 則有 n 個 (感覺就是欄位名的樣子),然後 family 為 idx 開頭的就是 foreign key。

除了 rowkey 以外,family, qualifier, value 的設計邏輯,更讓小編有點不解 Orz

  • 如果 family 是 # 開頭的話 (一般是 # id),則 qualifier 為空,value 為 rowkey 的值
  • 如果 family 是 idx_ 開頭,則 family 為 index,qualifier 為欄位的內容 (像是 IndexDomainUsername 的值),value 為空
  • 一般欄位則 family 為欄位名稱,qualifier 為空,value 為欄位的內容 (像是 fromuser 的值)
    對 HBase 設計比較了解的朋友會知道,rowkey 會影響讀寫的效能,依照 ascii 碼排序,愈分散就愈不會遇到 hotspot,但愈集中一次能取回的資料就愈多,這都是要看 scenario 決定。而 family 與 HFile 成正比,family 愈多,開的檔案愈多,一般建議不超過三個,而這裡一筆 record 就開了十幾個。另外除了 value 以外,naming 要儘量簡短。

看完之後,覺得跟這幾年小編在 HBase 上設計 schema 的原則完全不同啊。不過相信有一部分或許是為了要相容於 RDBMS 的關係,而不得不做的取捨吧 Orz

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.