SlideShare a Scribd company logo
It's Time To Stop Using Lambda Architecture
Yaroslav Tkachenko
👋 Hi, I’m Yaroslav
Staff Data Engineer @ Shopify
I like moving things from
Batch to Streaming. A lot.
λ Architecture
Classic Lambda Architecture © Databricks
Other Lambda Incarnations
● “Let’s run a batch job to fix the data”
● “Let’s run a batch job to optimize file size”
● “Let’s run a batch job to reprocess everything”
κ Architecture
Classic Kappa Architecture
Kappa Concerns
● Data availability / retention
● Data consistency
● Handling late-arriving data
● Data reprocessing & backfill
Before we continue...
…why do I like streaming so much?
Latency
● It’s actually not the main goal, but it’s a nice one!
● You have no idea how much latency is OK
Handling Late-Arriving Data: Batch
● How much time should we wait?
● How much time is OK to reprocess?
Handling Late-Arriving Data: Streaming
● Stateless transformations and sinks with updates: easy
● Stateful transformations:
○ Small state: easy
○ Large state: doable
● Sinks without updates: it depends
Operations and Observability: Batch
● “Yeah, it occasionally fails, we just wait 6 hours for a
retry run”
● “Oh, I disabled the wrong job and nobody noticed”
● “We don’t really have metrics for this job, but you can
monitor it with this UI”
Operations and Observability: Streaming
● Modern frameworks like Kafka Streams and Apache Flink
can be deployed with orchestration systems like
Kubernetes
● The same SLO and uptime expectations as with
applications serving traffic
● You can fully embrace CI/CD, observability and other
DevOps/SRE practices and mentality
κ Building Blocks
Core areas: The Log (Kafka), Streaming Framework (Flink), Sinks (e.g. Iceberg)
Kafka Topic Compaction
● Can be used if intermediate
values (per key) are not
important
● Enables infinite retention
Kafka Tiered Storage
● WIP (KIP-405)
● Enables infinite retention
for all topics
● “Topic Archive Pattern”
have been used for years
Kafka Exactly-Once
● Introduced in 0.11, 4 years
ago (!)
● Eliminates duplicates,
ensures consistency
producer.initTransactions();
try {
producer.beginTransaction();
producer.send(record1);
producer.send(record2);
producer.commitTransaction();
} catch(ProducerFencedException e) {
producer.close();
} catch(KafkaException e) {
producer.abortTransaction();
}
Data Integration
● Bringing all types of data
to Kafka
● Solves “but I don’t have
this in Kafka” question
● Kafka Connect works best
with Kafka, but there are
other options
● Just avoid building
one-off integrations
● Makes sense for sinks
too!
Dynamic Kafka Clusters
● Transient Kafka clusters
can be brought on-demand
for large reprocessing
● This requires protocol
changes for producers and
consumers
● Netflix has done it
Reliable and scalable state as a part of
your streaming engine is mandatory for
any complex κ use-case
Flink State Concepts
● Keyed state is a key to
scalable pipelines
● Checkpointing guarantees
state fault-tolerance
● State is used as a building
block in a lot of high-level
components, you don’t
always see it
Flink Exactly-Once
● Leverages state to support
exactly-once semantics
● Has an advanced Kafka
source/sink integration
● Custom sources and sinks
can be created using
standard patterns
abstract class TwoPhaseCommitSinkFunction
extends RichSinkFunction
implements CheckpointedFunction,
CheckpointListener
Flink State Management
● Custom state variables,
timers and side outputs
allow building very
advanced workflows
● You can use state as a
database
● Or you can even
repopulate state when
handling late-arriving
messages
Flink State Processor API
● Don’t backfill your state by
replaying from the source:
update state directly
● Combines the power of
batch and streaming by
processing state with batch
and then bootstrapping a
streaming application
val listState = savepoint
.readListState(
"my-state",
"list-state",
Types.INT
)
// ...
Savepoint
.create(new MemoryStateBackend(), 128)
.withOperator("my-state", transformation)
.write(savepointPath)
Some data stores are better suited to be
used as data sinks for streaming
pipelines than others
Supporting Updates/Upserts
Updates/Upserts can seriously simplify overall design: they can be
used for data correction.
● Good
○ RDBMS, NoSQL (HBase, Cassandra, Elasticsearch), OLAP
(Pinot), Compacted Kafka topics, “Lakehouse” object stores
with Parquet*
● Problematic
○ OLAP (Druid, Clickhouse), Non-compacted Kafka topics,
Regular object stores with Parquet*
“Lakehouse” Data Sinks
● Iceberg, Delta, Hudi
● Provide a transactional
journal on top of the object
store. Allow updates,
compaction, even time
travelling
FlinkSink.forRowData(input)
.tableLoader(tableLoader)
.overwrite(true)
.hadoopConf(hadoopConf)
.build()
Addressing κ Concerns
Addressing Concerns
● Dava availability / retention
○ Data integration, compacted topics and tiered storage
● Data consistency
○ Exactly-once end-to-end delivery semantics
● Handling late-arriving data
○ State management, proper data sinks
● Data reprocessing & backfill
○ Dynamic Kafka clusters, Savepoints, State Processor API
Use-case 1: stateless transformations, routing and integration
Use-case 1: stateless transformations, routing and integration
1. Tiered storage
2. Exactly-once
3. Kafka Connect
4. Iceberg
5. Upserts
6. Dynamic Kafka clusters
1
2
3
4
5
5
6
Use-case 2: stateful transformations, analytics
Use-case 2: stateful transformations, analytics
1. Tiered storage
2. Compacted topics
3. Kafka Connect / Debezium
4. Exactly-once
5. Savepoints, State Processor API
6. Upserts
1
2
4
5 6
4
3
Questions?
@sap1ens

