Microservices In Practice: Developing Instagram Clone —Graph Service

Amr Saleh
Javarevisited
Published in
4 min readJun 17, 2020

--

This is part 6 of Developing Instagram Clone series, other parts are linked below

  1. Developing Instagram Clone: Introduction.
  2. Developing Instagram Clone: Discovery Service.
  3. Developing Instagram Clone: Auth Service.
  4. Developing Instagram Clone: Media Service.
  5. Developing Instagram Clone: Post Service.
  6. Developing Instagram Clone: Graph Service.
  7. Developing Instagram Clone: Newsfeed Service.
  8. Developing Instagram Clone: Gateway Service.
  9. Developing Instagram Clone: Front-end Service

In this service we are trying to build a follow system. Any user can follow any other user, and the user will see the posts from users who he/she are following on his/her news feed.

Before we go deep into the graph service itself, let’s first discuss the best data-structure to represent this relationship and the database that we are going to use.

Graph data-structure

One might think why not saving a list of followers for each user in MongoDB or MySQL.

--

--

Amr Saleh
Javarevisited

I’m a software engineer who is passionate about software architecture and design. Enjoy coding in Java, Scala, and JavaScript.