SlideShare a Scribd company logo
High-Velocity
GraphQL & Lambda-based
Software Development Model
Who are we?
Sale Stock - Overview
● E-commerce founded in late 2014
○ Internal Engineering founded in early 2015
○ Launched our in-house website in mid-2015, app in late-2015
● Concentrated on women's fashion
○ Around Rp 100rb range as opposed to > Rp 200 range
○ Recently expanded to men’s fashion and women’s lifestyle
Sale Stock - Overview
● US$ 27 million Series B mid-2017
● Doubled revenue since then
● Margins comparable to European vertically-integrated unicorns
○ ASOS
○ Zalando
○ Boohoo.com
○ etc.
○ Margins still improving
Sale Stock - Multi-Layered Defensibles
● Vertically-integrated
● Business layers (all done in-house):
○ Merchandising
○ Manufacturing
○ Logistics
○ Customer Service
○ Finance
○ Etc.
● Inject software and automation in every layer of the vertical
integration
Sale Stock - Multi-Layered Defensibles
● This translates to a *LOT* of software
● ~15 user-facing applications internally, ~200 services
● BUT, decided to be simple organizationally
○ Want to financially make sense
○ 30+ software engineers, ~60 total in Engineering
○ A small team given the scale and diversity of portfolio
● How to do these without killing the engineers? Better tooling.
GraphQL is a query language for your API, and a server-side runtime for
executing queries by using a type system you define for your data.
GraphQL
● No overfetching, no-underfetching
● Super easy versioning
○ Single endpoint to maintain
○ Maintenance and deprecation can be done at the per-field level
○ Easy to support years-old clients this way
● But…
● Performance is a problem if not taken care of (a bit of a longer story)
● You’re still coding -- we can make this simpler!
Laskar
Automatic GraphQL CRUD-based logic generation tool
Laskar - Architectural Breakdown
● Schema
● Gateway
● Persistence
● Lambda
● Interface
Laskar - Schema
● Primary way developer inject behavior into the platform
● Developers write a declarative, YAML-based manifest file called
SDML (Sale Stock Domain Markup Language) -- no explicit
imperative-style coding
● Entity is a core concept declared in the SDML
Laskar - Schema
Laskar - Schema
● Entities are stored in the SQL-compliant persistence layer as a table
● Entities have “stored” properties
○ will be mapped to SQL table fields
● GraphQL CRUD queries and mutations will automatically be
“generated” for these entities
○ get<Entity>, create<Entity>, edit<Entity>, delete<Entity>, get<Entity>List, etc.
● Can also replace some straightforward SQL filtering logic
● Replaces tons of boilerplate -- can be thousands of lines of code!
○ Controller
○ DAL
○ etc.
Laskar - Schema
● Can also express SQL-based filtered
reads!
○ Implements WHERE and SORT BY clauses
○ GraphQL query is instantly available
○ Index is automatically created for the filtered
and sort fields
○ Good performance is automatic -- one less
thing for developers to take care of
○ Value caching (provided by the cache layer)
is also possible if you need the extra
performance
Laskar - Schema
● End-to-end Development flow is all integrated within a tool
○ Local development
○ Schema migration
○ Schema deployment
Laskar - Schema
Laskar-Gateway
Laskar - Gateway
● A horizontally-scaled set of a GraphQL-compliant server
● All Laskar-based requests (e.g. from front-end code) will go through
a single endpoint served by these servers.
● Dynamically performs GraphQL “behaviors” (queries, mutations,
types, etc.) based on currently-active Schema.
● Schemas are synced in realtime to the Gateway
Laskar - Schema
Laskar - Gateway
● The simplicity of the Gateway gives us:
○ No binary / image deployment! (deployment is just a schema update!)
○ No more extra running processes for each service
○ Free distributed tracing and observability in general! (since all sub-requests are
made by the gateway)
But what if my use cases extend beyond CRUD?
What if I want to have “funkier” logic?
Lambda
● Once you want to put custom logic, Lambda’s the answer
● A few integration points:
○ Entity’s computed properties
○ Root queries
● Entities can have “computed” properties (as opposed to “stored”), if
you want the properties to be computed on the fly with a Lambda
○ Product { score }
● Top-level queries that are outside of CRUD boundaries:
○ getTrendingProducts (needs access to data-intensive service)
Laskar - Lambda
Laskar - Lambda
● What is it?
○ A predefined, local function (sum, takeFirst, etc.)
○ A remote call
■ To a microservice
■ To a Cloud Function
Example query:
Declare a computed Property in SDML:
Declare the Lambda:
Implement the Lambda logic:
Persistence
Laskar - Data Persistence
● All entities’ stored properties are stored here
● Uses CockroachDB
○ NewSQL
○ SQL ACID capabilities, but with almost-linear NoSQL-like scaling capabilities
○ Add node for additional capacity -- simple scaling
○ Simple, Cassandra-like symmetrical node architecture
● Simple caching layer
○ Can cache:
■ Lambda return values
■ Stored properties
○ Invalidation is automatic (post-mutation) or TTL-based
Laskar - Query Lifecycle
Laskar - Query Persistence
● GraphQL queries have to be pre-registered (termed “Persisted
Query”)
● On build time, GraphQL queries are extracted out of source code,
hashed, and sent to the server for persistence. IDs are then assigned
to each query.
● On production, queries are then not sent on its raw text form, but
only its ID
Laskar - Query Persistence
● On production, queries are then not sent on its raw text form, but
only its ID
● Increases security and performance
Laskar - Query Planning
● Much like a SQL database, prior to execution, upon request, query
text is transformed to a Plan.
● Let’s visualize.
Laskar - Query Planning
● Query planning is done only once per query-ID -- after which the
plan output is cached.
● Subsequent query for that ID uses plan from the initial planning.
● Plan caching improves performance -- CPU usage is historically
extremely low in Laskar-Gateway
Laskar - Query Execution
● On the same stages, multiple requests to stored properties are
de-duped and batched into a single SQL query to the persistence
layer.
● Requests to similar lambdas are also de-duped (with some caveats).
● Automatically uses cached data for SQL-layer load-shedding.
Laskar - Interfaces
Laskar - Interfaces
● Admin interfaces for the data can also be created automatically
● No need for developers to write React / front-end code
● Everything is derived from the schema inspection and a simple
config file.
Laskar - Interfaces
Laskar - Where is it used currently?
● Sale Stock homepage! (specifically the banner management system)
● Product category management
● Image management system
● Promotion & landing page management system
● Many more in the pipeline!
Laskar - Benefits
● Much fewer lines of code -- virtually no boilerplate
● Can be used in 60-70% of use cases
○ If it’s simple CRUD, then it’s used
● Instant performance -- easy caching, indexing
○ Index creation is automatic
○ In the declaration, possible queries are defined upfront -- possible to force-create
indexes.
○ Reduces the number of avenues for possible developer mistakes
○ Caching is as easy as a one-liner -- invalidations are automatic
Laskar - Benefits
● Automatic schema migration
● In one case, 20k lines of code were replaced by < 300 lines of YAML
code -- identical feature set
● Instant deployment
● Huge hardware requirement savings
○ No set of new hardware needed for each new feature
○ Especially for low-traffic feature uses
● Non-programmers can theoretically implement features
That’s it!
We’re Hiring!
Some of our team members hail from:
Careers
● We’re hiring!
● Practically all zaman-now startup positions are available, but
highlighting two:
○ Front-end Platform Engineer
○ Data Platform Engineer
● https://careers.salestock.io
Careers - Front-end Platform Engineer
● Join a team with a knack for the bleeding edge
● We used:
○ React in early 2015 (with in-house server-side rendering)
○ RN in early 2016
○ GraphQL in early 2016
○ Single-codebase web/app React+RN in early 2016
○ Uses Apollo in late 2016
● Knack for implementing custom tooling where it makes sense
○ Laskar and lots of other internal tooling
● Write apps for millions of users
Careers - Data Platform Engineer
● Join a team that’s building a next-generation data platform that
empowers data scientists, analysts, and software engineers to
smoothly collaborate and fully-own their data science and pipeline.
● We craft and create the end-to-end platform with:
○ Jupyter Notebook
○ Apache Spark
○ Google Dataflow, Dataproc
○ Google BigQuery
○ Tensorflow
○ Kubeflow
○ Kubernetes
○ Lots of custom tooling
Thanks! Q & A?

