SlideShare a Scribd company logo
What We Have Learned
Running ScyllaDB and Go
Martin Sucha, Sr. Software Engineer
Presenter
Martin Sucha, Sr. Software Engineer
Always amazed what computers can do, Martin loves learning
new stuff about them.
Previously employee number four at Exponea, a fast-growing
European SaaS company, Martin worked with Python and
MongoDB and later learned to love Go.
Now working on Go services that utilize ScyllaDB at Kiwi.com.
Migration to Scylla and Go
Before migration
Service written in
Python
Service written in
Python
Service written in
Python
Cache storing data in Redis™
Persistent data stored in Cassandra®
After migration
Service written in
Python
Service written in
Python
Service written in Go
Persistent data stored & cached in ScyllaDB
What we use on Go side
■ gocql
■ GOGC=500
■ gocqlx
Our cluster
■ 3 data centers in 3 different locations
■ Data replicated to each
■ One replica per data center
{'class': 'NetworkTopologyStrategy', 'dc1': '1', 'dc2': '1', 'dc3': '1'}
■ 400 000 reads/second
■ 600 000 writes/second
What does it mean for applications?
■ Don’t use LOCAL_ONE or LOCAL_QUORUM consistency level
■ Retries will always be to remote DC
TokenAwareHostPolicy with
DCAwareRoundRobinPolicy
DC1
Node 1.2
Node 1.1
Node 1.3
Node 1.4
Node 2.2
Node 2.1
Node 2.3
Node 2.4
Node 3.2
Node 3.1
Node 3.3
Node 3.4
DC2 DC3
1
2
3
4
5
6
7
8
9
10
11
12
NonLocalReplicasFallback option
DC1
Node 1.2
Node 1.1
Node 1.3
Node 1.4
Node 2.2
Node 2.1
Node 2.3
Node 2.4
Node 3.2
Node 3.1
Node 3.3
Node 3.4
DC2 DC3
1
2
7
8
3
4
9
10
5
6
11
12
Post-migration
improvements
Upgrade to Scylla 2019.1
■ Better cache behavior
■ BYPASS CACHE
■ Switch to MC sstables saved us ~35% of disk space
Row hits
Optimizing unmarshalling
■ Our Go service mostly reads data
■ We have some large user defined types
■ We use named types (type MyCustomID = int)
■ gocql.Unmarshal uses reflection and type switches at runtime
■ You can implement custom UnmarshalUDT method (for structs) or
UnmarshalCQL method (for any type)
UnmarshalUDT
type myCustomType struct {
Field1 int
Field2 string
}
func (m *myCustomType) UnmarshalUDT(name string, info gocql.TypeInfo, data []byte) error {
switch name {
case "field1":
return gocql.Unmarshal(info, data, &m.Field1)
case "field2":
return gocql.Unmarshal(info, data, &m.Field2)
default:
return nil // Skip unknown fields
}
}
30% CPU saving in 30 minutes
Downsides
■ Writing unmarshallers manually is boring
■ Still calls generic gocql.Unmarshal for non-UDT fields
■ Potential for errors
Generate code
github.com/kiwicom/easycql
■ EasyJSON + gocql = easycql
■ Code generator for marshal/unmarshal implementations
■ Conservative mode similar to UnmarshalUDT
■ Optimized mode with more optimizations for unmarshalling
Next steps
■ Support all types
■ Optimize based on field order
■ Optimized mode for marshaling
Thank you Stay in touch
Any questions?
Martin Sucha
martin.sucha@kiwi.com
github.com/martin-sucha

More Related Content

