Microservices Architecture Example - Part 1

Intro

I've been working on a site recently and thought it was a good opportunity to overly architect it. With the growth of cloud services nowadays it has become easy for the independent developer to produce some architecturally complex products. I also thought that documenting this would prove to be a good walkthrough for others on how I broke out the functionality via microservices.

Much of the microservices examples out there are fairly simplistic examples. I'm hoping this to be a walkthrough of something a little more real-life, and to share architectural decisions and dilemmas as I make them.

Note: This is going to be an overlyarchitected solution. That is the point of this blog after all. I doubt my niche site is going to get traffic that will require it to scale drastically. But its way more fun this way.

Overview

The site I'm building is a niche directory site that lists local organizations, news, and events in one place. Users can submit organizations and events that are occurring for others to attend. A site administrator will approve/edit these submissions for public listing. Users can follow orgs and events for updates. Some users may be designated as 'organization admins' and manage the organization and its events.

Process

Usually when architecting a new app, I like to step back and think about what types of actions can be performed by users. This tends to lead into groups of functionality that can be bundled into services. I find visual representation is best for quickly thinking through things. Below is how I broke this out (by different roles).

User Functions

  • submit a list of organizations and events that are important to the community
  • follow news or events submitted for an organization
  • share event / organization information with others
  • claim an organization as their own and become the administrator of an organization

Site Admin Functions

  • manage users and authorization
  • approve / modify submissions from the public
  • view statistics on site visits and subscriptions etc

Organization Admin Functions

  • Claim an organization as their own
  • Post new events for the organization
  • Notify followers of events

System Functions

  • Authenticate and authorize users
  • Record page / event stats
  • Send out site event notifications to admins

Wrap Up

There's been no talk of microservices yet. So far we've just understood what types of users we have and what functionality they're going to be using. There are also some system functions that happen under the hood.

We'll see how these map to microservices in Part 2 of this series.