• Engineering
  • Product
  • For Brands
  • What’s New
  • Music
  • Life at Anghami
No Result
View All Result
  • Engineering
  • Product
  • For Brands
  • What’s New
  • Music
  • Life at Anghami
No Result
View All Result
Anghami
No Result
View All Result

Goya, Anghami’s Painter

Ibrahim Fawaz by Ibrahim Fawaz
October 6, 2020
in Engineering, Product
Share on FacebookShare on Twitter

Music in the streaming era doesn’t exist alone, it is coupled with images; album arts, playlist cover arts, the colorful image you see in your curated mix and everything in that space. We are a music streaming company, and image processing lies in the core of our work. Back in 2017 the engineering team decided to explore solutions to our image processing needs and that led us to one of the dozen solutions available on the web.

However, our needs grew in parallel with the size of the company and soon enough we were billed more than we ever anticipated. Cutting costs is always a priority which pushed us to create our own service and later on realizing the big wins we can achieve utilizing it as a design automation tool. What started off as a cutting cost project became one of the pillars in the creative and marketing pipeline at Anghami.

That’s a hefty bill!

We initially adopted a popular online solution that allowed us to deliver, render and create images with ease. Soon enough, we were posting a hefty bill, much more than we expected. Discussions were made on a possible solution and despite multiple optimizations the bill was still not justifiable enough. We decided that the best way to move forward is to create an in-house solution that would mimic the behavior of the aforementioned solution without losing the functionality.

In comes Goya, our in-house service that serves images from S3 and exposes an API to create different images. The big wins were clear early on as our bill dropped down by 60% limited to the cost of hosting the service on EC2 and the network costs.

Nobody likes labor work

The service was initially designed with migration in mind, nobody wants to go through tens of classes to change snippets of code here and there. The solution was simple, expose an API that mimics the same endpoints and query parameters as the old service thus minimizing any changes that needed to be done in the different codebases. 

One of the first uses of Goya was to provide a portal to create cover arts for our featured playlists. This process usually required collaboration between designers and curators to craft multiple images per week.

A major win for us came at the end of 2019 where we usually do an End of Year campaign. The campaign involves images containing unique statistics about users which are usually created by designers and engineers hand-in-hand. Designers would provide different customizations of a template and engineers would insert the user data in these templates using FFmpeg and ImageMagick. Automating this process became possible by creating Dynamic Presets which are customizable template URLs that take in query parameters containing user data, colors, language, shape and size, render the image on the fly and serve it with compressed quality. In comparison with 2018, hundreds of hours were saved in the process of EOY preparation.

Open the hood

The rendering service sits behind two content delivery networks starting with Akamai due to its extended availability in the MENA region with PoPs distributed across the whole network followed by a CloudFront distribution. Having CloudFront allows us to reduce the outbound traffic cost significantly since traffic from EC2 is free. Having two CloudFront pops means we only need to compute the image twice instead of triggering a render for each Akamai PoP which reduces the compute cost and protects EC2 instances from unnecessary request bursts when new images are published.

If an image is served using an asset ID, which points to locations of cover arts, RDS and Redis are used to fetch and cache file locations.

We utilized Lumen to write the service in addition to utilizing Intervention Image, an open source PHP image handling and manipulation library.

Ibrahim Fawaz

Ibrahim Fawaz

Related Posts

Anghami Launches its 2024 in Music Campaign and Reveals Official Music Charts
Music

Anghami Launches its 2024 in Music Campaign and Reveals Official Music Charts

Abu Dhabi, UAE – 28 November 2024 - Anghami Inc. (NASDAQ: ANGH), the leading music and entertainment audio streaming...

by Nour Sawli
November 28, 2024
أنغامي تُطلق حملتها “2024 في الموسيقى” وتكشف عن الإحصائيات الموسيقية الرسمية على منصّتها
Music

أنغامي تُطلق حملتها “2024 في الموسيقى” وتكشف عن الإحصائيات الموسيقية الرسمية على منصّتها

- أطلقت أنغامي (المدرجة في بورصة ناسداك تحت الرمز NASDAQ: ANGH)، منصّة بث...

by Nour Sawli
November 28, 2024
+OSN تتعاون مع شركة castLabs لتعزيز حماية المحتوى على منصتها الرقمية
Engineering

+OSN تتعاون مع شركة castLabs لتعزيز حماية المحتوى على منصتها الرقمية

أعلنت castLabs، الشركة الرائدة في تكنولوجيا الفيديو الرقمي، عن تعاونها مع +OSN لتقديم تقنية "دي آر إم توداي" لحماية...

by Nour Sawli
September 11, 2024
OSN+ Partners with castLabs to Enhance Content Protection with Cutting-edge Multi-DRM Technology, DRMtoday
Engineering

OSN+ Partners with castLabs to Enhance Content Protection with Cutting-edge Multi-DRM Technology, DRMtoday

OSN+ has partnered with castLabs to implement DRMtoday, a cloud-based digital rights management (DRM) solution aiming to safeguard it's...

by Nour Sawli
September 11, 2024
Next Post
Anghami Introduces Interactive Music Sharing on Facebook Stories

Anghami Introduces Interactive Music Sharing on Facebook Stories

  • Anghami Files 2023 Annual Report and Announces 2024 Q1 Results, Highlighting 18% Growth in Subscribers and Significant Margin Improvement

    Anghami Files 2023 Annual Report and Announces 2024 Q1 Results, Highlighting 18% Growth in Subscribers and Significant Margin Improvement

    0 shares
    Share 0 Tweet 0
  • EA SPORTS™ AND ANGHAMI ANNOUNCE FIFA 23 GLOBAL IN GAME VANITY DROP

    0 shares
    Share 0 Tweet 0
  • Anghami and OSN+ Successfully Complete Milestone Transaction, Creating an Entertainment Powerhouse

    0 shares
    Share 0 Tweet 0
  • Hidden Anghami Features

    0 shares
    Share 0 Tweet 0
  • Anghami contributes to the first-ever IFPI MENA chart

    0 shares
    Share 0 Tweet 0

About Anghami . Join Our Team . Go To app

© 2021 Anghami

No Result
View All Result
  • Homepage
  • Engineering
  • Product
  • What’s New
  • For Brands
  • Music
  • Life at Anghami

© 2020 Anghami blog