More Related Content

What's hot

Evolution of apache spark
Evolution of apache sparkEvolution of apache spark
Evolution of apache spark
datamantra
 
Introduction to dataset
Introduction to datasetIntroduction to dataset
Introduction to dataset
datamantra
 
Building end to end streaming application on Spark
Building end to end streaming application on SparkBuilding end to end streaming application on Spark
Building end to end streaming application on Spark
datamantra
 
Introduction to concurrent programming with Akka actors
Introduction to concurrent programming with Akka actorsIntroduction to concurrent programming with Akka actors
Introduction to concurrent programming with Akka actors
Shashank L
 
Introduction to Datasource V2 API
Introduction to Datasource V2 APIIntroduction to Datasource V2 API
Introduction to Datasource V2 API
datamantra
 
Interactive Data Analysis in Spark Streaming
Interactive Data Analysis in Spark StreamingInteractive Data Analysis in Spark Streaming
Interactive Data Analysis in Spark Streaming
datamantra
 
Migrating to spark 2.0
Migrating to spark 2.0Migrating to spark 2.0
Migrating to spark 2.0
datamantra
 
Introduction to Flink Streaming
Introduction to Flink StreamingIntroduction to Flink Streaming
Introduction to Flink Streaming
datamantra
 
Introduction to Structured Data Processing with Spark SQL
Introduction to Structured Data Processing with Spark SQLIntroduction to Structured Data Processing with Spark SQL
Introduction to Structured Data Processing with Spark SQL
datamantra
 
