Knowledgebase

How Languages Communicate Print

  • programminglanguages, programming, database, performance, errors, guide, howto, solution
  • 0

Interoperability.

WHAT OPTIONS EXIST

Network APIs, over HTTP or another protocol Message queues Shared databases Foreign function interfaces, calling compiled code directly Command-line invocation Files

WHAT TO PREFER BETWEEN SERVICES

A defined network API, with a documented contract.

WHY

It decouples them, and either side can change independently.

WHAT TO AVOID

Sharing a database between services.

WHY

The schema becomes a shared dependency nobody can change.

WHAT A FOREIGN FUNCTION INTERFACE PROVIDES

Calling a library written in another language directly, in the same process.

WHAT IT SUITS

Performance-critical work, and using existing mature libraries.

WHAT IT COSTS

Complexity, and faults in the called code affecting your process.

WHAT TO DEFINE FOR ANY INTERFACE

The data format Error handling Versioning

WHY VERSIONING

Because one side will change before the other.

WHAT TO TEST

Both sides, against the contract.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot