This document discusses microservices architecture for building a social network application. It covers why microservices are useful for performance, scalability and quick development. It then discusses specific microservices for authorization using Amazon Cognito, storing social relationships as a graph database in Neo4j, implementing a news feed with different feed types, and approaches for microservices communication including request-reply, pub-sub and queues.
2. Nazariy Hazdun
● Co-Owner & CTO of Geniusee
● 8+ years of experience in IT industry
● 4+ years of team leading experience
● Co-founder of 2 startups: LimpidArmor (AR/MR/IoT),
UALight (IoT)
About me
6. Why microservices (2/3)
● Performance
● Team scalability
● Quick time to market
Non-functional
requirements
7. Why microservices (3/3)
CONS PROS
● Each microservice is simple
● Scalability
● Each unit can use own stack
● Many cooperation units
● Network latencies
● No transactions
● Slower time to market
10. Authorization (2/5)
● Integration with API Gateway
● Clients SDK (Web, iOS, Android)
● Social sign-in with Facebook, Google, and possibility to
extend drivers.
● User directory management and user profiles.
● Security features such as multi-factor authentication
(MFA), checks for compromised credentials, account
takeover protection, and phone and email verification.
Amazon Cognito
advantages
13. Authorization (5/5)
You pay based on your monthly active users (MAUs) only. A
user is counted as a MAU if, within a calendar month, there is
an identity operation related to that user, such as sign-up,
sign-in, token refresh, or password change.
Cost
Pricing Tier (MAUs) Price per MAU
First 50,000 Free
Next 50,000 $0.00550
Next 900,000 $0.00460
Next 9,000,000 $0.00325
Greater than 10,000,000 $0.00250
19. Graph social relationships (5/8)
● Creating friendship request
● List of requests
● Request approving
● Request cancellation
● List of friends. Depth from 1 to N.
● Friends suggestions
● Suggestions based on Facebook Graph
Use Cases
24. News feed (1/3)
Timeline Feeds
● Basic feeds contain a simple list
of chronologically sorted
activities from the topics or
people you follow.
Ranked Feeds
● Ranking allows you to take
control over how activities are
sorted. Ranking activities can
help improve engagement.
26. News feed (3/3)
Aggregated Feeds
● Aggregation enables you to
group activities together based
on rules. This help keeps the
feed relevant when there is a
lot of activity.
Notification Feeds
● Notification feeds add the
concept of “seen” or “read” to
the activities. Commonly used
with Aggregation.
Personalized Feeds
● Leverage machine learning to further
improve the relevancy of your feed. Top
companies such as YouTube, Etsy, Linkedin
and Instagram all leverage personalization.