SlideShare a Scribd company logo
1 of 42
Download to read offline
Serverless Compose
vs
Data Warehouse
Artur Wita
The overall brief of the presentation:
Agenda
It’s not a golden hammer but only an attempt.
● Intro
● Problem context
● Solution
● Challenges
○ Architectural
○ Serverless
● Results
About me
● Node.js Developer with 2 years of commercial experience
(1 year in Serverless Framework)
● At The Software House, I am responsible for greeting new
resources employees (occasionally blowing up production)
● Co-author of the data warehouse
● Privately mountains lover, sports freak (hiking, ice skating,
swimming, ultimate frisbee), workation enthusiast,
and a friendly-neighborhood rapper
A data warehouse is a system responsible for gathering miscellaneous data. 🙃
Intro
One of the most important things to take care of in such systems are:
● ensuring that the data is up to date
● having data backup / the ability to recreate data
● and surely something else
With data warehouses, we are able to create complex queries useful for analyzing the trends
in order to make decisions that are going to define our future decisions.
Sounds good?
Because it is good…
but…
How we built our data warehouse?
Our internal data warehouse is based on AWS Step Functions.
● ensuring that the data is up to date
○ cron jobs responsible for updating the data every day
● having data backup / the ability to recreate data
○ manually-triggered recreate workflows
Almost each feature supports 2 workflows, sometimes we were
able to use the recreate flow for updating the data.
Extract
● Collect data e.g. from an external API
2 3
How does a workflow might look like?
1
Transform
● Transform and model raw data
Load
● Store the data in the database
Granulation advantages
Building workflows using single-responsible lambdas has many
benefits, such as:
● easier testing
● reusable steps
● improved scalability
● ability to adjust particular resources
(memory size, timeouts, etc.)
● easier debugging
(a graphical representation of steps)
Time for some maths
At the time of making the decision to split our warehouse
we had about 16 features.
Each feature supported 2 workflows.
Each workflow consisted of average 3-4 lambdas*.
16 features • 4 lambdas = 64 lambdas
An average time of a deployment of the whole application*
was something between 18 - 20 minutes.
And we still had a small warehouse...
One workflow does not make a difference, but how about seventeen?
Can we fix it?
Serverless Compose is an official package created to
“simplify deploying and orchestrating multiple services”.
The key features allow us to:
● Deploy multiple services in parallel
● Deploy services in a specific order
● Share outputs from one service to another
● Run commands across multiple services
Serverless Compose
The heart of each Serverless Framework application is
a serverless.yml file. It's used for configuring things such as:
How does it work?
In a certain sense what Serverless Compose does
is handle multiple serverless.yml files and specify
dependencies between services described by them.
● the framework itself
● cloud provider (e.g. AWS, Azure, Google)
● functions
● state machines
● resources
● etc.
There are two ways of specifying dependencies
between services:
Dependent services
● implicit - by referencing a resource belonging to
another service
● explicit - by marking a service as a dependent
Firstly the downstream is deployed, then the target.
Come on,
it’s easy!
It’s not a problem - it’s a challenge
Serverless
Architectural
● How should we organize directories?
● Where should we put shared code?
● What about configuration files?
● Are we going to have a problem with the database?
● At least we can share webpack config, can’t we?
● How many deployment buckets are we going to need?
The same for the data lake ones?
● Are we still going to be able to work locally?
● Will pipelines configuration be troublesome?
Goals
Our aim was to achieve the following criteria:
● shorten deployment time
● allow the ability to deploy a single service
as well as everything at once
● maintain the ability to work locally
● keep a single package.json*
Architectural
challenges
Organising directories
We decided to split features by domains and created 4 services:
● api
● finance
● migrations
● people
In each service, we kept the previous directories structure
(functions + shared).
Also, we kept the original shared folder in the project’s root
directory.
Organising directories
Before: After:
Configuration files
Since the very beginning, we opted for small, dedicated configs,
rather than one huge config. Thanks to that, we were able to:
● keep feature-specific configs in features’ directories
● keep service-specific configs in the service’s shared directory
● keep common configs in the project’s shared directory
In order to hermetise environment variables we split the original
.env file and created dedicated .envs per each service.
Configuration files
Before: After:
Database configuration
Because of a few saboteurs, we decided to keep all models in the
project’s shared directory.
Even though we put all models in the same directory, we were able
to create separate, slightly differing ORM configs per each service.
In order to keep our database in sync, we created a dedicated
service for migrations and marked other services as a dependent.
Database configuration
Migration: Others:
Serverless
challenges
Webpack configuration
If it looks the same, it works the same, right?
It seems that nope. 😕
What could be the reason?
A single static config was causing a race.
As soon as we created dedicated config for every service
our serverless roads were safe again.
Webpack configuration
Before: After:
S3 buckets
Although the Serverless Framework allows us to use an existing
bucket for uploading source code files, we still had to use
separate deployment buckets per each service.
Also, we decided to split our data lake bucket as well, so that
every service has its own one. That was not necessary,
however, we thought that such hermetization might be valuable.
We only had to migrate the data from the old data lake bucket to
the new ones. For that we used the AWS CLI sync method.
S3 buckets
Before: After:
Local environment
The great thing about our warehouse is its ability to run 100%
locally. That is why we had to maintain it.
We achieved it by:
● using service-dedicated commands
● assigning unique http and lambda ports to each service
The only thing that was left was refactoring docker-compose.yml
by adding local step functions instances per each service.
Local environment
Before: After:
After: We had to use different ports to be able to run multiple services concurrently.
Pipelines
We had to slightly refactor our pipelines too.
That consisted of:
● adding a few more pipelines to be able to deploy each
service independently to each environment
● call the lambda responsible for running migrations in a
different way
Before: A single definition for the deploy step. Migrations are being run immediately after the deployment.
After: A single definition per each service. To run migrations we need to call the migrations-service.
Results
Before After Difference
Services count 1 service 4 services +3 services
Deployment time
(all at once)
20 minutes 10 minutes - 10 minutes
Monthly cost X Y Δ ≈ 0
Capabilities 100% 100% none
Tips & tricks
Despite gaining knowledge on how to split an application using
Serverless Compose we also made some observations:
● use short services names
● name your resources using a common prefix:
<service><stage><resource_name>
● don’t be afraid of the lack of serverless knowledge
Summary
We managed not only to shorten the deployment time of our
warehouse but also to make it scalable.
The application is still easy to maintain thanks to its modular
structure.
Serverless Compose is a truly powerful tool and you should
definitely give it a try!
Q&A
Join the community!
https://tsh.io/programowanko https://github.com/arturwita/serverless-compose-boilerplate
tsh.io
Thank you
for your attention
Serverless Compose vs Data Warehouse

