Tag: python
- Understanding Distributed Tracing: A Python Guide with OpenTelemetry and Grafana Tempo (31 Oct 2023)
Tracing is a critical component of modern observability methods, along with metrics and logging. It is a technique used in software systems to monitor and profile the behavior of applications in a distributed, microservices-based environment. It helps you understand how requests flow through various components of your application and can be useful for diagnosing performance issues and understanding the interactions between services. - How to use Prometheus for web application monitoring (03 Mar 2023)
In this post, I would like to show how we can implement web application monitoring using Prometheus. We discuss how to choose some metrics as Service Level Indicators (SLIs) and also how to ensure system reliability by setting proper targets as System Level Objectives (SLOs) - Different types of application logic (04 Jul 2022)
In this post I would like to show that business rules can fall into various categories and what implications it could have. - An ORM can bite you (15 May 2022)
Object Relational Mappers (ORMs) are widely used in software development to abstract a database operations in our application code by providing a layer between object-oriented programming language and relational tables in a database. However we should be conscious that simple and inconspicuous expressions provided by our ORM can lead to heavy actions underhood. To present it I will take SQLAlchemy, one of the most popular ORM in Python world. - Value Object persistance strategies (04 Mar 2022)
Value objects are one of tactical building blocks for modeling business domain introduced and popularized by Domain Driven Design approach. However, we can exploit value objects even if we do not tackling complex domain problem. - GraphQL authentication and authorization (05 Jan 2022)
In this second post regarding GraphQL I would like to show how to manage authentication and authorization in GraphQL API. Authentication and authorization are often mixed each other but these concepts are responsible for different processes. The former determine user identity (whether user is logged in or 'recognized' by a system), while the latter refers to whether an authenticated user has access to a given resource. So usually authentication stage precede authorization one. - GraphQL API and REST API. Mirror implementations in Python (22 Dec 2021)
REST is probably the most popular way to expose your application to the external world (e.g. as a backend for frontend or to establish communication protocol with other application / service). However, GraphQL is now getting more and more popular, and have became a strong competitor for REST. - Coupling. Two perspectives (14 Dec 2021)
Coupling is a concept used in software engineering to define how tight is a relationship between system components (classes, modules, subsystems). Coupling is strictly connected to cohesion concept ("togetherness" of a component) and there is a common heuristic for software developers that we should design components that have high cohesion and are loosely coupled. - Ports and adapters architecture. Nameko microexample (02 Dec 2021)
Port and adapters (or hexagonal) architecture is a software design concept introduced by Alistair Cockburn in 2005. The main goal of it is to provide a clear seperation between application logic and external dependencies like database, user interface, framework providing HTTP requests, etc. - Persistance and domain model separation using SQLAlchemy ORM (28 Nov 2021)
You probably have heard about a test pyramid. It is the idea that tan application should have proper balance of automated tests on different layers. There should be a lot of unit tests, significantly less integration tests and a few UI tests (End2End, functional). The reasons for this are maintenence cost and speed of particular test type. Unit tests are usually fast and isolated from the rest of the code (so are easy to setup and maintain). - Flask MVT. Refactor to service layer (26 Nov 2021)
In this short post I would like to show how we can improve separation of concerns using Service Layer pattern within Model View Template approach.