More Related Content

What's hot (20)

PPTX
Modern data warehouse
Rakesh Jayaram
 
PDF
Apache Iceberg: An Architectural Look Under the Covers
ScyllaDB
 
PDF
Apache Spark Overview
Vadim Y. Bichutskiy
 
PPTX
Flink history, roadmap and vision
Stephan Ewen
 
PPTX
Protecting your data at rest with Apache Kafka by Confluent and Vormetric
confluent
 
PPTX
Databricks Fundamentals
Dalibor Wijas
 
PDF
Kappa vs Lambda Architectures and Technology Comparison
Kai Wähner
 
PDF
Apache Iceberg - A Table Format for Hige Analytic Datasets
Alluxio, Inc.
 
PDF
Speeding Time to Insight with a Modern ELT Approach
Databricks
 
PPTX
CQRS: Command/Query Responsibility Segregation
Brian Ritchie
 
PDF
Intro to Delta Lake
Databricks
 
PPTX
SAP Overview and Architecture
Ankit Sharma
 
PDF
Real-time Analytics with Apache Flink and Druid
Jan Graßegger
 
PDF
Migrating Oracle database to Cassandra
Umair Mansoob
 
PPTX
Kafka connect 101
Whiteklay
 
PPTX
Machine Learning Models in Production
DataWorks Summit
 
PPTX
How to build a streaming Lakehouse with Flink, Kafka, and Hudi
Flink Forward
 
PPTX
Scaling Data Quality @ Netflix
Michelle Ufford
 
PDF
Simplify CDC Pipeline with Spark Streaming SQL and Delta Lake
Databricks
 
PDF
Building an open data platform with apache iceberg
Alluxio, Inc.
 
Modern data warehouse
Rakesh Jayaram
 
Apache Iceberg: An Architectural Look Under the Covers
ScyllaDB
 
Apache Spark Overview
Vadim Y. Bichutskiy
 
Flink history, roadmap and vision
Stephan Ewen
 
Protecting your data at rest with Apache Kafka by Confluent and Vormetric
confluent
 
Databricks Fundamentals
Dalibor Wijas
 
Kappa vs Lambda Architectures and Technology Comparison
Kai Wähner
 
Apache Iceberg - A Table Format for Hige Analytic Datasets
Alluxio, Inc.
 
Speeding Time to Insight with a Modern ELT Approach
Databricks
 
CQRS: Command/Query Responsibility Segregation
Brian Ritchie
 
Intro to Delta Lake
Databricks
 
SAP Overview and Architecture
Ankit Sharma
 
Real-time Analytics with Apache Flink and Druid
Jan Graßegger
 
Migrating Oracle database to Cassandra
Umair Mansoob
 
Kafka connect 101
Whiteklay
 
Machine Learning Models in Production
DataWorks Summit
 