More Related Content

Similar to Serverless Compose vs hurtownia danych

Introduction to amazon web services for developers
Introduction to amazon web services for developersIntroduction to amazon web services for developers
Introduction to amazon web services for developersCiklum Ukraine
 
Migrating a multi tenant app to Azure (war biopic)
Migrating a multi tenant app to Azure (war biopic)Migrating a multi tenant app to Azure (war biopic)
Migrating a multi tenant app to Azure (war biopic)★ Akshay Surve
 
Writing and deploying serverless python applications
Writing and deploying serverless python applicationsWriting and deploying serverless python applications
Writing and deploying serverless python applicationsCesar Cardenas Desales
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - TalkMatthias Noback
 
Serverless at Lifestage
Serverless at LifestageServerless at Lifestage
Serverless at LifestageBATbern
 
#SpFestSea azr203 Azure functions lessons learned
#SpFestSea azr203 Azure functions lessons learned#SpFestSea azr203 Azure functions lessons learned
#SpFestSea azr203 Azure functions lessons learnedVincent Biret
 
introduction to micro services
introduction to micro servicesintroduction to micro services
introduction to micro servicesSpyros Lambrinidis
 
Mongo DB at Community Engine
Mongo DB at Community EngineMongo DB at Community Engine
Mongo DB at Community EngineCommunity Engine
 
