tc's page

peace & chaos

not posts, but wikis

API design tenets

  • Never break backward compatibility.

    Our contract with our customers is sacrosanct. We will never violate that contract.

  • Work backward from customer use cases.
  • Create highly usable APIs but sometimes make intentional trade-offs for security, availability, latency, or cost.

    The best APIs are usable, secure, available, fast and cheap at the same time. When necessary, we make intentional trade-offs in usability or cost to improve security, availability or performance. We strive to find a solution which satisfies all concerns.

  • Create APIs which leverage a developer’s existing knowledge.

    Including terms, semantics, shapes, and industry standards.

  • Create APIs that are composable and consistent within and across services.
  • Create APIs that are self-describing and have a clear, specific purpose.
  • Create APIs with explicit and well-documented failure modes that are clear to customers.

Micro-service

In the micro-service pattern, each extension makes a call to a different service. There are several variants of this approach, including having a standard interface for all of the micro-services. Teams creating service extensions can use that interface, or put their business logic in an existing service that they own and add code to the primary service to follow their interface.

Benefits of micro-service federation

  • Provides clear ownership boundaries between Federator Team code and Plugin Team code
  • Plugin Team only needs to understand the micro-service interface and not all the complexity of the Federator Service
  • Can provide clear failure attribution to the Federatee Team
  • The code complexity of Federator & Federatee services are not dependent on the number of Federatee Teams
  • Standard tooling such as live merge, Gordian Knot, and Class Loaders work as expected

Costs of micro-service federation

  • Adds ongoing operations costs for the Federatee Team
  • Adds network latency
  • Each Federatee Team needs to understand how to write code for each micro-service contract they are implementing

Different Protocols

  • https://www.imaginarycloud.com/blog/grpc-vs-rest/
  • https://iq.opengenus.org/rpc-vs-rest/
  • https://www.smashingmagazine.com/2016/09/understanding-rest-and-rpc-for-http-apis/