How to build a streaming Lakehouse with Flink, Kafka, and Hudi
Flink Forward
 
Scaling Data Quality @ Netflix
Michelle Ufford
 
Simplify CDC Pipeline with Spark Streaming SQL and Delta Lake
Databricks
 
Building an open data platform with apache iceberg
Alluxio, Inc.
 

Similar to It's Time To Stop Using Lambda Architecture (20)

PDF
It's Time To Stop Using Lambda Architecture | Yaroslav Tkachenko, Shopify
HostedbyConfluent
 
PDF
Building Big Data Streaming Architectures
David Martínez Rego
 
PDF
Streaming vs batching (conundrum ai internal meetup)
Mark Andreev
 
PDF
Streaming architecture patterns
hadooparchbook
 
PPTX
Trivento summercamp masterclass 9/9/2016
Stavros Kontopoulos
 
PDF
Apache Big Data EU 2016: Next Gen Big Data Analytics with Apache Apex
Apache Apex
 
PDF
Towards Data Operations
Andrea Monacchi
 
PDF
Building end to end streaming application on Spark
datamantra
 
PPTX
Spark Streaming Recipes and "Exactly Once" Semantics Revised
Michael Spector
 
PDF
Don't Cross The Streams - Data Streaming And Apache Flink
John Gorman (BSc, CISSP)
 
PDF
Big Data Streams Architectures. Why? What? How?
Anton Nazaruk
 
PDF
Unbounded bounded-data-strangeloop-2016-monal-daxini
Monal Daxini
 
PPTX
Data streaming fundamentals
Mohammed Fazuluddin
 
PDF
Introduction to Apache Apex by Thomas Weise
Big Data Spain
 
PDF
What No One Tells You About Writing a Streaming App: Spark Summit East talk b...
Spark Summit
 
PDF
What no one tells you about writing a streaming app
hadooparchbook
 
PPTX
Streaming options in the wild
Atif Akhtar
 
PDF
Avoiding Common Pitfalls: Spark Structured Streaming with Kafka
HostedbyConfluent
 
PPTX
Trivento summercamp fast data 9/9/2016
Stavros Kontopoulos
 
PDF
Top 5 mistakes when writing Streaming applications
hadooparchbook
 
It's Time To Stop Using Lambda Architecture | Yaroslav Tkachenko, Shopify
HostedbyConfluent
 
Building Big Data Streaming Architectures
David Martínez Rego
 
Streaming vs batching (conundrum ai internal meetup)
Mark Andreev
 
Streaming architecture patterns
hadooparchbook
 
Trivento summercamp masterclass 9/9/2016
Stavros Kontopoulos
 
Apache Big Data EU 2016: Next Gen Big Data Analytics with Apache Apex
Apache Apex
 
Towards Data Operations
Andrea Monacchi
 
Building end to end streaming application on Spark
datamantra
 
Spark Streaming Recipes and "Exactly Once" Semantics Revised
Michael Spector
 
Don't Cross The Streams - Data Streaming And Apache Flink
John Gorman (BSc, CISSP)
 
Big Data Streams Architectures. Why? What? How?
Anton Nazaruk
 
Unbounded bounded-data-strangeloop-2016-monal-daxini
Monal Daxini
 
Data streaming fundamentals
Mohammed Fazuluddin
 
Introduction to Apache Apex by Thomas Weise
Big Data Spain
 
What No One Tells You About Writing a Streaming App: Spark Summit East talk b...
Spark Summit
 
What no one tells you about writing a streaming app
hadooparchbook
 
Streaming options in the wild
Atif Akhtar
 
Avoiding Common Pitfalls: Spark Structured Streaming with Kafka
HostedbyConfluent
 
Trivento summercamp fast data 9/9/2016
Stavros Kontopoulos
 
Top 5 mistakes when writing Streaming applications
hadooparchbook
 
Ad

More from Yaroslav Tkachenko (17)

PDF
Dynamic Change Data Capture with Flink CDC and Consistent Hashing
Yaroslav Tkachenko
 
PDF
Streaming SQL for Data Engineers: The Next Big Thing?
Yaroslav Tkachenko
 
PDF
Apache Flink Adoption at Shopify
Yaroslav Tkachenko
 
PDF
Bravo Six, Going Realtime. Transitioning Activision Data Pipeline to Streaming
Yaroslav Tkachenko
 