MongoDB at community engine
MongoDB at community engineMongoDB at community engine
MongoDB at community enginemathraq
 
Truemotion Adventures in Containerization
Truemotion Adventures in ContainerizationTruemotion Adventures in Containerization
Truemotion Adventures in ContainerizationRyan Hunter
 
Open shift and docker - october,2014
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014Hojoong Kim
 
19. Cloud Native Computing - Kubernetes - Bratislava - Databases in K8s world
19. Cloud Native Computing - Kubernetes - Bratislava - Databases in K8s world19. Cloud Native Computing - Kubernetes - Bratislava - Databases in K8s world
19. Cloud Native Computing - Kubernetes - Bratislava - Databases in K8s worldDávid Kőszeghy
 
Devops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftDevops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftYaniv cohen
 
Building FoundationDB
Building FoundationDBBuilding FoundationDB
Building FoundationDBFoundationDB
 
[AWS DC Meetup] Not Your Father’s WebApp: The Cloud-Native Architecture of im...
[AWS DC Meetup] Not Your Father’s WebApp: The Cloud-Native Architecture of im...[AWS DC Meetup] Not Your Father’s WebApp: The Cloud-Native Architecture of im...
[AWS DC Meetup] Not Your Father’s WebApp: The Cloud-Native Architecture of im...Chris Shenton
 
Snowflake Automated Deployments / CI/CD Pipelines
Snowflake Automated Deployments / CI/CD PipelinesSnowflake Automated Deployments / CI/CD Pipelines
Snowflake Automated Deployments / CI/CD PipelinesDrew Hansen
 
Nagios Conference 2014 - Bryan Heden - 10,000 Services Across The State of Ohio
Nagios Conference 2014 - Bryan Heden - 10,000 Services Across The State of OhioNagios Conference 2014 - Bryan Heden - 10,000 Services Across The State of Ohio
Nagios Conference 2014 - Bryan Heden - 10,000 Services Across The State of OhioNagios
 
The great migration embracing serverless first
The great migration  embracing serverless first The great migration  embracing serverless first
The great migration embracing serverless first AngelaTimofte1
 
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...DynamicInfraDays
 

Similar to Serverless Compose vs hurtownia danych (20)

Introduction to amazon web services for developers
Introduction to amazon web services for developersIntroduction to amazon web services for developers
Introduction to amazon web services for developers
 
Migrating a multi tenant app to Azure (war biopic)
Migrating a multi tenant app to Azure (war biopic)Migrating a multi tenant app to Azure (war biopic)
Migrating a multi tenant app to Azure (war biopic)
 
Writing and deploying serverless python applications
Writing and deploying serverless python applicationsWriting and deploying serverless python applications
Writing and deploying serverless python applications
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - Talk
 
[AWS Builders] Effective AWS Glue
[AWS Builders] Effective AWS Glue[AWS Builders] Effective AWS Glue
[AWS Builders] Effective AWS Glue
 
Serverless at Lifestage
Serverless at LifestageServerless at Lifestage
Serverless at Lifestage
 
#SpFestSea azr203 Azure functions lessons learned
#SpFestSea azr203 Azure functions lessons learned#SpFestSea azr203 Azure functions lessons learned
#SpFestSea azr203 Azure functions lessons learned
 
introduction to micro services
introduction to micro servicesintroduction to micro services
introduction to micro services
 
Mongo DB at Community Engine
Mongo DB at Community EngineMongo DB at Community Engine
Mongo DB at Community Engine
 
MongoDB at community engine
MongoDB at community engineMongoDB at community engine
MongoDB at community engine
 