PPTX
Zeotap: Moving to ScyllaDB - A Graph of Billions Scale
PPTX
ScyllaDB's Avi Kivity on UDF, UDA, and the Future
PPTX
Scylla Summit 2018: Kiwi.com Migration to Scylla - The Why, the How, the Fail...
PPTX
MongoDB vs Scylla: Production Experience from Both Dev & Ops Standpoint at Nu...
PPTX
Introduction to NoSql
PPTX
Scylla Summit 2019 Keynote - Avi Kivity
PPTX
Apache Cassandra Lunch #70: Basics of Apache Cassandra
PDF
Scylla Summit 2022: Stream Processing with ScyllaDB
Zeotap: Moving to ScyllaDB - A Graph of Billions Scale
ScyllaDB's Avi Kivity on UDF, UDA, and the Future
Scylla Summit 2018: Kiwi.com Migration to Scylla - The Why, the How, the Fail...
MongoDB vs Scylla: Production Experience from Both Dev & Ops Standpoint at Nu...
Introduction to NoSql
Scylla Summit 2019 Keynote - Avi Kivity
Apache Cassandra Lunch #70: Basics of Apache Cassandra
Scylla Summit 2022: Stream Processing with ScyllaDB

What's hot (20)

PPTX
Scylla Summit 2022: New AWS Instances Perfect for ScyllaDB
PPTX
Empowering the AWS DynamoDB™ application developer with Alternator
PPTX
FireEye & Scylla: Intel Threat Analysis Using a Graph Database
PPTX
Writing Applications for Scylla
PPTX
Cassandra Lunch #59 Functions in Cassandra
PDF
Introducing Scylla Open Source 4.0
PDF
Eliminating Volatile Latencies Inside Rakuten’s NoSQL Migration
PDF
Scylla Summit 2022: IO Scheduling & NVMe Disk Modelling
PPTX
AWS Big Data Demystified #2 | Athena, Spectrum, Emr, Hive
PPTX
Seastar Summit 2019 Keynote
PPTX
Scylla Summit 2018: Cassandra and ScyllaDB at Yahoo! Japan
PPTX
Amazon aws big data demystified | Introduction to streaming and messaging flu...
PPTX
Real-time Fraud Detection for Southeast Asia’s Leading Mobile Platform
PDF
Scylla Summit 2022: Migrating SQL Schemas for ScyllaDB: Data Modeling Best Pr...
PPTX
iFood on Delivering 100 Million Events a Month to Restaurants with Scylla
PPTX
Powering a Graph Data System with Scylla + JanusGraph
PPTX
Scylla Summit 2018: Scalable Stream Processing with KSQL, Kafka and ScyllaDB
PDF
Seastar Summit 2019 vectorized.io
PPTX
Scylla Summit 2018: From SAP to Scylla - Tracking the Fleet at GPS Insight
PDF
Scylla Summit 2016: Analytics Show Time - Spark and Presto Powered by Scylla
Scylla Summit 2022: New AWS Instances Perfect for ScyllaDB
Empowering the AWS DynamoDB™ application developer with Alternator
FireEye & Scylla: Intel Threat Analysis Using a Graph Database
Writing Applications for Scylla
Cassandra Lunch #59 Functions in Cassandra
Introducing Scylla Open Source 4.0
Eliminating Volatile Latencies Inside Rakuten’s NoSQL Migration
Scylla Summit 2022: IO Scheduling & NVMe Disk Modelling
AWS Big Data Demystified #2 | Athena, Spectrum, Emr, Hive
Seastar Summit 2019 Keynote
Scylla Summit 2018: Cassandra and ScyllaDB at Yahoo! Japan
Amazon aws big data demystified | Introduction to streaming and messaging flu...
Real-time Fraud Detection for Southeast Asia’s Leading Mobile Platform
Scylla Summit 2022: Migrating SQL Schemas for ScyllaDB: Data Modeling Best Pr...
iFood on Delivering 100 Million Events a Month to Restaurants with Scylla
Powering a Graph Data System with Scylla + JanusGraph
Scylla Summit 2018: Scalable Stream Processing with KSQL, Kafka and ScyllaDB
Seastar Summit 2019 vectorized.io
Scylla Summit 2018: From SAP to Scylla - Tracking the Fleet at GPS Insight
Scylla Summit 2016: Analytics Show Time - Spark and Presto Powered by Scylla
Ad

Similar to What Kiwi.com Has Learned Running ScyllaDB and Go (20)