PDF
Apache Kafka: New Features That You Might Not Know About
Yaroslav Tkachenko
 
PDF
Building Scalable and Extendable Data Pipeline for Call of Duty Games: Lesson...
Yaroslav Tkachenko
 
PDF
Designing Scalable and Extendable Data Pipeline for Call Of Duty Games
Yaroslav Tkachenko
 
PPTX
10 tips for making Bash a sane programming language
Yaroslav Tkachenko
 
PDF
Actors or Not: Async Event Architectures
Yaroslav Tkachenko
 
PDF
Kafka Streams: the easiest way to start with stream processing
Yaroslav Tkachenko
 
PDF
Building Stateful Microservices With Akka
Yaroslav Tkachenko
 
PDF
Querying Data Pipeline with AWS Athena
Yaroslav Tkachenko
 
PPTX
Akka Microservices Architecture And Design
Yaroslav Tkachenko
 
PDF
Why Actor-Based Systems Are The Best For Microservices
Yaroslav Tkachenko
 
PPTX
Why actor-based systems are the best for microservices
Yaroslav Tkachenko
 
PPTX
Building Eventing Systems for Microservice Architecture
Yaroslav Tkachenko
 
PPTX
Быстрая и безболезненная разработка клиентской части веб-приложений
Yaroslav Tkachenko
 
Dynamic Change Data Capture with Flink CDC and Consistent Hashing
Yaroslav Tkachenko
 
Streaming SQL for Data Engineers: The Next Big Thing?
Yaroslav Tkachenko
 
Apache Flink Adoption at Shopify
Yaroslav Tkachenko
 
Bravo Six, Going Realtime. Transitioning Activision Data Pipeline to Streaming
Yaroslav Tkachenko
 
Apache Kafka: New Features That You Might Not Know About
Yaroslav Tkachenko
 
Building Scalable and Extendable Data Pipeline for Call of Duty Games: Lesson...
Yaroslav Tkachenko
 
Designing Scalable and Extendable Data Pipeline for Call Of Duty Games
Yaroslav Tkachenko
 
10 tips for making Bash a sane programming language
Yaroslav Tkachenko
 
Actors or Not: Async Event Architectures
Yaroslav Tkachenko
 
Kafka Streams: the easiest way to start with stream processing
Yaroslav Tkachenko
 
Building Stateful Microservices With Akka
Yaroslav Tkachenko
 
Querying Data Pipeline with AWS Athena
Yaroslav Tkachenko
 
Akka Microservices Architecture And Design
Yaroslav Tkachenko
 
Why Actor-Based Systems Are The Best For Microservices
Yaroslav Tkachenko
 
Why actor-based systems are the best for microservices
Yaroslav Tkachenko
 
Building Eventing Systems for Microservice Architecture
Yaroslav Tkachenko
 
Быстрая и безболезненная разработка клиентской части веб-приложений
Yaroslav Tkachenko
 
Ad

Recently uploaded (20)

PPTX
apidays Helsinki & North 2025 - APIs at Scale: Designing for Alignment, Trust...
apidays
 
PPTX
Aict presentation on dpplppp sjdhfh.pptx
vabaso5932
 
PPTX
thid ppt defines the ich guridlens and gives the information about the ICH gu...
shaistabegum14
 
PDF
JavaScript - Good or Bad? Tips for Google Tag Manager
📊 Markus Baersch
 
PDF
apidays Singapore 2025 - Surviving an interconnected world with API governanc...
apidays
 
PPTX
04_Tamás Marton_Intuitech .pptx_AI_Barometer_2025
FinTech Belgium
 
PPTX
05_Jelle Baats_Tekst.pptx_AI_Barometer_Release_Event
FinTech Belgium
 
PDF
1750162332_Snapshot-of-Indias-oil-Gas-data-May-2025.pdf
sandeep718278
 
PDF
Business implication of Artificial Intelligence.pdf
VishalChugh12
 
PPTX
apidays Helsinki & North 2025 - Running a Successful API Program: Best Practi...
apidays
 