Truemotion Adventures in Containerization
Truemotion Adventures in ContainerizationTruemotion Adventures in Containerization
Truemotion Adventures in Containerization
 
Open shift and docker - october,2014
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014
 
19. Cloud Native Computing - Kubernetes - Bratislava - Databases in K8s world
19. Cloud Native Computing - Kubernetes - Bratislava - Databases in K8s world19. Cloud Native Computing - Kubernetes - Bratislava - Databases in K8s world
19. Cloud Native Computing - Kubernetes - Bratislava - Databases in K8s world
 
Devops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftDevops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShift
 
Building FoundationDB
Building FoundationDBBuilding FoundationDB
Building FoundationDB
 
[AWS DC Meetup] Not Your Father’s WebApp: The Cloud-Native Architecture of im...
[AWS DC Meetup] Not Your Father’s WebApp: The Cloud-Native Architecture of im...[AWS DC Meetup] Not Your Father’s WebApp: The Cloud-Native Architecture of im...
[AWS DC Meetup] Not Your Father’s WebApp: The Cloud-Native Architecture of im...
 
Snowflake Automated Deployments / CI/CD Pipelines
Snowflake Automated Deployments / CI/CD PipelinesSnowflake Automated Deployments / CI/CD Pipelines
Snowflake Automated Deployments / CI/CD Pipelines
 
Nagios Conference 2014 - Bryan Heden - 10,000 Services Across The State of Ohio
Nagios Conference 2014 - Bryan Heden - 10,000 Services Across The State of OhioNagios Conference 2014 - Bryan Heden - 10,000 Services Across The State of Ohio
Nagios Conference 2014 - Bryan Heden - 10,000 Services Across The State of Ohio
 
The great migration embracing serverless first
The great migration  embracing serverless first The great migration  embracing serverless first
The great migration embracing serverless first
 
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
 

More from The Software House

Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...
Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...
Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...The Software House
 
Jak efektywnie podejść do certyfikacji w AWS?
Jak efektywnie podejść do certyfikacji w AWS?Jak efektywnie podejść do certyfikacji w AWS?
Jak efektywnie podejść do certyfikacji w AWS?The Software House
 
O co chodzi z tą dostępnością cyfrową?
O co chodzi z tą dostępnością cyfrową?O co chodzi z tą dostępnością cyfrową?
O co chodzi z tą dostępnością cyfrową?The Software House
 
Chat tekstowy z użyciem Amazon Chime
Chat tekstowy z użyciem Amazon ChimeChat tekstowy z użyciem Amazon Chime
Chat tekstowy z użyciem Amazon ChimeThe Software House
 
Jak nie zwariować z architekturą Serverless?
Jak nie zwariować z architekturą Serverless?Jak nie zwariować z architekturą Serverless?
Jak nie zwariować z architekturą Serverless?The Software House
 
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWS
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWSAnaliza semantyczna artykułów prasowych w 5 sprintów z użyciem AWS
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWSThe Software House
 
Feature flags na ratunek projektu w JavaScript
Feature flags na ratunek projektu w JavaScriptFeature flags na ratunek projektu w JavaScript
Feature flags na ratunek projektu w JavaScriptThe Software House
 
Typowanie nominalne w TypeScript
Typowanie nominalne w TypeScriptTypowanie nominalne w TypeScript
Typowanie nominalne w TypeScriptThe Software House
 
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQL
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQLAutomatyzacja tworzenia frontendu z wykorzystaniem GraphQL
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQLThe Software House
 
Testy API: połączenie z bazą danych czy implementacja w pamięci
Testy API: połączenie z bazą danych czy implementacja w pamięciTesty API: połączenie z bazą danych czy implementacja w pamięci
Testy API: połączenie z bazą danych czy implementacja w pamięciThe Software House
 
Jak skutecznie read model. Case study
Jak skutecznie read model. Case studyJak skutecznie read model. Case study
Jak skutecznie read model. Case studyThe Software House
 
