Overview
kin2kin is a social network designed for families. It’s simple enough for the older generation and a safe, secure place for children under the age of 13 to connect with their wider family.
I designed and built the entire distributed, sharded server architecture for kin2kin on AWS. The server provides a REST API to mobile and web clients which is fully redundant across multiple AZs. The architecture was originally built around CloudFormation but was later moved to a microservices on Kubernetes.
Notable Systems:
Family Graph: Built to handle complex family trees that include divorce and blended families, the graph automatically links Grandparents, Aunts, Uncles, Cousins and broader family. Parents have complete control over who their children interact with as all connections are created to and from households, rather than individuals.
Sharding: The system had to scale beyond a single database. Based on an article by the Instagram team. The system uses a globally unique resource id that includes a database shard in every identifier. Database middleware then sits top of Sequelize that hides most of the sharding logic and allowed normal Sequelize queries to shard themselves automatically across multiple databases. If I were building this today it would be rearchitechted around Vitess.
Photos and Videos: When photos and videos are uploaded worker jobs convert them to multiple resolutions and formats, optimised for mobile.
Analytics: We track a large number of user events and interactions and store them in a custom analytics datastore. I built the datastore based on Uber’s Schemaless database design article. We then use the Redash web frontend to query this and the ElasticSearch logs to build custom dashboards.
Automated Retention and Tutorial Emails: Using the analytics above I built a system that triggers specific retention and tutorial emails to users based on their activity in the system.
Other Systems:
- Online gift store allows collaborative purchasing of gifts in 4 countries. The credit card processing is done via Stripe
- Printing Photos direct from the App to local print stores
- React based Web Admin tools for viewing and editing users, their connections and processing orders
- Logging and diagnostics systems with ElasticSearch, Logstash and Kibana
- Container orchestration using Kubernetes on AWS via KOPS
- CircleCI pipeline that fully tests every commit and automatically rolls out to the test environment. Single command rolls out specific git revision to the production environment.
Helped with development of iOS, Android and React web app as needed