Exploratory Data Analysis in Spark
Exploratory Data Analysis in SparkExploratory Data Analysis in Spark
Exploratory Data Analysis in Spark
datamantra
 
Migrating to Spark 2.0 - Part 2
Migrating to Spark 2.0 - Part 2Migrating to Spark 2.0 - Part 2
Migrating to Spark 2.0 - Part 2
datamantra
 
Introduction to Structured streaming
Introduction to Structured streamingIntroduction to Structured streaming
Introduction to Structured streaming
datamantra
 
Multi Source Data Analysis using Spark and Tellius
Multi Source Data Analysis using Spark and TelliusMulti Source Data Analysis using Spark and Tellius
Multi Source Data Analysis using Spark and Tellius
datamantra
 
Understanding time in structured streaming
Understanding time in structured streamingUnderstanding time in structured streaming
Understanding time in structured streaming
datamantra
 
Structured Streaming with Kafka
Structured Streaming with KafkaStructured Streaming with Kafka
Structured Streaming with Kafka
datamantra
 
Spark architecture
Spark architectureSpark architecture
Spark architecture
datamantra
 
When Apache Spark Meets TiDB with Xiaoyu Ma
When Apache Spark Meets TiDB with Xiaoyu MaWhen Apache Spark Meets TiDB with Xiaoyu Ma
When Apache Spark Meets TiDB with Xiaoyu Ma
Databricks
 
Core Services behind Spark Job Execution
Core Services behind Spark Job ExecutionCore Services behind Spark Job Execution
Core Services behind Spark Job Execution
datamantra
 
Storing State Forever: Why It Can Be Good For Your Analytics
Storing State Forever: Why It Can Be Good For Your AnalyticsStoring State Forever: Why It Can Be Good For Your Analytics
Storing State Forever: Why It Can Be Good For Your Analytics
Yaroslav Tkachenko
 
Anatomy of Data Source API : A deep dive into Spark Data source API
Anatomy of Data Source API : A deep dive into Spark Data source APIAnatomy of Data Source API : A deep dive into Spark Data source API
Anatomy of Data Source API : A deep dive into Spark Data source API
datamantra
 

What's hot (20)

Evolution of apache spark
Evolution of apache sparkEvolution of apache spark
Evolution of apache spark
 
Introduction to dataset
Introduction to datasetIntroduction to dataset
Introduction to dataset
 
Building end to end streaming application on Spark
Building end to end streaming application on SparkBuilding end to end streaming application on Spark
Building end to end streaming application on Spark
 
Introduction to concurrent programming with Akka actors
Introduction to concurrent programming with Akka actorsIntroduction to concurrent programming with Akka actors
Introduction to concurrent programming with Akka actors
 
