Client Consistency at Slack: Beyond Libslack

Two years ago, I wrote a post about Libslack, Slack’s shared C++ client library. That post described how Slack used the Libslack library in its mobile applications to encapsulate shared business logic, and to handle syncing and caching of data. In the intervening time, we decided to move away from using a shared C++ library in…

Tracy Stampfli
9 min readintermediate
--
View Original

Overview

The article discusses Slack's transition from using the Libslack shared C++ client library to developing separate implementations for mobile clients. It highlights the challenges faced with Libslack and outlines new strategies for maintaining client consistency and reducing duplication of effort across Slack's infrastructure.

What You'll Learn

1

Why Slack discontinued the use of the Libslack library

2

How to implement separate DataProvider frameworks for iOS and Android

3

When to utilize conformance suites for client consistency

Prerequisites & Requirements

  • Understanding of mobile application architecture and client-server interactions
  • Familiarity with C++ and mobile development practices(optional)

Key Questions Answered

What were the main reasons for discontinuing the Libslack library?
Slack discontinued the Libslack library due to integration challenges, overhead in maintaining the library, and difficulties in hiring engineers with C++ experience. The project did not provide sufficient benefits as it was only used by iOS and Android clients, leading to increased complexity without significant advantages.
How did Slack ensure consistency across its mobile clients after Libslack?
Slack established separate DataProvider frameworks for iOS and Android, which manage data syncing and caching independently. Additionally, they formed a Client Foundations Council to discuss features affecting all clients and developed shared conformance suites to validate consistent behavior across platforms.
What are DataProviders and how do they function in Slack's architecture?
DataProviders are frameworks developed by Slack's mobile infrastructure teams to ensure that all necessary data is present and up-to-date. They handle local caching, fetch updates, and notify observers of changes, allowing for efficient data management without direct access to mutable objects.
What role does the Client Foundations Council play in Slack's client development?
The Client Foundations Council is a weekly meeting of engineers from different Slack client teams. It facilitates discussions on upcoming features, shares knowledge about client operations, and aims to develop common solutions to ensure consistency across all Slack clients.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Key Actionable Insights

1
Implement separate DataProvider frameworks for mobile applications to manage data efficiently.
This approach allows for independent development while maintaining consistency in data handling, reducing the risk of concurrency issues and crashes.
2
Establish a Client Foundations Council to enhance communication between teams working on different client platforms.
Regular meetings can help identify common challenges and foster collaboration, ensuring that all teams are aligned on feature development and implementation.
3
Utilize conformance suites to validate client behavior across different platforms.
Creating shared test cases allows for consistent user experiences without enforcing identical implementations, which can be crucial when dealing with complex features.

Common Pitfalls

1
Over-reliance on shared libraries can lead to integration challenges and increased complexity.
This often occurs when teams attempt to retrofit a shared library into existing architectures, which can complicate development and maintenance.

Related Concepts

Mobile Application Architecture
Data Syncing And Caching Strategies
Cross-platform Development Practices