PPTX
apidays Helsinki & North 2025 - Agentic AI: A Friend or Foe?, Merja Kajava (A...
apidays
 
PPTX
apidays Singapore 2025 - The Quest for the Greenest LLM , Jean Philippe Ehre...
apidays
 
PPT
tuberculosiship-2106031cyyfuftufufufivifviviv
AkshaiRam
 
PDF
Data Science Course Certificate by Sigma Software University
Stepan Kalika
 
PDF
The European Business Wallet: Why It Matters and How It Powers the EUDI Ecosy...
Lal Chandran
 
PPTX
b6057ea5-8e8c-4415-90c0-ed8e9666ffcd.pptx
Anees487379
 
PPTX
03_Ariane BERCKMOES_Ethias.pptx_AIBarometer_release_event
FinTech Belgium
 
PPTX
Listify-Intelligent-Voice-to-Catalog-Agent.pptx
nareshkottees
 
PDF
InformaticsPractices-MS - Google Docs.pdf
seshuashwin0829
 
PPTX
apidays Helsinki & North 2025 - From Chaos to Clarity: Designing (AI-Ready) A...
apidays
 
apidays Helsinki & North 2025 - APIs at Scale: Designing for Alignment, Trust...
apidays
 
Aict presentation on dpplppp sjdhfh.pptx
vabaso5932
 
thid ppt defines the ich guridlens and gives the information about the ICH gu...
shaistabegum14
 
JavaScript - Good or Bad? Tips for Google Tag Manager
📊 Markus Baersch
 
apidays Singapore 2025 - Surviving an interconnected world with API governanc...
apidays
 
04_Tamás Marton_Intuitech .pptx_AI_Barometer_2025
FinTech Belgium
 
05_Jelle Baats_Tekst.pptx_AI_Barometer_Release_Event
FinTech Belgium
 
1750162332_Snapshot-of-Indias-oil-Gas-data-May-2025.pdf
sandeep718278
 
Business implication of Artificial Intelligence.pdf
VishalChugh12
 
apidays Helsinki & North 2025 - Running a Successful API Program: Best Practi...
apidays
 
apidays Helsinki & North 2025 - Agentic AI: A Friend or Foe?, Merja Kajava (A...
apidays
 
apidays Singapore 2025 - The Quest for the Greenest LLM , Jean Philippe Ehre...
apidays
 
tuberculosiship-2106031cyyfuftufufufivifviviv
AkshaiRam
 
Data Science Course Certificate by Sigma Software University
Stepan Kalika
 
The European Business Wallet: Why It Matters and How It Powers the EUDI Ecosy...
Lal Chandran
 
b6057ea5-8e8c-4415-90c0-ed8e9666ffcd.pptx
Anees487379
 
03_Ariane BERCKMOES_Ethias.pptx_AIBarometer_release_event
FinTech Belgium
 
Listify-Intelligent-Voice-to-Catalog-Agent.pptx
nareshkottees
 
InformaticsPractices-MS - Google Docs.pdf
seshuashwin0829
 
apidays Helsinki & North 2025 - From Chaos to Clarity: Designing (AI-Ready) A...
apidays
 

It's Time To Stop Using Lambda Architecture

  • 1. It's Time To Stop Using Lambda Architecture Yaroslav Tkachenko
  • 2. 👋 Hi, I’m Yaroslav Staff Data Engineer @ Shopify I like moving things from Batch to Streaming. A lot.
  • 5. Other Lambda Incarnations ● “Let’s run a batch job to fix the data” ● “Let’s run a batch job to optimize file size” ● “Let’s run a batch job to reprocess everything”
  • 8. Kappa Concerns ● Data availability / retention ● Data consistency ● Handling late-arriving data ● Data reprocessing & backfill
  • 10. …why do I like streaming so much?
  • 11. Latency ● It’s actually not the main goal, but it’s a nice one! ● You have no idea how much latency is OK
  • 12. Handling Late-Arriving Data: Batch ● How much time should we wait? ● How much time is OK to reprocess?
  • 13. Handling Late-Arriving Data: Streaming ● Stateless transformations and sinks with updates: easy ● Stateful transformations: ○ Small state: easy ○ Large state: doable ● Sinks without updates: it depends
  • 14. Operations and Observability: Batch ● “Yeah, it occasionally fails, we just wait 6 hours for a retry run” ● “Oh, I disabled the wrong job and nobody noticed” ● “We don’t really have metrics for this job, but you can monitor it with this UI”
  • 15. Operations and Observability: Streaming ● Modern frameworks like Kafka Streams and Apache Flink can be deployed with orchestration systems like Kubernetes ● The same SLO and uptime expectations as with applications serving traffic ● You can fully embrace CI/CD, observability and other DevOps/SRE practices and mentality
  • 17. Core areas: The Log (Kafka), Streaming Framework (Flink), Sinks (e.g. Iceberg)
  • 18. Kafka Topic Compaction ● Can be used if intermediate values (per key) are not important ● Enables infinite retention
  • 19. Kafka Tiered Storage ● WIP (KIP-405) ● Enables infinite retention for all topics ● “Topic Archive Pattern” have been used for years
  • 20. Kafka Exactly-Once ● Introduced in 0.11, 4 years ago (!) ● Eliminates duplicates, ensures consistency producer.initTransactions(); try { producer.beginTransaction(); producer.send(record1); producer.send(record2); producer.commitTransaction(); } catch(ProducerFencedException e) { producer.close(); } catch(KafkaException e) { producer.abortTransaction(); }
  • 21. Data Integration ● Bringing all types of data to Kafka ● Solves “but I don’t have this in Kafka” question ● Kafka Connect works best with Kafka, but there are other options ● Just avoid building one-off integrations ● Makes sense for sinks too!
  • 22. Dynamic Kafka Clusters ● Transient Kafka clusters can be brought on-demand for large reprocessing ● This requires protocol changes for producers and consumers ● Netflix has done it
  • 23. Reliable and scalable state as a part of your streaming engine is mandatory for any complex κ use-case
  • 24. Flink State Concepts ● Keyed state is a key to scalable pipelines ● Checkpointing guarantees state fault-tolerance ● State is used as a building block in a lot of high-level components, you don’t always see it
  • 25. Flink Exactly-Once ● Leverages state to support exactly-once semantics ● Has an advanced Kafka source/sink integration ● Custom sources and sinks can be created using standard patterns abstract class TwoPhaseCommitSinkFunction extends RichSinkFunction implements CheckpointedFunction, CheckpointListener
  • 26. Flink State Management ● Custom state variables, timers and side outputs allow building very advanced workflows ● You can use state as a database ● Or you can even repopulate state when handling late-arriving messages
  • 27. Flink State Processor API ● Don’t backfill your state by replaying from the source: update state directly ● Combines the power of batch and streaming by processing state with batch and then bootstrapping a streaming application val listState = savepoint .readListState( "my-state", "list-state", Types.INT ) // ... Savepoint .create(new MemoryStateBackend(), 128) .withOperator("my-state", transformation) .write(savepointPath)
  • 28. Some data stores are better suited to be used as data sinks for streaming pipelines than others
  • 29. Supporting Updates/Upserts Updates/Upserts can seriously simplify overall design: they can be used for data correction. ● Good ○ RDBMS, NoSQL (HBase, Cassandra, Elasticsearch), OLAP (Pinot), Compacted Kafka topics, “Lakehouse” object stores with Parquet* ● Problematic ○ OLAP (Druid, Clickhouse), Non-compacted Kafka topics, Regular object stores with Parquet*
  • 30. “Lakehouse” Data Sinks ● Iceberg, Delta, Hudi ● Provide a transactional journal on top of the object store. Allow updates, compaction, even time travelling FlinkSink.forRowData(input) .tableLoader(tableLoader) .overwrite(true) .hadoopConf(hadoopConf) .build()
  • 32. Addressing Concerns ● Dava availability / retention ○ Data integration, compacted topics and tiered storage ● Data consistency ○ Exactly-once end-to-end delivery semantics ● Handling late-arriving data ○ State management, proper data sinks ● Data reprocessing & backfill ○ Dynamic Kafka clusters, Savepoints, State Processor API
  • 33. Use-case 1: stateless transformations, routing and integration
  • 34. Use-case 1: stateless transformations, routing and integration 1. Tiered storage 2. Exactly-once 3. Kafka Connect 4. Iceberg 5. Upserts 6. Dynamic Kafka clusters 1 2 3 4 5 5 6
  • 35. Use-case 2: stateful transformations, analytics
  • 36. Use-case 2: stateful transformations, analytics 1. Tiered storage 2. Compacted topics 3. Kafka Connect / Debezium 4. Exactly-once 5. Savepoints, State Processor API 6. Upserts 1 2 4 5 6 4 3