Introduction to Datasource V2 API
Introduction to Datasource V2 APIIntroduction to Datasource V2 API
Introduction to Datasource V2 API
 
Interactive Data Analysis in Spark Streaming
Interactive Data Analysis in Spark StreamingInteractive Data Analysis in Spark Streaming
Interactive Data Analysis in Spark Streaming
 
Migrating to spark 2.0
Migrating to spark 2.0Migrating to spark 2.0
Migrating to spark 2.0
 
Introduction to Flink Streaming
Introduction to Flink StreamingIntroduction to Flink Streaming
Introduction to Flink Streaming
 
Introduction to Structured Data Processing with Spark SQL
Introduction to Structured Data Processing with Spark SQLIntroduction to Structured Data Processing with Spark SQL
Introduction to Structured Data Processing with Spark SQL
 
Exploratory Data Analysis in Spark
Exploratory Data Analysis in SparkExploratory Data Analysis in Spark
Exploratory Data Analysis in Spark
 
Migrating to Spark 2.0 - Part 2
Migrating to Spark 2.0 - Part 2Migrating to Spark 2.0 - Part 2
Migrating to Spark 2.0 - Part 2
 
Introduction to Structured streaming
Introduction to Structured streamingIntroduction to Structured streaming
Introduction to Structured streaming
 
Multi Source Data Analysis using Spark and Tellius
Multi Source Data Analysis using Spark and TelliusMulti Source Data Analysis using Spark and Tellius
Multi Source Data Analysis using Spark and Tellius
 
Understanding time in structured streaming
Understanding time in structured streamingUnderstanding time in structured streaming
Understanding time in structured streaming
 
Structured Streaming with Kafka
Structured Streaming with KafkaStructured Streaming with Kafka
Structured Streaming with Kafka
 
Spark architecture
Spark architectureSpark architecture
Spark architecture
 
When Apache Spark Meets TiDB with Xiaoyu Ma
When Apache Spark Meets TiDB with Xiaoyu MaWhen Apache Spark Meets TiDB with Xiaoyu Ma
When Apache Spark Meets TiDB with Xiaoyu Ma
 
Core Services behind Spark Job Execution
Core Services behind Spark Job ExecutionCore Services behind Spark Job Execution
Core Services behind Spark Job Execution
 
Storing State Forever: Why It Can Be Good For Your Analytics
Storing State Forever: Why It Can Be Good For Your AnalyticsStoring State Forever: Why It Can Be Good For Your Analytics
Storing State Forever: Why It Can Be Good For Your Analytics
 
Anatomy of Data Source API : A deep dive into Spark Data source API
Anatomy of Data Source API : A deep dive into Spark Data source APIAnatomy of Data Source API : A deep dive into Spark Data source API
Anatomy of Data Source API : A deep dive into Spark Data source API
 

Similar to Laskar: High-Velocity GraphQL & Lambda-based Software Development Model

Lambda Architecture with Spark
Lambda Architecture with SparkLambda Architecture with Spark
Lambda Architecture with Spark
Knoldus Inc.
 
Stream, stream, stream: Different streaming methods with Spark and Kafka
Stream, stream, stream: Different streaming methods with Spark and KafkaStream, stream, stream: Different streaming methods with Spark and Kafka
Stream, stream, stream: Different streaming methods with Spark and Kafka
Itai Yaffe
 
Not Your Father’s Web App: The Cloud-Native Architecture of images.nasa.gov
Not Your Father’s Web App: The Cloud-Native Architecture of images.nasa.govNot Your Father’s Web App: The Cloud-Native Architecture of images.nasa.gov
Not Your Father’s Web App: The Cloud-Native Architecture of images.nasa.gov
Chris Shenton
 
State of serverless
State of serverlessState of serverless
State of serverless
Anurag Saran
 
Grokking TechTalk #29: Building Realtime Metrics Platform at LinkedIn
Grokking TechTalk #29: Building Realtime Metrics Platform at LinkedInGrokking TechTalk #29: Building Realtime Metrics Platform at LinkedIn
Grokking TechTalk #29: Building Realtime Metrics Platform at LinkedIn
Grokking VN
 