Firestore czyli ognista baza od giganta z Doliny Krzemowej
Firestore czyli ognista baza od giganta z Doliny KrzemowejFirestore czyli ognista baza od giganta z Doliny Krzemowej
Firestore czyli ognista baza od giganta z Doliny KrzemowejThe Software House
 
Jak utrzymać stado Lambd w ryzach
Jak utrzymać stado Lambd w ryzachJak utrzymać stado Lambd w ryzach
Jak utrzymać stado Lambd w ryzachThe Software House
 
O łączeniu Storyblok i Next.js
O łączeniu Storyblok i Next.jsO łączeniu Storyblok i Next.js
O łączeniu Storyblok i Next.jsThe Software House
 
Amazon Step Functions. Sposób na implementację procesów w chmurze
Amazon Step Functions. Sposób na implementację procesów w chmurzeAmazon Step Functions. Sposób na implementację procesów w chmurze
Amazon Step Functions. Sposób na implementację procesów w chmurzeThe Software House
 
Od Figmy do gotowej aplikacji bez linijki kodu
Od Figmy do gotowej aplikacji bez linijki koduOd Figmy do gotowej aplikacji bez linijki kodu
Od Figmy do gotowej aplikacji bez linijki koduThe Software House
 
Co QA może i czego nie powinien się bać?
Co QA może i czego nie powinien się bać?Co QA może i czego nie powinien się bać?
Co QA może i czego nie powinien się bać?The Software House
 

More from The Software House (20)

Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...
Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...
Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...
 
Uszanowanko Podsumowanko
Uszanowanko PodsumowankoUszanowanko Podsumowanko
Uszanowanko Podsumowanko
 
Jak efektywnie podejść do certyfikacji w AWS?
Jak efektywnie podejść do certyfikacji w AWS?Jak efektywnie podejść do certyfikacji w AWS?
Jak efektywnie podejść do certyfikacji w AWS?
 
O co chodzi z tą dostępnością cyfrową?
O co chodzi z tą dostępnością cyfrową?O co chodzi z tą dostępnością cyfrową?
O co chodzi z tą dostępnością cyfrową?
 
Chat tekstowy z użyciem Amazon Chime
Chat tekstowy z użyciem Amazon ChimeChat tekstowy z użyciem Amazon Chime
Chat tekstowy z użyciem Amazon Chime
 
Migracje danych serverless
Migracje danych serverlessMigracje danych serverless
Migracje danych serverless
 
Jak nie zwariować z architekturą Serverless?
Jak nie zwariować z architekturą Serverless?Jak nie zwariować z architekturą Serverless?
Jak nie zwariować z architekturą Serverless?
 
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWS
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWSAnaliza semantyczna artykułów prasowych w 5 sprintów z użyciem AWS
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWS
 
Feature flags na ratunek projektu w JavaScript
Feature flags na ratunek projektu w JavaScriptFeature flags na ratunek projektu w JavaScript
Feature flags na ratunek projektu w JavaScript
 
Typowanie nominalne w TypeScript
Typowanie nominalne w TypeScriptTypowanie nominalne w TypeScript
Typowanie nominalne w TypeScript
 
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQL
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQLAutomatyzacja tworzenia frontendu z wykorzystaniem GraphQL
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQL
 
Testy API: połączenie z bazą danych czy implementacja w pamięci
Testy API: połączenie z bazą danych czy implementacja w pamięciTesty API: połączenie z bazą danych czy implementacja w pamięci
Testy API: połączenie z bazą danych czy implementacja w pamięci
 
Jak skutecznie read model. Case study
Jak skutecznie read model. Case studyJak skutecznie read model. Case study
Jak skutecznie read model. Case study
 
Firestore czyli ognista baza od giganta z Doliny Krzemowej
Firestore czyli ognista baza od giganta z Doliny KrzemowejFirestore czyli ognista baza od giganta z Doliny Krzemowej
Firestore czyli ognista baza od giganta z Doliny Krzemowej
 
