Klaviyo, a B2C CRM platform used by major brands like Glossier and Vans, is revolutionizing customer engagement through advanced real-time segmentation and personalization, facilitated by the adoption of ClickHouse. Initially, Klaviyo faced challenges with their Python-based segmentation engine, which was slow and costly for large datasets due to its reliance on MySQL and Cassandra. By transitioning to ClickHouse, they significantly reduced processing times from hours to seconds, allowing efficient handling of billions of updates and segment changes daily. The new system employs bi-level sharding and materialized views to optimize data processing, enabling targeted marketing strategies to be executed swiftly. This transformation not only saved infrastructure costs but also enhanced scalability and performance. Additionally, Klaviyo sees future potential in ClickHouse Cloud for more flexible scaling and in new features like the Model Context Protocol for AI-driven insights, aiming to make customer data more actionable.