Back to Engineering
2023

da-vinci

Python · framework · serverless · cloud-native · infrastructure
View repository

da-vinci is a Python framework for building serverless AWS cloud-native applications. It handles the patterns every serverless project needs (ORM, event bus, configuration, exception handling, service discovery) so the work can focus on the actual application.

Why I built it

I kept reinventing the same things every time I started a new serverless project on AWS. DynamoDB ORM, inter-service communication, configuration management, dependency wiring, exception handling. Every project had its own version with its own bugs.

I also wanted a level of observability into serverless executions that wasn't easy to get otherwise. When you're running dozens of Lambda functions processing thousands of events, you need to capture failures in a way that lets you inspect and address them without digging through CloudWatch. da-vinci gave me that, which is what made it possible to build systems like IRIS that run at scale and still cost almost nothing to operate.

How it works

The framework is split into two libraries. da_vinci handles core application logic: a DynamoDB ORM with table-driven infrastructure, an event bus for inter-service communication, exception trapping and reporting, global settings management, and service discovery. da_vinci-cdk handles infrastructure as code through custom CDK constructs for Lambda, DynamoDB, and supporting services.

Infrastructure is derived from table definitions. You define your data model once and the framework generates the DynamoDB tables, the ORM layer, and the CDK constructs. Configuration management and resource discovery eliminate the most common CloudFormation pitfalls. The framework stays close to AWS without hiding the underlying services, so you always have direct access to boto3 when you need it.

da-vinci powers IRIS, Ratio, and a number of other production systems I've built.