Conquering the Lambda architecture in LinkedIn metrics platform with Apache C...
Conquering the Lambda architecture in LinkedIn metrics platform with Apache C...Conquering the Lambda architecture in LinkedIn metrics platform with Apache C...
Conquering the Lambda architecture in LinkedIn metrics platform with Apache C...
Khai Tran
 
RESTful Machine Learning with Flask and TensorFlow Serving - Carlo Mazzaferro
RESTful Machine Learning with Flask and TensorFlow Serving - Carlo MazzaferroRESTful Machine Learning with Flask and TensorFlow Serving - Carlo Mazzaferro
RESTful Machine Learning with Flask and TensorFlow Serving - Carlo Mazzaferro
PyData
 
Lessons from Building Large-Scale, Multi-Cloud, SaaS Software at Databricks
Lessons from Building Large-Scale, Multi-Cloud, SaaS Software at DatabricksLessons from Building Large-Scale, Multi-Cloud, SaaS Software at Databricks
Lessons from Building Large-Scale, Multi-Cloud, SaaS Software at Databricks
Databricks
 
Running R on AWS Lambda by Ana-Maria Niculescu
Running R on AWS Lambda by Ana-Maria NiculescuRunning R on AWS Lambda by Ana-Maria Niculescu
Running R on AWS Lambda by Ana-Maria Niculescu
Paris Women in Machine Learning and Data Science
 
AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...
Luciano Mammino
 
Stream, Stream, Stream: Different Streaming Methods with Spark and Kafka
Stream, Stream, Stream: Different Streaming Methods with Spark and KafkaStream, Stream, Stream: Different Streaming Methods with Spark and Kafka
Stream, Stream, Stream: Different Streaming Methods with Spark and Kafka
DataWorks Summit
 
Going Serverless with AWS Lambda at ReportGarden
Going Serverless with AWS Lambda at ReportGardenGoing Serverless with AWS Lambda at ReportGarden
Going Serverless with AWS Lambda at ReportGarden
Jay Gandhi
 
PHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
PHP At 5000 Requests Per Second: Hootsuite’s Scaling StoryPHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
PHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
vanphp
 
SF Big Analytics_20190612: Scaling Apache Spark on Kubernetes at Lyft
SF Big Analytics_20190612: Scaling Apache Spark on Kubernetes at LyftSF Big Analytics_20190612: Scaling Apache Spark on Kubernetes at Lyft
SF Big Analytics_20190612: Scaling Apache Spark on Kubernetes at Lyft
Chester Chen
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - Linagora
LINAGORA
 
NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1
Ruslan Meshenberg
 
Unifying Frontend and Backend Development with Scala - ScalaCon 2021
Unifying Frontend and Backend Development with Scala - ScalaCon 2021Unifying Frontend and Backend Development with Scala - ScalaCon 2021
Unifying Frontend and Backend Development with Scala - ScalaCon 2021
Taro L. Saito
 
Automating using Ansible
Automating using AnsibleAutomating using Ansible
Automating using Ansible
Alok Patra
 
Putting the Spark into Functional Fashion Tech Analystics
Putting the Spark into Functional Fashion Tech AnalysticsPutting the Spark into Functional Fashion Tech Analystics
Putting the Spark into Functional Fashion Tech Analystics
Gareth Rogers
 
Skillenza Build with Serverless Challenge - Advanced Serverless Concepts
Skillenza Build with Serverless Challenge -  Advanced Serverless ConceptsSkillenza Build with Serverless Challenge -  Advanced Serverless Concepts
Skillenza Build with Serverless Challenge - Advanced Serverless Concepts
Dhaval Nagar
 

Similar to Laskar: High-Velocity GraphQL & Lambda-based Software Development Model (20)

Lambda Architecture with Spark
Lambda Architecture with SparkLambda Architecture with Spark
Lambda Architecture with Spark
 
Stream, stream, stream: Different streaming methods with Spark and Kafka
Stream, stream, stream: Different streaming methods with Spark and KafkaStream, stream, stream: Different streaming methods with Spark and Kafka
Stream, stream, stream: Different streaming methods with Spark and Kafka
 
