Scaling is hard. Design decisions that initially seemed reasonable break down with little warning, and suddenly even the simplest parts of your data model need to go through a complex re-architecture. We’re tackling this problem at Slack. A lot of our early design decisions made sense for small workspaces, but can be inefficient for large…
Overview
This article discusses the re-architecture of Slack's workspace preferences by transitioning to an Entity/Attribute/Value (EAV) model to enhance scalability. It highlights the challenges faced with the existing JSON blob storage method and details the steps taken to implement the new data model.
What You'll Learn
How to re-architect a data model using the EAV pattern
Why caching strategies need to adapt with changing data models
When to use double writes for data migration
Prerequisites & Requirements
- Understanding of database design principles
- Familiarity with Vitess for database management(optional)
- Experience with data migration techniques
Key Questions Answered
What issues arise from using a large JSON blob for workspace preferences?
How does the EAV model improve data management for workspace preferences?
What steps were taken to migrate existing workspace preferences to the new model?
What challenges were encountered during the re-architecture process?
Key Statistics & Figures
Technologies & Tools
Some links below are affiliate links. We may earn a commission if you make a purchase.
Key Actionable Insights
1Implement an EAV model when dealing with a growing number of attributes in a database to maintain performance and scalability.This approach allows for flexibility in adding new attributes without requiring schema changes, which can be costly and time-consuming.
2Utilize double writes during data migration to ensure data integrity across old and new systems.This method helps prevent data loss and inconsistencies, making the transition smoother for users.
3Adopt a gradual rollout strategy, such as 'dark mode' reads, to test new implementations without disrupting existing functionality.This allows for identifying and fixing issues in real-time while ensuring that users experience minimal disruption.