The post has been translated automatically. Original language: Russian
When an author wants to sell a book on dozens of digital platforms at once, the task quickly becomes engineering. Each site has its own API, its own file and metadata formats, and its own sales reports. Let's look at how such systems are technically arranged.
1. A single data model. The book is stored in the system once: the files (EPUB, PDF, MP3) are in S3-compatible storage, and the metadata (title, abstract, categories, languages, rights) are in a relational database. Packages are assembled from this single model to meet the requirements of each site.2. The Connector template. Each site is connected by a separate connector with a common interface: send a package, update metadata, withdraw from sale, receive a report. A new site is added without changing the core of the system.3. Asynchronous processing. Sending files and uploading reports go through message queues (for example, RabbitMQ). If the site's API is temporarily unavailable, the task will be repeated automatically, and the user will not lose anything.4. Normalization of reports. The platforms send sales in different formats and currencies. A separate service brings them to a single structure, converts currencies and links each sale to a specific product.5. Security and legally relevant actions. Contracts with authors are signed with an electronic digital signature, data is encrypted, and backup is configured in the CI/CD pipeline.According to this architecture, we at Bookgate (a member of Astana Hub) are building our platform on the Next stack.js, NestJS, PostgreSQL, and Kubernetes.
Когда автор хочет продавать книгу сразу на десятках цифровых площадок, задача быстро становится инженерной. У каждой площадки свой API, свои форматы файлов и метаданных, свои отчёты о продажах. Разберём, как такие системы устроены технически.
1. Единая модель данных. Книга хранится в системе один раз: файлы (EPUB, PDF, MP3) лежат в S3-совместимом хранилище, а метаданные (название, аннотация, категории, языки, права) — в реляционной базе данных. Из этой единой модели собираются пакеты под требования каждой площадки.
2. Шаблон Connector. Каждая площадка подключается отдельным коннектором с общим интерфейсом: отправить пакет, обновить метаданные, снять с продажи, получить отчёт. Новая площадка добавляется без изменения ядра системы.
3. Асинхронная обработка. Отправка файлов и загрузка отчётов идут через очереди сообщений (например, RabbitMQ). Если API площадки временно недоступен, задача повторится автоматически, и пользователь ничего не потеряет.
4. Нормализация отчётов. Площадки присылают продажи в разных форматах и валютах. Отдельный сервис приводит их к единой структуре, конвертирует валюты и связывает каждую продажу с конкретным произведением.
5. Безопасность и юридически значимые действия. Договоры с авторами подписываются электронной цифровой подписью, данные шифруются, резервное копирование настраивается в CI/CD-конвейере.
По такой архитектуре мы в Bookgate (участник Astana Hub) строим свою платформу на стеке Next.js, NestJS, PostgreSQL и Kubernetes.
Comments 5
Newest Popular