What is middleware?

Definition from Google:

Middleware is software that acts as a translator or glue between different applications, allowing them to communicate, share data, and work together seamlessly in a distributed network.

  • = “software glue” that glues the applications in distributed network together - enables seamless communication and connection between each other
    • so that developers of the respective applications can focus on developing core business logic and they don’t have to care about the way different systems talk to each other

What types of middleware are there?

  • Web application middleware
    • there are often middleware functions in web frameworks (Express.js, Django, ASP.NET, Symfony…) that handle:
      • authentication, logging, error handling, data parsing etc. (before the data reach the main business logic)
    • e.g. in Symfony middleware exists mainly in the form of Events, that hook into specific parts of the lifecycle and perform wanted actions/edits
  • Database middleware
    • tools like
      • connection poolers - handle connections (pool of pre-ready connections for fast and efficient connecting) and their whole lifecycle
      • query optimizers - result caching, query rewriting, analysis data etc.
      • security, access control
  • API middleware
    • services, which handle API calls, rate limiting, authentication
    • format translation between different APIs
  • Message-oriented middleware
    • allow for asynchronous task handling (messages, message bus) and the whole lifecycle
    • it improves scalability of the whole system
  • Enterprise middleware
    • connects different business systems across a company (CRM, inventory, Admin, accounting etc.)
    • e.g. Enterprise service bus
  • Security middleware
    • firewalls, gateways etc.