Sote Slashes Latency More Than 2x Running Synadia’s NGS Utility

Brian Flannery

Posted on Sep 29th, 2022

Sote

  • Industry: Logistics forwarding serving Africa
  • Location: Nairobi, Kenyan
  • Employees: 50+
  • Tech Stack:AWS, PostgreSQL, Golang (back-end services), React (front-end), Synadia NGS
  • Language: Go

Summary

Sote provides digital logistics shipping products internationally to, from, and within Africa. The company operates an ERP system designed specifically for customs and shipping logistics in that continent. Sote CTO and co-founder Scott Yacko uses Synadia's NGS globally managed NATS.io service as the primary data and control plane for all the various back-end business services required to deliver application functionality. Sote initially built customer HTTP connections for service management but needed a messaging and connectivity platform with lower latency and higher performance. Yacko deployed NGS quickly, reducing latency by more than 2x, simplifying his code and cloud infrastructure, and future-proofing Sote for additional product requirements down the road.

Introduction

Sote provides a digital logistics support platform for shipping products internationally. International shipments require detailed understanding of customs laws and practices and specific tax requirements for different shipment types in different countries. A SaaS solution, Sote has created and operates an ERP system designed specifically for customs and logistics. The company focuses on the African market and aims to be the logistics gateway for the continent. Hosted in an AWS datacenter in Ireland, Sote’s architecture runs on Containers, with hundreds of containers running concurrently during peak times. Back-end services are written in Go connecting to a React front-end, with Postgres as its primary data store.

To ensure complete decoupling of all services down to the most atomic level possible, CTO and co-founder Scott Yacko created a system of “business services” that developers can compose into compound applications. Unlike microservices, where in a single organization, developer teams might create similar services, in Sote’s architecture there is only one business service for each specific use case. This creates better efficiency by preventing engineers from rewriting microservices and enforcing shared resources and consistency. As a former AWS director, Yacko wanted to minimize divergence and design a system that was fast, resilient, persistent, and efficient, reusing the same code resources and services as widely as possible.

Challenge: A Lightweight, Non-Blocking Communications Back-End

To compose applications from business services, “You can create what we refer to as a gatherer service, and its only purpose is to manage the interaction between those other two business services,” says Yacko. In this architecture, fast and flexible service-to-service communications is essential. Yacko has experience building out these back-end communications systems with JavaBeans and Kafka but wanted something more flexible and lightweight.

The Sote team initially built the communications mesh using HTTP. After considerable efforts to reduce latencies, Sote was still seeing wait times of two seconds or longer for some requests. “It was going through a ton of hops, and we tried everything to reduce the slow response. But it wasn’t meeting our needs for a responsive system,” says Yacko.

The effort to tune the bespoke communications service was taking up significant engineering resources and was requiring a larger infrastructure spend than Yacko had hoped. “We are a small company,” explained Yacko, “We can’t afford a lot of servers running in a lot of data centers.”  Because Sote was delivering a critical, time sensitive service, it needed guaranteed availability and data persistence. “We can’t just tell our clients as they are waiting to clear customs, ‘Sorry, we had to restart. We’ll get you your status soon.’”


Business Benefits

  • Improved customer experience
  • Ability to more easily extend and expand services
  • Reductions in engineering time and server costs

Technology Benefits

  • 2-3x reduction in communications latency
  • Simplification of tech stack
  • Reducing tech debt
  • Future-proofing app for IoT and scale-out operations

Solution: NATS.io and NGS Managed by Synadia

Yacko researched alternatives to Kafka and came across NATS.io. He asked his network of contacts if they had heard of NATS. Several told him they had used it and found it lightning-fast and easy to use. Yacko started prototyping and began asking questions in the NATS.io Slack. Synadia engineers guided him through a test deployment and gave him early access to NGS, a managed version of NATS operated by Synadia engineers. NGS offers the type of communication infrastructure that Sote needed as an on-demand, global utility optimized for easy scalability and minimal latency. As part of NATS and NGS, Sote also could use JetStream, a flexible but powerful persistence layer incorporated in the NATS server software. Sote was an early JetStream user.


“We started using NGS in production even prior to the GA,” says Yacko. “It’s been extremely high quality and extremely stable."

Scott Yacko -- CTO and co-founder, Sote


Results

It took Sote only 48 hours to set up a POC and test-drive NGS. “I loved what I saw and decided to use it in production,” says Yacko. With NGS, Sote enjoys request latencies of 500 to 700 milliseconds, which is 4-to-6 times faster than the previous system. “We started using NGS in production even prior to the GA,” says Yacko. “It’s been extremely high quality and extremely stable.

Yacko also viewed NATS and NGS to future-proof the Sote stack. “Unlike Kafka, I didn't have any pre-prescribed constraints. NATS is basically a scratch pad. I can do whatever I want to do in the header or in the body. I can parse text, binary or JSON, even in the same message.” When Sote eventually starts tracking shipments using IoT devices, NGS will help the company scale to a higher volume and also provide a scale-out communications backbone with global coverage.

NATS and NGS allowed the Sote back-end team to stop worrying about managing a mesh of HTTP connections and let NGS handle the connection fabric of business service communications. This included user management, security, gathering services into apps, observability, and all other core functions. “The backend team was ecstatic. We were taking exorbitant amounts of time tuning it and it just wasn't going to scale,” explains Yacko. “We were going to have to abandon the entire architecture. We went through a three-month effort to replace the HTTP with NATS while adding new features.”

Over time, Sote has continued to work closely with the Synadia engineering team to keep Sote’s applications running smoothly. “We have never had to wait more than 48 hours for Synadia to turn around an issue,” says Yacko. “You can’t ask for more than that as a startup company.”