Cookpad’s Microservices Experience: Service Granularity, Integration, and Deployment Practices
This article shares Cookpad’s practical experience with microservices, covering service granularity, RESTful integration, parallel processing, fault tolerance, testing strategies, logging, Docker‑based deployment pipelines, and company‑wide support mechanisms that together improve development speed and reliability.
Cookpad, Japan’s largest online recipe sharing platform, is well known for its extensive use of Ruby on Rails and now shares its evolving microservices experience, emphasizing concrete examples over abstract concepts.
Service granularity is divided into three categories: User services that align with product domains (e.g., recipes, cooking classes, videos), View services that expose the same domain model through different UI versions (such as OEM or personal editions), and Common infrastructure services like OAuth providers, billing, push notifications, activity tracking, logging, personal data storage, and video handling.
Service integration relies on a RESTful Hypermedia API built on the internal Garage framework. To address performance overhead and fault tolerance, Cookpad adopts parallel processing and implements a Ruby‑based circuit‑breaker library called Expeditor (similar to Netflix/Hystrix), providing asynchronous execution, retries, and fallback mechanisms.
Testing between services focuses on API compatibility. While stub‑based CI tests cannot guarantee compatibility, Cookpad moved to consumer‑driven contract testing with Pact, replacing the earlier Rack::VCR approach, to catch breaking changes early in the provider’s CI pipeline.
Logging and transaction correlation use the X-Request-Id HTTP header, automatically added by Rails, propagated by GarageClient, and leveraged by Sentry for error‑log tagging.
Runtime environment and configuration have shifted almost entirely to Docker containers running on AWS ECS. After code merges, CI builds a new Docker image that is deployed to staging and production. Deployment is orchestrated by the Hako tool, which creates ELBs, configures Route 53, and injects environment variables. Sensitive configuration is managed with etcenv, etcvault, and a UI called etcweb, with the backend storage in encrypted etcd.
Company‑level support includes regular technical community meetings where teams share challenges and solutions, and the assignment of common‑infrastructure engineers who work across multiple services to avoid duplicated effort.
Conclusion highlights that Docker’s portability, the adoption of contract testing tools like Pact, and strong organizational support have accelerated Cookpad’s microservices adoption, allowing teams to focus on product value while using the most suitable technologies for each domain.
Architecture Digest
Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.