PDF
Elasticity, Speed & Simplicity: Get the Most Out of New ScyllaDB Capabilities
PDF
Using ScyllaDB for Extreme Scale Workloads
PPTX
MongoDB to ScyllaDB: Technical Comparison and the Path to Success
PDF
Feature Store Evolution Under Cost Constraints: When Cost is Part of the Arch...
PDF
ScyllaDB V Developer Deep Dive Series: Resiliency and Strong Consistency via ...
PDF
Using ScyllaDB for Real-Time Read-Heavy Workloads.pdf
PDF
Dissecting Real-World Database Performance Dilemmas
PDF
ScyllaDB Virtual Workshop
PDF
What’s New in ScyllaDB Open Source 5.0
PDF
Renegotiating the boundary between database latency and consistency
PDF
Scylla Summit 2022: How ScyllaDB Powers This Next Tech Cycle
PPTX
Meeting the challenges of OLTP Big Data with Scylla
PDF
Achieving Extreme Scale with ScyllaDB: Tips & Tradeoffs
PDF
Dissecting Real-World Database Performance Dilemmas
PDF
DynamoDB Cost Optimization Masterclass: ScyllaDB as a DynamoDB Alternative
PDF
Build DynamoDB-Compatible Apps with Python
PDF
How Development Teams Cut Costs with ScyllaDB.pdf
PPTX
Scylla Summit 2018: How We Made Large Partition Scans Over Two Times Faster
PPTX
Scylla Summit 2018: How Scylla Helps You to be a Better Application Developer
PDF
Running a Cost-Effective DynamoDB-Compatible Database on Managed Kubernetes S...
Elasticity, Speed & Simplicity: Get the Most Out of New ScyllaDB Capabilities
Using ScyllaDB for Extreme Scale Workloads
MongoDB to ScyllaDB: Technical Comparison and the Path to Success
Feature Store Evolution Under Cost Constraints: When Cost is Part of the Arch...
ScyllaDB V Developer Deep Dive Series: Resiliency and Strong Consistency via ...
Using ScyllaDB for Real-Time Read-Heavy Workloads.pdf
Dissecting Real-World Database Performance Dilemmas
ScyllaDB Virtual Workshop
What’s New in ScyllaDB Open Source 5.0
Renegotiating the boundary between database latency and consistency
Scylla Summit 2022: How ScyllaDB Powers This Next Tech Cycle
Meeting the challenges of OLTP Big Data with Scylla
Achieving Extreme Scale with ScyllaDB: Tips & Tradeoffs
Dissecting Real-World Database Performance Dilemmas
DynamoDB Cost Optimization Masterclass: ScyllaDB as a DynamoDB Alternative
Build DynamoDB-Compatible Apps with Python
How Development Teams Cut Costs with ScyllaDB.pdf
Scylla Summit 2018: How We Made Large Partition Scans Over Two Times Faster
Scylla Summit 2018: How Scylla Helps You to be a Better Application Developer
Running a Cost-Effective DynamoDB-Compatible Database on Managed Kubernetes S...
Ad

More from ScyllaDB (20)

