Managing Dynamic Hierarchies and Compensation Distribution at Ethos: A Technical Deep Dive

Introduction
Imagine you’re trying to split a pie among several people, but the number of people and their respective shares keep changing. Now, scale that problem to an enterprise level where you’re distributing compensations across a network of agents, each with their own evolving hierarchy. This is the challenge Ethos faces in managing its collaboration with agencies. The complexity is amplified by the fact that these hierarchies are not static; they frequently change, requiring corresponding adjustments in compensation distributions and responsibilities. To give some more context, Ethos needs to distribute compensations to agencies (among agents) for selling policies at Ethos.
In this blog, we’ll explore how Ethos tackled this challenge by building a robust and scalable system that could manage these dynamic changes efficiently. We’ll focus on the technical aspects, exploring the architecture, data management, and the tools used to create a system that ensures all stakeholders have clear visibility and control over their respective domains.
Understanding the Problem
When Ethos decided to partner with various agencies and agents, it opened up a new set of challenges. The life insurance industry doesn’t operate with a single person responsible for selling a policy. Instead, it involves a network of agents, each contributing in different capacities, which creates a complex hierarchy.
For example, consider Agent A, who has reportee agents B and C, and Agent B, who further has reportee agents D and E. Compensations for policies sold are distributed across these agents based on their roles and contributions. The challenge arises when these hierarchical structures change — whether due to agents leaving, new agents joining, or reorganisation within the agency. On top of this hierarchy changes, the compensation-terms for various products for which we pay compensation may also change. The system needs to adapt to these changes in real-time, ensuring that compensation distributions and responsibilities are accurately adjusted.
Architecting the Solution
To solve these problems, Ethos needed a system that could not only manage the current state of hierarchies but also maintain a historical context to understand how they have evolved. The system also had to be flexible enough to handle frequent changes and scalable to support future growth as more partners were onboarded.
1. Hierarchical Data Management
The first step was to create a system that could handle the dynamic nature of agent hierarchies within an agency. This required a data structure that could represent complex relationships and allow for real-time updates.

- Dynamic Hierarchies: We implemented a data model that could represent nested hierarchies, where each agent could have multiple reportee agents. This model was designed to be flexible, allowing for easy addition or removal of agents without disrupting the overall structure.
- Version Control: To manage changes over time, we implemented a version control system for the hierarchy. This allowed us to track changes, understand the historical context, and ensure that past compensation distributions could be accurately reported even if the hierarchy had since changed.
2. Compensation Distribution Engine
With the hierarchical structure in place, the next challenge was to build a compensation distribution engine capable of handling the complex and customisable compensation plans.
- Customisable Compensation Plans: The engine was designed to support various compensation structures, allowing Ethos to tailor agreements with each agent or agency. This flexibility was crucial, as different products and agents often had unique compensation agreements. This starts with the agency head, which downgrades to the reportees in the hierarchy deciding the compensation rates at each level.
- Real-Time Adjustments: As the hierarchical structure changed, the compensation distribution engine automatically recalculated compensations. For instance, if Agent A’s reportee changed, the system would adjust the compensations for all affected agents to reflect the new hierarchy. This ensured that agents were compensated accurately and fairly based on the current structure.
3. Access Control and Visibility
Given the complexity of the system and the sensitive nature of the data, it was essential to implement robust access controls and ensure that different teams within Ethos could access the information they needed without compromising security.
- Role-Based Access Control (RBAC): We implemented a fine-grained RBAC system to control who could view or modify specific information. For example, while the operations team might need full access to modify hierarchical structures, the sales team might only need visibility into compensation distributions.
- Audit Trails: To maintain transparency and accountability, we included audit trails that tracked every change made to the hierarchy or compensation distributions. This not only helped in debugging and compliance but also provided a clear history of how decisions were made.
4. Scalability and Flexibility

As Ethos continued to onboard new partners, the system needed to be scalable without requiring significant rework.
- Modular Architecture: We adopted a modular architecture, where each component of the system — such as the hierarchy management, compensation engine, and reporting tools — was built as an independent module. This allowed us to scale each part of the system independently, making it easier to manage increased load as the number of partners grew.
- API-Driven Integration: The system was designed to be API-driven, enabling seamless integration with other platforms used by Ethos and its partners. This API-first approach allowed us to quickly adapt to new requirements and integrate with external systems without major overhauls.
- Event-Driven process: The event-driven approach triggers compensation calculations when policy statuses change. One event may trigger other events and the process remains asynchronous making it easier to manage and increasing modularity of the system.
- Database-Driven process: The database flow ensures precise and timely processing of policies and their inputs, including monthly costs. The data remains persistent for the major payment flows.
5. Real-Time Reporting and Analytics
To provide stakeholders with clear visibility and actionable insights, we built comprehensive reporting and analytics tools.
- Dashboard and Reporting Tools: We developed dashboards that allowed different teams to monitor the status of compensations, hierarchical changes, and policy sales in real-time. These dashboards were customisable, ensuring that each team could focus on the metrics most relevant to their role.
Conclusion
Building a system to manage dynamic hierarchies and compensation distributions at Ethos was no small feat. It required a deep understanding of the business challenges, combined with cutting-edge technology to create a solution that was both scalable and flexible. By focusing on dynamic data management, customizable compensation engines, robust access controls, and real-time reporting, we developed a system that not only meets the current needs of Ethos but is also poised to handle future challenges as the company continues to grow.
In a rapidly evolving industry like life insurance, where hierarchies and responsibilities are in constant flux, having a reliable and adaptable system is crucial. At Ethos, we’ve built just that — a system that ensures all stakeholders can operate with the most accurate and up-to-date information, empowering them to focus on what they do best: selling policies and serving customers.
What’s next?
As Ethos continues to expand, we are focused on further scaling the compensation distribution process. Future improvements include automating some of the manual steps, such as compensation reviews, to streamline operations and enhance efficiency as we grow.
Please tune in for follow-ups with more in-depth details on key concepts, such as dynamic hierarchies, compensation distribution engines, and access control mechanisms mentioned in this article.

Amit joined Ethos in January 2023 as a Software Engineer. Amit worked with the New Products team and contributed to bullet proofing Ethos working on security aspects. Amit is working with the Partnership team for the last 9 months and is working on significantly enhancing the product. When Amit isn’t coding and designing systems at Ethos, he enjoys spending time with family and kids, reading books, exploring new technologies and investing. Interested in joining our team? Learn more about our career opportunities here!
---------------------------------------------------------------------------------------------
The information and content provided herein is for informational purposes only, may not reflect the opinions of Ethos Technologies Inc. and its affiliates (collectively, “Ethos”), and is not to be considered legal, tax, investment, or financial advice, a recommendation, or an endorsement. Any reference to “partners” or “partnerships” herein is not meant to imply that any specific party is a legal partner of Ethos.