Not Your Father’s Web App: The Cloud-Native Architecture of images.nasa.gov
Not Your Father’s Web App: The Cloud-Native Architecture of images.nasa.govNot Your Father’s Web App: The Cloud-Native Architecture of images.nasa.gov
Not Your Father’s Web App: The Cloud-Native Architecture of images.nasa.gov
 
State of serverless
State of serverlessState of serverless
State of serverless
 
Grokking TechTalk #29: Building Realtime Metrics Platform at LinkedIn
Grokking TechTalk #29: Building Realtime Metrics Platform at LinkedInGrokking TechTalk #29: Building Realtime Metrics Platform at LinkedIn
Grokking TechTalk #29: Building Realtime Metrics Platform at LinkedIn
 
Conquering the Lambda architecture in LinkedIn metrics platform with Apache C...
Conquering the Lambda architecture in LinkedIn metrics platform with Apache C...Conquering the Lambda architecture in LinkedIn metrics platform with Apache C...
Conquering the Lambda architecture in LinkedIn metrics platform with Apache C...
 
RESTful Machine Learning with Flask and TensorFlow Serving - Carlo Mazzaferro
RESTful Machine Learning with Flask and TensorFlow Serving - Carlo MazzaferroRESTful Machine Learning with Flask and TensorFlow Serving - Carlo Mazzaferro
RESTful Machine Learning with Flask and TensorFlow Serving - Carlo Mazzaferro
 
Lessons from Building Large-Scale, Multi-Cloud, SaaS Software at Databricks
Lessons from Building Large-Scale, Multi-Cloud, SaaS Software at DatabricksLessons from Building Large-Scale, Multi-Cloud, SaaS Software at Databricks
Lessons from Building Large-Scale, Multi-Cloud, SaaS Software at Databricks
 
Running R on AWS Lambda by Ana-Maria Niculescu
Running R on AWS Lambda by Ana-Maria NiculescuRunning R on AWS Lambda by Ana-Maria Niculescu
Running R on AWS Lambda by Ana-Maria Niculescu
 
AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...
 
Stream, Stream, Stream: Different Streaming Methods with Spark and Kafka
Stream, Stream, Stream: Different Streaming Methods with Spark and KafkaStream, Stream, Stream: Different Streaming Methods with Spark and Kafka
Stream, Stream, Stream: Different Streaming Methods with Spark and Kafka
 
Going Serverless with AWS Lambda at ReportGarden
Going Serverless with AWS Lambda at ReportGardenGoing Serverless with AWS Lambda at ReportGarden
Going Serverless with AWS Lambda at ReportGarden
 
PHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
PHP At 5000 Requests Per Second: Hootsuite’s Scaling StoryPHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
PHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
 
SF Big Analytics_20190612: Scaling Apache Spark on Kubernetes at Lyft
SF Big Analytics_20190612: Scaling Apache Spark on Kubernetes at LyftSF Big Analytics_20190612: Scaling Apache Spark on Kubernetes at Lyft
SF Big Analytics_20190612: Scaling Apache Spark on Kubernetes at Lyft
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - Linagora
 
NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1
 
Unifying Frontend and Backend Development with Scala - ScalaCon 2021
Unifying Frontend and Backend Development with Scala - ScalaCon 2021Unifying Frontend and Backend Development with Scala - ScalaCon 2021
Unifying Frontend and Backend Development with Scala - ScalaCon 2021
 
Automating using Ansible
Automating using AnsibleAutomating using Ansible
Automating using Ansible
 
Putting the Spark into Functional Fashion Tech Analystics
Putting the Spark into Functional Fashion Tech AnalysticsPutting the Spark into Functional Fashion Tech Analystics
Putting the Spark into Functional Fashion Tech Analystics
 
Skillenza Build with Serverless Challenge - Advanced Serverless Concepts
Skillenza Build with Serverless Challenge -  Advanced Serverless ConceptsSkillenza Build with Serverless Challenge -  Advanced Serverless Concepts
Skillenza Build with Serverless Challenge - Advanced Serverless Concepts
 

Recently uploaded

Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 

Recently uploaded (20)

Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 