PDF
Understanding The True Cost of DynamoDB Webinar
PDF
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
PDF
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
PDF
New Ways to Reduce Database Costs with ScyllaDB
PDF
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
PDF
Powering a Billion Dreams: Scaling Meesho’s E-commerce Revolution with Scylla...
PDF
Leading a High-Stakes Database Migration
PDF
Securely Serving Millions of Boot Artifacts a Day by João Pedro Lima & Matt ...
PDF
How Agoda Scaled 50x Throughput with ScyllaDB by Worakarn Isaratham
PDF
How Yieldmo Cut Database Costs and Cloud Dependencies Fast by Todd Coleman
PDF
ScyllaDB: 10 Years and Beyond by Dor Laor
PDF
Reduce Your Cloud Spend with ScyllaDB by Tzach Livyatan
PDF
Migrating 50TB Data From a Home-Grown Database to ScyllaDB, Fast by Terence Liu
PDF
Vector Search with ScyllaDB by Szymon Wasik
PDF
Workload Prioritization: How to Balance Multiple Workloads in a Cluster by Fe...
PDF
Two Leading Approaches to Data Virtualization, and Which Scales Better? by Da...
PDF
Scaling a Beast: Lessons from 400x Growth in a High-Stakes Financial System b...
PDF
Object Storage in ScyllaDB by Ran Regev, ScyllaDB
PDF
Lessons Learned from Building a Serverless Notifications System by Srushith R...
PDF
A Dist Sys Programmer's Journey into AI by Piotr Sarna
Understanding The True Cost of DynamoDB Webinar
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
New Ways to Reduce Database Costs with ScyllaDB
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Powering a Billion Dreams: Scaling Meesho’s E-commerce Revolution with Scylla...
Leading a High-Stakes Database Migration
Securely Serving Millions of Boot Artifacts a Day by João Pedro Lima & Matt ...
How Agoda Scaled 50x Throughput with ScyllaDB by Worakarn Isaratham
How Yieldmo Cut Database Costs and Cloud Dependencies Fast by Todd Coleman
ScyllaDB: 10 Years and Beyond by Dor Laor
Reduce Your Cloud Spend with ScyllaDB by Tzach Livyatan
Migrating 50TB Data From a Home-Grown Database to ScyllaDB, Fast by Terence Liu
Vector Search with ScyllaDB by Szymon Wasik
Workload Prioritization: How to Balance Multiple Workloads in a Cluster by Fe...
Two Leading Approaches to Data Virtualization, and Which Scales Better? by Da...
Scaling a Beast: Lessons from 400x Growth in a High-Stakes Financial System b...
Object Storage in ScyllaDB by Ran Regev, ScyllaDB
Lessons Learned from Building a Serverless Notifications System by Srushith R...
A Dist Sys Programmer's Journey into AI by Piotr Sarna

Recently uploaded (20)

PDF
A comparative analysis of optical character recognition models for extracting...
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
WOOl fibre morphology and structure.pdf for textiles
PPTX
A Presentation on Touch Screen Technology
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Tartificialntelligence_presentation.pptx
PDF
Getting Started with Data Integration: FME Form 101
PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Hybrid model detection and classification of lung cancer
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Encapsulation theory and applications.pdf
PPTX
Chapter 5: Probability Theory and Statistics
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
A comparative analysis of optical character recognition models for extracting...
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Hindi spoken digit analysis for native and non-native speakers
Group 1 Presentation -Planning and Decision Making .pptx
WOOl fibre morphology and structure.pdf for textiles
A Presentation on Touch Screen Technology
TLE Review Electricity (Electricity).pptx
Zenith AI: Advanced Artificial Intelligence
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Tartificialntelligence_presentation.pptx
Getting Started with Data Integration: FME Form 101
Web App vs Mobile App What Should You Build First.pdf
Encapsulation_ Review paper, used for researhc scholars
Hybrid model detection and classification of lung cancer
Building Integrated photovoltaic BIPV_UPV.pdf
Encapsulation theory and applications.pdf
Chapter 5: Probability Theory and Statistics
A comparative study of natural language inference in Swahili using monolingua...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx

