Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# coordinator

Template of a C++ service that uses [userver framework](https://github.com/userver-framework/userver).


## Download and Build

To create your own userver-based service follow the following steps:

1. Press the "Use this template button" at the top right of this GitHub page
2. Clone the service `git clone your-service-repo && cd your-service-repo && git submodule update --init`
3. Give a proper name to your service and replace all the occurrences of "coordinator" string with that name
4. Feel free to tweak, adjust or fully rewrite the source code of your service.

# Координатор для системы доставки сообщений
Сервис координатор – управляет кластером хабов

## Краткое описание
- Базовая сущность в системе – канал (через канал проходят сообщения, например одному читателю или группе)
- Шлюзы держат подключения к читателям
- Хабы обслуживают потоки сообщений назначенных партиций
- Каналы разделены на партиции
- Партиции каналов представлены как диапазоны на хеш-кольце
- Среди координаторов выбирается лидер
- Лидер раз в N секунд проводит координацию:
1) Определяет текущее состояние кластера
2) Распределяет и балансирует партиции между хабами
3) Публикует новую карту партциий, которая содержит маппинг партиций в хабы и номер текущей эпохи
- Leader Election, Service Discovery и публикация partition map реализованы через механизм распределенных семафоров узлов координации YDB
- Параметры балансировки можно крутить через динамический конфиг
- Прототип ["хабошлюза"](https://github.com/Repin-Daniil/chat-service)

## Makefile

Expand All @@ -34,4 +37,4 @@ can also be `debug-custom`, `release-custom`.

The original template is distributed under the [Apache-2.0 License](https://github.com/userver-framework/userver/blob/develop/LICENSE)
and [CLA](https://github.com/userver-framework/userver/blob/develop/CONTRIBUTING.md). Services based on the template may change
the license and CLA.
the license and CLA.