PyCon DE & PyData 2026

Leveraging Hexagonal Architecture When Building Applications
2026-04-15 , Platinum [2nd Floor]

Hexagonal architecture in software development is a design pattern that has existed for more than 20 years and remains highly applicable today as we enter an era where LLMs are increasingly used as development tools. At a high level, it can be used to create distinct layers within an application, resulting in more maintainable and flexible code. One of the primary benefits of utilizing this architecture is the separation of concerns, allowing different components of software to be swapped as needed - whether that is business logic, database technologies, or external services. In this talk, I will discuss the benefits and practical applications of hexagonal architecture. I will also include a detailed walkthrough of how this pattern is implemented in a real-world application.


This talk will cover the following related to hexagonal architecture:

Introduction
The hexagonal architecture design pattern, also known as “Ports and Adapters”, was introduced by Alistair Cockburn in the early 2000s. With the increase in usage of LLMs as software development tools, this design pattern can help create clear boundaries within applications and make code more understandable and modifiable by AI tools.

Core principles and concepts
In this section, I will discuss the fundamental concepts that make hexagonal architecture effective. This includes, the central application core (business logic/domain), ports (interfaces that define contracts), and adapters (implementations that handle external interactions, for example interaction with a database or external services).

Benefits and problem-solving capabilities
The discussion will highlight benefits including enhanced testability, improved maintainability by reducing coupling, and easier technology migration. I'll demonstrate how hexagonal architecture addresses common development pain points such as database lock-in, framework dependencies, and the challenge of writing effective unit tests.

Implementation and real-world case study
Included in this presentation will be a real-world case study of how hexagonal architecture is implemented in a production application. This example will demonstrate how to handle common scenarios such as database functionality, external API integration, and user management. The case study will show actual Python code, highlighting patterns for repository implementations, service layers, and adapter configurations.

Conclusion and Q&A
The presentation concludes with the key takeaways, resources for further learning, and an interactive Q&A session.


Expected audience expertise in your talk's domain:: Novice Expected audience expertise in Python:: Intermediate
See also: Powerpoint slides (8.0 MB)

I started my career as a data scientist in the oil and gas industry, where I worked on building services to deploy machine learning models in a production environment. Currently, I work as a software engineer at Rosenxt on a cloud backend team building a multi-tenant data management system. I am passionate about the combination of data science and software engineering and continuing to grow in both fields.