What Kiwi.com Has Learned Running ScyllaDB and Go

  • 1. What We Have Learned Running ScyllaDB and Go Martin Sucha, Sr. Software Engineer
  • 2. Presenter Martin Sucha, Sr. Software Engineer Always amazed what computers can do, Martin loves learning new stuff about them. Previously employee number four at Exponea, a fast-growing European SaaS company, Martin worked with Python and MongoDB and later learned to love Go. Now working on Go services that utilize ScyllaDB at Kiwi.com.
  • 4. Before migration Service written in Python Service written in Python Service written in Python Cache storing data in Redis™ Persistent data stored in Cassandra®
  • 5. After migration Service written in Python Service written in Python Service written in Go Persistent data stored & cached in ScyllaDB
  • 6. What we use on Go side ■ gocql ■ GOGC=500 ■ gocqlx
  • 7. Our cluster ■ 3 data centers in 3 different locations ■ Data replicated to each ■ One replica per data center {'class': 'NetworkTopologyStrategy', 'dc1': '1', 'dc2': '1', 'dc3': '1'} ■ 400 000 reads/second ■ 600 000 writes/second
  • 8. What does it mean for applications? ■ Don’t use LOCAL_ONE or LOCAL_QUORUM consistency level ■ Retries will always be to remote DC
  • 9. TokenAwareHostPolicy with DCAwareRoundRobinPolicy DC1 Node 1.2 Node 1.1 Node 1.3 Node 1.4 Node 2.2 Node 2.1 Node 2.3 Node 2.4 Node 3.2 Node 3.1 Node 3.3 Node 3.4 DC2 DC3 1 2 3 4 5 6 7 8 9 10 11 12
  • 10. NonLocalReplicasFallback option DC1 Node 1.2 Node 1.1 Node 1.3 Node 1.4 Node 2.2 Node 2.1 Node 2.3 Node 2.4 Node 3.2 Node 3.1 Node 3.3 Node 3.4 DC2 DC3 1 2 7 8 3 4 9 10 5 6 11 12
  • 12. Upgrade to Scylla 2019.1 ■ Better cache behavior ■ BYPASS CACHE ■ Switch to MC sstables saved us ~35% of disk space Row hits
  • 13. Optimizing unmarshalling ■ Our Go service mostly reads data ■ We have some large user defined types ■ We use named types (type MyCustomID = int) ■ gocql.Unmarshal uses reflection and type switches at runtime ■ You can implement custom UnmarshalUDT method (for structs) or UnmarshalCQL method (for any type)
  • 14. UnmarshalUDT type myCustomType struct { Field1 int Field2 string } func (m *myCustomType) UnmarshalUDT(name string, info gocql.TypeInfo, data []byte) error { switch name { case "field1": return gocql.Unmarshal(info, data, &m.Field1) case "field2": return gocql.Unmarshal(info, data, &m.Field2) default: return nil // Skip unknown fields } }
  • 15. 30% CPU saving in 30 minutes
  • 16. Downsides ■ Writing unmarshallers manually is boring ■ Still calls generic gocql.Unmarshal for non-UDT fields ■ Potential for errors
  • 18. github.com/kiwicom/easycql ■ EasyJSON + gocql = easycql ■ Code generator for marshal/unmarshal implementations ■ Conservative mode similar to UnmarshalUDT ■ Optimized mode with more optimizations for unmarshalling
  • 19. Next steps ■ Support all types ■ Optimize based on field order ■ Optimized mode for marshaling
  • 20. Thank you Stay in touch Any questions? Martin Sucha martin.sucha@kiwi.com github.com/martin-sucha

Editor's Notes

  • #3: Thanks for introduction. I joined Go team in kiwi.com almost a year ago (=375 days), about a week (9 days) before guys installed last of our ScyllaDB servers during Scylla Summit 2018. So let’s take a look at what happened at Kiwi.com during the last 12 months.
  • #4: Back then we were in the middle of migration from Cassandra to ScyllaDB.
  • #5: Before the migration we had Cassandra to store our persistent data about flight, bus and train connections. The data was accessed by multiple services that were written in Python. However the performance of Cassandra alone was not sufficient to handle the traffic so there was a cache layer that was storing the data in a bunch of Redis instances. The old setup was not ideal and we seeked to replace it. If you are interested in the details of early phases of the migration, you can watch our talks from last year.
  • #6: No need for redis servers Rewritten service from Python to Go Using Scylla allowed us to remove the separate caching layer as Scylla can manage the cache on its own and provides consistent latency. Removing the caching layer simplified operations and also saved us cost for those servers. However, that is not the only change we did. While we still have most of the services written in Python, we have rewritten one of our core services from Python to Go. Go is well suited for writing networking servers that handle a lot of concurrent requests so we don’t need as many worker processes and we also get the benefits of compiled and statically typed code.
  • #7: On the Go side, our setup is pretty standard, we use gocql driver to communicate with the database. We initially started with the version maintained by Scylla developers because it has support for shard-aware protocol extension which helps to reduce latency when the driver is used with Scylla. Later we started making changes to the driver to fix bugs and introduce new features so we forked it. We contribute our changes back to upstream projects, both to original gocql and the scylla fork. This sometimes results in duplicate work so I hope those two projects will be merged in the future. As described in gocql documentation, we had to tune the Go garbage collector for better performance. We settled with GOCC=500. We also use gocqlx, which has extensions on top of gocql driver. We use it mainly for query building, binding query arguments from structs and scanning query results back to structs.
  • #8: We are running scylla in 3 datacenters in Europe and our data is replicated in all of them. Those data centers were chosen so that they are far enough apart from each other so that a disaster at one site shouldn’t happen at the same time in other sites. However, the locations are close enough so that the latency between the data centers is acceptable for running queries. This allows us to keep only one replica per data center, which saves cost for servers. Audience interaction: Is there anyone else running with one replica per data center?
  • #9: LOCAL consistency levels lose meaning. First of all, we don’t want to use consistency levels that work in single data center as we only have one node in a DC holding a piece of data. Using the levels would We evaluated also possibility of using LOCAL_ONE just for reads (and retrying in another DC higher in the stack), but decided not to do that since this would interfere with Scylla feature called heat-based load balancing that helps to keep latency low after nodes start up with cold cache. With a single replica per datacenter, retries will always be to remote datacenters which is not typical case.
  • #10: The clients have a policy for selecting the order of hosts to try when executing a query. With multi DC deployments, what is usually used is token aware host policy combined with DC aware host policy, which tries to select hosts based on token from local datacenter. Notice that after the hosts from local datacenter selected by token, the policy selects other nodes from local datacenter - those nodes don’t hold copy of the data and need to forward the request for read queries. We only have one replica per datacenter so in case the request to the node holding the data fails, other nodes in local datacenter can only forward the request to the node we tried or to other datacenter.
  • #11: So we introduced a new option for the host selection policy in gocql driver that changes the order in which nodes are selected. With NonLocalReplicasFallback option, we first select hosts that hold a copy of the data by token from the local datacenter, then we select nodes that hold a copy of the data from remote datacenter and only then fallback to nodes that don’t hold a copy of the row.
  • #13: During the initial migration from Cassandra to Scylla we used Scylla version 2018.1. Our search engine precomputes data for searching so we are doing full table scans regularly. We have observed that this was affecting our cache performance. We had to drop the caches once in a while to get back the performance. The upgrade to 2019.1 and adding BYPASS CACHE solved the issue for us. After the upgrade we also switched to MC format of sstables which saved us around 35% of disk space
  • #14: As we were optimizing other Go components of our service (for example we switched to easyjson for json marshalling) the time has come to look at gocql as the deserialization of data become one of the major parts of our CPU usage. At one point in time it accounted for about 40% of the CPU time the service was using. We have some large user defined types in our database schema with maybe two dozen fields and we use named types in Go for some of the fields for increased type safety. Similar to other marshalling/unmarshalling implementations, gocql uses reflection and type switches internally because it cannot know how your types look in advance. Gocql provides hooks to implement custom unmarshalling code so you can plug a more efficient implementation there.
  • #15: It was not immediately obvious from the documentation how the unmarshaller should be implemented at the time and Google search returned only a few results, one of them was the implementation in jaeger. So we learned that UnmarshalUDT implementation could be as simple as a single switch statement calling Unmarshal for each field. This skips some of the reflection work for matching fields in the cql type to those of the Go structure.
  • #16: So we went and implemented custom UnmarshalUDT methods for our struct types in like 30 minutes and unmarshalling cql was suddenly 4 times faster. This amounts to about 30% of CPU time that we saved this way.
  • #17: There are a few downsides to implementing custom unmarshaller like this. First of all, it is just boilerplate code, we want to focus on business logic instead. The unmarshaller could be even faster if it was tailored to the actual field type that is used instead of using a generic unmarshalling function. And we can introduce errors to our codebase since we have to add fields to multiple places. With more complex unmarshalling logic the potential error is even greater.
  • #18: We already used easyjson to generate marshaling code for JSON and similarly we wanted to generate code for unmarshaling user defined types in gocql.
  • #19: But there wasn’t a tool like that for gocql. So we combined EasyJSON and gocql into a code generator that can generate unmarshaling code for cql types. First of all, we wanted to automate generating the UnmarshalUDT code so that we don’t need to maintain the marshalers and unmarshalers manually.