Jak utrzymać stado Lambd w ryzach
Jak utrzymać stado Lambd w ryzachJak utrzymać stado Lambd w ryzach
Jak utrzymać stado Lambd w ryzach
 
Jak poskromić AWS?
Jak poskromić AWS?Jak poskromić AWS?
Jak poskromić AWS?
 
O łączeniu Storyblok i Next.js
O łączeniu Storyblok i Next.jsO łączeniu Storyblok i Next.js
O łączeniu Storyblok i Next.js
 
Amazon Step Functions. Sposób na implementację procesów w chmurze
Amazon Step Functions. Sposób na implementację procesów w chmurzeAmazon Step Functions. Sposób na implementację procesów w chmurze
Amazon Step Functions. Sposób na implementację procesów w chmurze
 
Od Figmy do gotowej aplikacji bez linijki kodu
Od Figmy do gotowej aplikacji bez linijki koduOd Figmy do gotowej aplikacji bez linijki kodu
Od Figmy do gotowej aplikacji bez linijki kodu
 
Co QA może i czego nie powinien się bać?
Co QA może i czego nie powinien się bać?Co QA może i czego nie powinien się bać?
Co QA może i czego nie powinien się bać?
 

Recently uploaded

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 

Recently uploaded (20)

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 

Serverless Compose vs hurtownia danych

  • 2. The overall brief of the presentation: Agenda It’s not a golden hammer but only an attempt. ● Intro ● Problem context ● Solution ● Challenges ○ Architectural ○ Serverless ● Results
  • 3. About me ● Node.js Developer with 2 years of commercial experience (1 year in Serverless Framework) ● At The Software House, I am responsible for greeting new resources employees (occasionally blowing up production) ● Co-author of the data warehouse ● Privately mountains lover, sports freak (hiking, ice skating, swimming, ultimate frisbee), workation enthusiast, and a friendly-neighborhood rapper
  • 4. A data warehouse is a system responsible for gathering miscellaneous data. 🙃 Intro One of the most important things to take care of in such systems are: ● ensuring that the data is up to date ● having data backup / the ability to recreate data ● and surely something else With data warehouses, we are able to create complex queries useful for analyzing the trends in order to make decisions that are going to define our future decisions. Sounds good? Because it is good…
  • 6. How we built our data warehouse? Our internal data warehouse is based on AWS Step Functions. ● ensuring that the data is up to date ○ cron jobs responsible for updating the data every day ● having data backup / the ability to recreate data ○ manually-triggered recreate workflows Almost each feature supports 2 workflows, sometimes we were able to use the recreate flow for updating the data.
  • 7. Extract ● Collect data e.g. from an external API 2 3 How does a workflow might look like? 1 Transform ● Transform and model raw data Load ● Store the data in the database
  • 8. Granulation advantages Building workflows using single-responsible lambdas has many benefits, such as: ● easier testing ● reusable steps ● improved scalability ● ability to adjust particular resources (memory size, timeouts, etc.) ● easier debugging (a graphical representation of steps)
  • 9. Time for some maths At the time of making the decision to split our warehouse we had about 16 features. Each feature supported 2 workflows. Each workflow consisted of average 3-4 lambdas*. 16 features • 4 lambdas = 64 lambdas An average time of a deployment of the whole application* was something between 18 - 20 minutes. And we still had a small warehouse...
  • 10. One workflow does not make a difference, but how about seventeen?
  • 11. Can we fix it?
  • 12. Serverless Compose is an official package created to “simplify deploying and orchestrating multiple services”. The key features allow us to: ● Deploy multiple services in parallel ● Deploy services in a specific order ● Share outputs from one service to another ● Run commands across multiple services Serverless Compose
  • 13. The heart of each Serverless Framework application is a serverless.yml file. It's used for configuring things such as: How does it work? In a certain sense what Serverless Compose does is handle multiple serverless.yml files and specify dependencies between services described by them. ● the framework itself ● cloud provider (e.g. AWS, Azure, Google) ● functions ● state machines ● resources ● etc.
  • 14. There are two ways of specifying dependencies between services: Dependent services ● implicit - by referencing a resource belonging to another service ● explicit - by marking a service as a dependent Firstly the downstream is deployed, then the target.
  • 16. It’s not a problem - it’s a challenge Serverless Architectural ● How should we organize directories? ● Where should we put shared code? ● What about configuration files? ● Are we going to have a problem with the database? ● At least we can share webpack config, can’t we? ● How many deployment buckets are we going to need? The same for the data lake ones? ● Are we still going to be able to work locally? ● Will pipelines configuration be troublesome?
  • 17. Goals Our aim was to achieve the following criteria: ● shorten deployment time ● allow the ability to deploy a single service as well as everything at once ● maintain the ability to work locally ● keep a single package.json*
  • 19. Organising directories We decided to split features by domains and created 4 services: ● api ● finance ● migrations ● people In each service, we kept the previous directories structure (functions + shared). Also, we kept the original shared folder in the project’s root directory.
  • 21. Configuration files Since the very beginning, we opted for small, dedicated configs, rather than one huge config. Thanks to that, we were able to: ● keep feature-specific configs in features’ directories ● keep service-specific configs in the service’s shared directory ● keep common configs in the project’s shared directory In order to hermetise environment variables we split the original .env file and created dedicated .envs per each service.
  • 23. Database configuration Because of a few saboteurs, we decided to keep all models in the project’s shared directory. Even though we put all models in the same directory, we were able to create separate, slightly differing ORM configs per each service. In order to keep our database in sync, we created a dedicated service for migrations and marked other services as a dependent.
  • 26. Webpack configuration If it looks the same, it works the same, right? It seems that nope. 😕 What could be the reason? A single static config was causing a race. As soon as we created dedicated config for every service our serverless roads were safe again.
  • 28. S3 buckets Although the Serverless Framework allows us to use an existing bucket for uploading source code files, we still had to use separate deployment buckets per each service. Also, we decided to split our data lake bucket as well, so that every service has its own one. That was not necessary, however, we thought that such hermetization might be valuable. We only had to migrate the data from the old data lake bucket to the new ones. For that we used the AWS CLI sync method.
  • 30. Local environment The great thing about our warehouse is its ability to run 100% locally. That is why we had to maintain it. We achieved it by: ● using service-dedicated commands ● assigning unique http and lambda ports to each service The only thing that was left was refactoring docker-compose.yml by adding local step functions instances per each service.
  • 32. After: We had to use different ports to be able to run multiple services concurrently.
  • 33. Pipelines We had to slightly refactor our pipelines too. That consisted of: ● adding a few more pipelines to be able to deploy each service independently to each environment ● call the lambda responsible for running migrations in a different way
  • 34. Before: A single definition for the deploy step. Migrations are being run immediately after the deployment.
  • 35. After: A single definition per each service. To run migrations we need to call the migrations-service.
  • 37. Before After Difference Services count 1 service 4 services +3 services Deployment time (all at once) 20 minutes 10 minutes - 10 minutes Monthly cost X Y Δ ≈ 0 Capabilities 100% 100% none
  • 38. Tips & tricks Despite gaining knowledge on how to split an application using Serverless Compose we also made some observations: ● use short services names ● name your resources using a common prefix: <service><stage><resource_name> ● don’t be afraid of the lack of serverless knowledge
  • 39. Summary We managed not only to shorten the deployment time of our warehouse but also to make it scalable. The application is still easy to maintain thanks to its modular structure. Serverless Compose is a truly powerful tool and you should definitely give it a try!
  • 40. Q&A
  • 41. Join the community! https://tsh.io/programowanko https://github.com/arturwita/serverless-compose-boilerplate
  • 42. tsh.io Thank you for your attention Serverless Compose vs Data Warehouse