Mark Reshetov

Allydium — B2B Backend Architecture for Affiliate Tracking

Developed a B2B SaaS platform for Shopify-based businesses. Built referral tracking engine, agent CRM, RBAC and audit system. Integrated Shopify and Odoo via webhooks, designed ClickHouse-based analytics, and delivered APIs for web and mobile clients.

FastAPIFlutterPostgreSQLRedisShopifyOdooClickHouse

Architecture of a B2B Platform for Affiliate Tracking and Revenue Attribution

While working on a commercial B2B platform in the affiliate tracking and revenue attribution domain, one of the core challenges was designing a backend that could handle a constant stream of external e-commerce events without breaking internal business logic.

In practice, this meant separating a stable domain core from a high-load integration layer. Without this separation, external traffic spikes — orders, status updates, marketplace events — would directly impact critical parts of the system like commission logic or financial rules.


Separation of Business Core and Integration Layer

The architecture was built around two independent layers.

The business core handled everything that needed to remain stable: company structures, role hierarchies, commission rules, and financial logic. This part of the system had to be predictable and strictly controlled.

The integration layer, on the other hand, dealt with external data — incoming events, synchronization flows, and marketplace interactions. It was designed to absorb load and variability without leaking that complexity into the core domain.

This separation made it possible to scale the system under heavy load while keeping internal processes consistent.


RBAC and Multi-Level Workspace

Another important part of the system was the internal workspace and access control model.

For a multi-user B2B platform, we implemented a multi-level Role-Based Access Control (RBAC) system.

Access control was enforced not only at the UI level, but also across routes, data operations, and API endpoints. This was critical because different roles — business owners, managers, operators, agents, observers — all interact with the same system in very different ways.

As the number of roles and entities grew, this model helped keep behavior predictable instead of chaotic.


Hybrid API Architecture

The API layer followed a hybrid approach.

For standard operations, CRUD endpoints were generated based on domain models and shared infrastructure. This kept development fast and consistent.

But for business-critical logic — financial operations, aggregations, dashboards, custom routing — everything was implemented manually. These were the parts where losing control was not an option.

In the end, this balance between automation and manual control made it possible to move fast without introducing instability into the system.

New Project

Let's build a new project together

From scope and architecture to integrations and delivery, I can help turn a fresh idea into a production-ready system.

Start a Project
B2B Backend Architecture Case Study: Affiliate Tracking, RBAC, API Design