Laskar: High-Velocity GraphQL & Lambda-based Software Development Model

  • 1.
  • 4. Sale Stock - Overview ● E-commerce founded in late 2014 ○ Internal Engineering founded in early 2015 ○ Launched our in-house website in mid-2015, app in late-2015 ● Concentrated on women's fashion ○ Around Rp 100rb range as opposed to > Rp 200 range ○ Recently expanded to men’s fashion and women’s lifestyle
  • 5. Sale Stock - Overview ● US$ 27 million Series B mid-2017 ● Doubled revenue since then ● Margins comparable to European vertically-integrated unicorns ○ ASOS ○ Zalando ○ Boohoo.com ○ etc. ○ Margins still improving
  • 6.
  • 7. Sale Stock - Multi-Layered Defensibles ● Vertically-integrated ● Business layers (all done in-house): ○ Merchandising ○ Manufacturing ○ Logistics ○ Customer Service ○ Finance ○ Etc. ● Inject software and automation in every layer of the vertical integration
  • 8. Sale Stock - Multi-Layered Defensibles ● This translates to a *LOT* of software ● ~15 user-facing applications internally, ~200 services ● BUT, decided to be simple organizationally ○ Want to financially make sense ○ 30+ software engineers, ~60 total in Engineering ○ A small team given the scale and diversity of portfolio ● How to do these without killing the engineers? Better tooling.
  • 9.
  • 10. GraphQL is a query language for your API, and a server-side runtime for executing queries by using a type system you define for your data.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23. GraphQL ● No overfetching, no-underfetching ● Super easy versioning ○ Single endpoint to maintain ○ Maintenance and deprecation can be done at the per-field level ○ Easy to support years-old clients this way ● But… ● Performance is a problem if not taken care of (a bit of a longer story) ● You’re still coding -- we can make this simpler!
  • 24. Laskar Automatic GraphQL CRUD-based logic generation tool
  • 25. Laskar - Architectural Breakdown ● Schema ● Gateway ● Persistence ● Lambda ● Interface
  • 26.
  • 27. Laskar - Schema ● Primary way developer inject behavior into the platform ● Developers write a declarative, YAML-based manifest file called SDML (Sale Stock Domain Markup Language) -- no explicit imperative-style coding ● Entity is a core concept declared in the SDML
  • 29. Laskar - Schema ● Entities are stored in the SQL-compliant persistence layer as a table ● Entities have “stored” properties ○ will be mapped to SQL table fields ● GraphQL CRUD queries and mutations will automatically be “generated” for these entities ○ get<Entity>, create<Entity>, edit<Entity>, delete<Entity>, get<Entity>List, etc. ● Can also replace some straightforward SQL filtering logic ● Replaces tons of boilerplate -- can be thousands of lines of code! ○ Controller ○ DAL ○ etc.
  • 31. ● Can also express SQL-based filtered reads! ○ Implements WHERE and SORT BY clauses ○ GraphQL query is instantly available ○ Index is automatically created for the filtered and sort fields ○ Good performance is automatic -- one less thing for developers to take care of ○ Value caching (provided by the cache layer) is also possible if you need the extra performance
  • 32. Laskar - Schema ● End-to-end Development flow is all integrated within a tool ○ Local development ○ Schema migration ○ Schema deployment
  • 35.
  • 36. Laskar - Gateway ● A horizontally-scaled set of a GraphQL-compliant server ● All Laskar-based requests (e.g. from front-end code) will go through a single endpoint served by these servers. ● Dynamically performs GraphQL “behaviors” (queries, mutations, types, etc.) based on currently-active Schema. ● Schemas are synced in realtime to the Gateway
  • 38. Laskar - Gateway ● The simplicity of the Gateway gives us: ○ No binary / image deployment! (deployment is just a schema update!) ○ No more extra running processes for each service ○ Free distributed tracing and observability in general! (since all sub-requests are made by the gateway)
  • 39. But what if my use cases extend beyond CRUD? What if I want to have “funkier” logic?
  • 41.
  • 42. ● Once you want to put custom logic, Lambda’s the answer ● A few integration points: ○ Entity’s computed properties ○ Root queries ● Entities can have “computed” properties (as opposed to “stored”), if you want the properties to be computed on the fly with a Lambda ○ Product { score } ● Top-level queries that are outside of CRUD boundaries: ○ getTrendingProducts (needs access to data-intensive service) Laskar - Lambda
  • 43. Laskar - Lambda ● What is it? ○ A predefined, local function (sum, takeFirst, etc.) ○ A remote call ■ To a microservice ■ To a Cloud Function
  • 45. Declare a computed Property in SDML:
  • 49.
  • 50. Laskar - Data Persistence ● All entities’ stored properties are stored here ● Uses CockroachDB ○ NewSQL ○ SQL ACID capabilities, but with almost-linear NoSQL-like scaling capabilities ○ Add node for additional capacity -- simple scaling ○ Simple, Cassandra-like symmetrical node architecture ● Simple caching layer ○ Can cache: ■ Lambda return values ■ Stored properties ○ Invalidation is automatic (post-mutation) or TTL-based
  • 51. Laskar - Query Lifecycle
  • 52. Laskar - Query Persistence ● GraphQL queries have to be pre-registered (termed “Persisted Query”) ● On build time, GraphQL queries are extracted out of source code, hashed, and sent to the server for persistence. IDs are then assigned to each query. ● On production, queries are then not sent on its raw text form, but only its ID
  • 53. Laskar - Query Persistence ● On production, queries are then not sent on its raw text form, but only its ID ● Increases security and performance
  • 54. Laskar - Query Planning ● Much like a SQL database, prior to execution, upon request, query text is transformed to a Plan. ● Let’s visualize.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59. Laskar - Query Planning ● Query planning is done only once per query-ID -- after which the plan output is cached. ● Subsequent query for that ID uses plan from the initial planning. ● Plan caching improves performance -- CPU usage is historically extremely low in Laskar-Gateway
  • 60. Laskar - Query Execution ● On the same stages, multiple requests to stored properties are de-duped and batched into a single SQL query to the persistence layer. ● Requests to similar lambdas are also de-duped (with some caveats). ● Automatically uses cached data for SQL-layer load-shedding.
  • 62. Laskar - Interfaces ● Admin interfaces for the data can also be created automatically ● No need for developers to write React / front-end code ● Everything is derived from the schema inspection and a simple config file.
  • 64. Laskar - Where is it used currently? ● Sale Stock homepage! (specifically the banner management system) ● Product category management ● Image management system ● Promotion & landing page management system ● Many more in the pipeline!
  • 65. Laskar - Benefits ● Much fewer lines of code -- virtually no boilerplate ● Can be used in 60-70% of use cases ○ If it’s simple CRUD, then it’s used ● Instant performance -- easy caching, indexing ○ Index creation is automatic ○ In the declaration, possible queries are defined upfront -- possible to force-create indexes. ○ Reduces the number of avenues for possible developer mistakes ○ Caching is as easy as a one-liner -- invalidations are automatic
  • 66. Laskar - Benefits ● Automatic schema migration ● In one case, 20k lines of code were replaced by < 300 lines of YAML code -- identical feature set ● Instant deployment ● Huge hardware requirement savings ○ No set of new hardware needed for each new feature ○ Especially for low-traffic feature uses ● Non-programmers can theoretically implement features
  • 68. We’re Hiring! Some of our team members hail from:
  • 69. Careers ● We’re hiring! ● Practically all zaman-now startup positions are available, but highlighting two: ○ Front-end Platform Engineer ○ Data Platform Engineer ● https://careers.salestock.io
  • 70. Careers - Front-end Platform Engineer ● Join a team with a knack for the bleeding edge ● We used: ○ React in early 2015 (with in-house server-side rendering) ○ RN in early 2016 ○ GraphQL in early 2016 ○ Single-codebase web/app React+RN in early 2016 ○ Uses Apollo in late 2016 ● Knack for implementing custom tooling where it makes sense ○ Laskar and lots of other internal tooling ● Write apps for millions of users
  • 71. Careers - Data Platform Engineer ● Join a team that’s building a next-generation data platform that empowers data scientists, analysts, and software engineers to smoothly collaborate and fully-own their data science and pipeline. ● We craft and create the end-to-end platform with: ○ Jupyter Notebook ○ Apache Spark ○ Google Dataflow, Dataproc ○ Google BigQuery ○ Tensorflow ○ Kubeflow ○ Kubernetes ○ Lots of custom tooling