SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Java Serialization
Facts and Fallacies
© 2013, Roman Elizarov, Devexperts
Serialization
… is the process of translating data structures or object
state into a format that can be stored (for example, in
a file or memory buffer, or transmitted across a network
connection link) and resurrected later in the same or
another computer environment.
-- WIkipedia

Object

Bytes

Network/Storage
Use-cases
• Transfer data over network between cluster nodes or between
servers and clients
- Serialization is a key technology behind any RPC/RMI

• Serialization if often used for storage
- but then data transfer is still often a part of the picture
Java serialization facility (key facts)
• Had appeared in 1997 as a part of JDK 1.1 release
• Uses java.io.Serializable as a marker interface
• Consists of java.io.ObjectInputStream/ObjectOutputStream with
related classes and interfaces
• Has “Java Object Serialization Specification” that documents
both API and object serialization stream protocol
• Is part of any Java platform (even Android has it)
• Somehow has a lot of myths around it
It is a joke
… and the only JEP joke (!)
… and it has a big grain of truth:
There are lots of folk myths about serialization
Hazelcast Portable
Google protobuf
Hessian
Protostuff

Kryo

Coherence POF
JBoss serialization

Apache Avro

fast-serialization

Apache Thrift

Hadoop Writable

jserial

quickser
GridGain serialization

msgpack

wobly

Burlap

EclipseLink MOXy

Gson
Json-lib

JAXB
XStream

FLEXJSON

Javolution XML

Jackson
svenson

java.beans.XMLEncoder/XMLDecoder
jsonij
The obvious fact of live

Real hackers write everything from scratch 
Every mature appserver/framework/cache/eventbus/soa/rpc/db/etc
must have its own serialization that is better than everybody else’s 
How to choose a serialization lib?
• Cross-language or Java-only
• Binary or text (XML/JSON/other) format
• Custom or automatic object-to-serialized format mapping
• Needs format description/mapping/annotation or not
• Writes object scheme (e.g. field names) with each object, once per
request, once per session, never at all, or some mixed approach
• Writes object fields or bean properties
• Serializes object graph with shared objects or not
• Performance
- CPU consumption to serialize/deserialize

- Network consumption (bytes per object)
Java built-in serialization lib?
• Cross-language or Java-only
• Binary or text (XML/JSON/other) format
• Custom or automatic object-to-serialized format mapping
• Needs format description/mapping/annotation or not
• Writes object scheme (e.g. field names) with each object, once per
request, once per session, never at all, or some mixed approach
• Writes object fields or bean properties
• Serializes object graph with shared objects or not
• Performance
- CPU consumption to serialize/deserialize

- Network consumption (bytes per object)
Serious serialization lib choice diagram
YES

YES

Java to JS?

Cross-platform
data transfer?

NO

Use built-in Java
Serialization

YES
Jackson/gson/etc
do further
research

NO

Do you have
problems with
it?

NO
Serialization myth #1
I’ve found this framework called XYZ…
… it has really simple and fast serialization

All you have to do is to implement this interface! Easy!

I’ve tested it! It is really fast!
It outperforms everything else I’ve tried!
/* This is almost actual real-life conversation.
* Names changed

*/
In fact this is corollary to “The obvious fact of life”
• Of course it is the fastest possible way! But this does not solve
the most complex serialization problems
- You can implement java.io.Externalizable if you are up to writing a
custom serialization code for each object.

• Maintenance cost/efforts are often underestimated
- How are you planning to evolve your system? Add new fields? New
classes?
• What will keep you from forgetting to read/write them?
• Ah… yes, you write a lot of extra tests in addition to writing your
write/read methods to make sure your serialization works
- How about on-the-wire compatibility of old code and new one?
• But I deploy all of my system with a new version at once!
• But how do you work with it during development?
Serialization myth #2

java.io.Serializable …
“This interface limits how its implementing classes can
change in the future. By implementing Serializable you
expose your flexible in-memory implementation details as a
rigid binary representation. Simple code changes--like
renaming private fields--are not safe when the changed
class is serializable.”

http://developer.android.com/reference/java/io/Serializable.html
So what about this code evolution?

write
read

got
serialVersionUID
• serialVersionUID = crazy hash of your class
- If you change your class -> serialVersionUID changes -> incompatible

• But you can set serialVersionUID as a “private static final long”
field in your class to fix it.
• With a fixed serialVersionUID java serialization supports:
- Adding/removing fields without any additional hurdles and annotations
- Moving fields around in class definition
- Extracting/inlining super-classes (but without moving serializable fields
up/down class hierarchy).

• It basically means you can evolve your class at will, just a you
would do with key-value map in json/other-untyped-system
serialver
• That’s the tool to compute serialVersionUID as some crazy hash
of your class
- You only need it when your class is “in the wild” without explicitly
assigned serialVersionUID and you want to be backwards
compatible with that version of it

• DO NOT USE serialver for freshly created classes
- It is a pseudo random number that serves no purpose, but to make
your gzipped class files and gzipped serial files larger
- Just set serialVersionUID = 0
• It is no worse, but better than any other value
So what about this code evolution (2)?

wrie
got
symbol – as written
quantity – as written
price – as written
orderType – null

read

Profit!

It works the other way around, too!
What if I want to make my class incompatible?
• You have two choices
- serialVersionUID++
- Rename class

• So, having serialVersionUID in a modern serialization framework is
an optional feature
- They just did not have refactorings back then in 1996, so renaming a
class was not an option for them

- They chose a default of “your changes break serialization” and force
you to explicitly declare serialVersionUID if you want “your changes
are backwards compatible”
• I would have preferred the other default, but having to manually
add serialVersionUID is a small price to pay for a serialization
facility that you have out-of-the box in Java.
Complex changes made compatible
• Java serialization has a bunch of features to support radical
evolution of serializable classes in backwards-compatible way:
- writeReplace/readResolve
• Lets you migrate your code to a completely new class, but still use
the old class for serialization.
- putFields/writeFields/readFields
Lets you completely redo the fields of the object, but still be
compatible with the old set of fields for serialization.

It really helps if you are working on, evolving,
improving, and refactoring really big projects
What about “renaming private fields is unsafe”?
• It is just a matter of developer’s choice on what actually constitutes
“serial form” of the class:
- It’s private fields
• like in Java serialization
- It’s public API with its getter/setter methods
• aka “Bean Serialization”
• many serialization frameworks follow this approach
• good match when you need to expose public API via serialization
- A totally separate code, file, or annotation defines serial form
• you have to write it in addition to your class
• more work, but the approach is the most flexible and pays of in
case of highly heterogeneous system (many platforms/languages)
http://www.organisationscience.com/styled-6/
Serialization myth #3
In practice
• It really matters when very verbose text formats like XML are used
in a combination with not-so-fast serializer implementations
• Most binary formats are fast and compact enough, so that they do
not constitute a bottleneck in the system
- Data is usually expensive to acquire (compute, fetch from db, etc)
- Otherwise (if data is in cache) and the only action of the system is to
retrieve it from cache and send, then cache serialized data in binary
form, thus making serialization performance irrelevant
aka “marshalled object”
Popular myth #4

© Stack Overflow authors, emphasis is mine
A popular way to benchmark serialization

https://github.com/eishay/jvm-serializers/blob/master/tpc/src/serializers/JavaBuiltIn.java
The real fact about serialization performance
• ObjectOutputStream/ObjectInputStream are expensive to create
- >1KB of internal buffers allocated
- It matters if you really do a lot of serialization

• You can reuse OOS/OIS instances if you need
- It is easy when you write a single stream of values
• Just keep doing writeObject(!)
• That is what it was designed for
• The added benefit is that class descriptors are written just once
- It is slightly tricky if you want to optimize it for one time writes
• The actual gain is modest and depends on the kinds of objects you
are serializing (their size, your heap/gc load, etc)
The real fact about serialization performance (2)
• Each ObjectOutputStream writes class descriptor on the first
encounter
- reset() clears internal handles table that keep both written objects (for
object graph serialization) and written class descriptors
• BEWARE: All written objects are retained until you call reset()

• Writing class descriptor is a signification portion of both CPU time
consumption and resulting space
- That is the price you pay for all the automagic class evolution features
without having to manually define field ids, create mappings, or write
custom code
- The data itself is relatively fast to write and has straightforward binary
format (4 bytes per int, etc)
Beware of benchmarks
• A typical benchmark compares different serialization frameworks
doing tasks of absolutely different complexity
• With Java serialization facility you necessary pay for
- No hassle object-to-serial format mapping
• (no writing of interface descriptions, no code generation)
- Support for wide range of class evolution scenarios
- Support for object graph writes

- Support for machines with different byte-endianness

• Most significant performance/size improvements are gained by
forfeiting one of these qualities
- Be sure to understand what exactly you forfeit
Real cons of Java serialization
• Just one reset() to rule them all
- No way to “resetObjects()” to clear all message-level object graph info
(referenced objects), but keep session-level information (written class
descriptors) to avoid repetition when keeping a network session to
recipient open
• Anyone knows ins-and-outs of JEP process to improve it?

• Can use some performance improvement 
- Some obviously unnecessary allocations of internal objects can be
removed, code simplified, streamlined
• I’m looking for help in “contributing to JDK” area
- But do remember, that it rarely matters in practice
Summary
• Java serialization is there out-of-the box
• It handles most Java-to-Java serialization needs well
- While providing a wide range of goodies

• It provides non-compact, but binary representation
- It works especially good, if you have collections of repeated business
objects

• It covers a wide range of class evolution scenarios
- Set serialVersionUID = 0 to be happy

• It has decent performance that does not often show on profiler’s
radar in practice
• We use it in Devexperts for all our Java-to-Java non-market-data
46000

305400
Sent orders in one day

Users on-line in one day

We create professional financial software for
Brokerage and Exchanges since 2002
99.99%
Our software index
of trouble-free operation

350
Peoples in our team

365 7 24
We support our products
around-the-clock
Headquarters
197110, 10/1 Barochnaya st.
Saint Petersburg, Russia
+7 812 438 16 26
mail@devexperts.com

www.devexperts.com
Contact me by email: elizarov at devexperts.com
Read my blog: http://elizarov.livejournal.com/

Weitere ähnliche Inhalte

Was ist angesagt?

JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011Charles Nutter
 
Lagergren jvmls-2013-final
Lagergren jvmls-2013-finalLagergren jvmls-2013-final
Lagergren jvmls-2013-finalMarcus Lagergren
 
Down the Rabbit Hole: An Adventure in JVM Wonderland
Down the Rabbit Hole: An Adventure in JVM WonderlandDown the Rabbit Hole: An Adventure in JVM Wonderland
Down the Rabbit Hole: An Adventure in JVM WonderlandCharles Nutter
 
The Year of JRuby - RubyC 2018
The Year of JRuby - RubyC 2018The Year of JRuby - RubyC 2018
The Year of JRuby - RubyC 2018Charles Nutter
 
Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013Charles Nutter
 
Scala Refactoring for Fun and Profit (Japanese subtitles)
Scala Refactoring for Fun and Profit (Japanese subtitles)Scala Refactoring for Fun and Profit (Japanese subtitles)
Scala Refactoring for Fun and Profit (Japanese subtitles)Tomer Gabel
 
iOS Multithreading
iOS MultithreadingiOS Multithreading
iOS MultithreadingRicha Jain
 
The Why and How of Scala at Twitter
The Why and How of Scala at TwitterThe Why and How of Scala at Twitter
The Why and How of Scala at TwitterAlex Payne
 
Fast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaFast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaCharles Nutter
 
How Scala code is expressed in the JVM
How Scala code is expressed in the JVMHow Scala code is expressed in the JVM
How Scala code is expressed in the JVMKoichi Sakata
 
Introduction of failsafe
Introduction of failsafeIntroduction of failsafe
Introduction of failsafeSunghyouk Bae
 
From Ruby to Scala
From Ruby to ScalaFrom Ruby to Scala
From Ruby to Scalatod esking
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?Doug Hawkins
 
Kotlin @ Coupang Backed - JetBrains Day seoul 2018
Kotlin @ Coupang Backed - JetBrains Day seoul 2018Kotlin @ Coupang Backed - JetBrains Day seoul 2018
Kotlin @ Coupang Backed - JetBrains Day seoul 2018Sunghyouk Bae
 
Weaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Weaving Dataflows with Silk - ScalaMatsuri 2014, TokyoWeaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Weaving Dataflows with Silk - ScalaMatsuri 2014, TokyoTaro L. Saito
 
Scala Matsuri 2016: Japanese Text Mining with Scala and Spark
Scala Matsuri 2016: Japanese Text Mining with Scala and SparkScala Matsuri 2016: Japanese Text Mining with Scala and Spark
Scala Matsuri 2016: Japanese Text Mining with Scala and SparkEduardo Gonzalez
 
JRuby and Invokedynamic - Japan JUG 2015
JRuby and Invokedynamic - Japan JUG 2015JRuby and Invokedynamic - Japan JUG 2015
JRuby and Invokedynamic - Japan JUG 2015Charles Nutter
 
The State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila SzegediThe State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila SzegediZeroTurnaround
 
An Introduction to JVM Internals and Garbage Collection in Java
An Introduction to JVM Internals and Garbage Collection in JavaAn Introduction to JVM Internals and Garbage Collection in Java
An Introduction to JVM Internals and Garbage Collection in JavaAbhishek Asthana
 
Kotlin @ Coupang Backend 2017
Kotlin @ Coupang Backend 2017Kotlin @ Coupang Backend 2017
Kotlin @ Coupang Backend 2017Sunghyouk Bae
 

Was ist angesagt? (20)

JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011
 
Lagergren jvmls-2013-final
Lagergren jvmls-2013-finalLagergren jvmls-2013-final
Lagergren jvmls-2013-final
 
Down the Rabbit Hole: An Adventure in JVM Wonderland
Down the Rabbit Hole: An Adventure in JVM WonderlandDown the Rabbit Hole: An Adventure in JVM Wonderland
Down the Rabbit Hole: An Adventure in JVM Wonderland
 
The Year of JRuby - RubyC 2018
The Year of JRuby - RubyC 2018The Year of JRuby - RubyC 2018
The Year of JRuby - RubyC 2018
 
Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013
 
Scala Refactoring for Fun and Profit (Japanese subtitles)
Scala Refactoring for Fun and Profit (Japanese subtitles)Scala Refactoring for Fun and Profit (Japanese subtitles)
Scala Refactoring for Fun and Profit (Japanese subtitles)
 
iOS Multithreading
iOS MultithreadingiOS Multithreading
iOS Multithreading
 
The Why and How of Scala at Twitter
The Why and How of Scala at TwitterThe Why and How of Scala at Twitter
The Why and How of Scala at Twitter
 
Fast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaFast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible Java
 
How Scala code is expressed in the JVM
How Scala code is expressed in the JVMHow Scala code is expressed in the JVM
How Scala code is expressed in the JVM
 
Introduction of failsafe
Introduction of failsafeIntroduction of failsafe
Introduction of failsafe
 
From Ruby to Scala
From Ruby to ScalaFrom Ruby to Scala
From Ruby to Scala
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?
 
Kotlin @ Coupang Backed - JetBrains Day seoul 2018
Kotlin @ Coupang Backed - JetBrains Day seoul 2018Kotlin @ Coupang Backed - JetBrains Day seoul 2018
Kotlin @ Coupang Backed - JetBrains Day seoul 2018
 
Weaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Weaving Dataflows with Silk - ScalaMatsuri 2014, TokyoWeaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Weaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
 
Scala Matsuri 2016: Japanese Text Mining with Scala and Spark
Scala Matsuri 2016: Japanese Text Mining with Scala and SparkScala Matsuri 2016: Japanese Text Mining with Scala and Spark
Scala Matsuri 2016: Japanese Text Mining with Scala and Spark
 
JRuby and Invokedynamic - Japan JUG 2015
JRuby and Invokedynamic - Japan JUG 2015JRuby and Invokedynamic - Japan JUG 2015
JRuby and Invokedynamic - Japan JUG 2015
 
The State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila SzegediThe State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila Szegedi
 
An Introduction to JVM Internals and Garbage Collection in Java
An Introduction to JVM Internals and Garbage Collection in JavaAn Introduction to JVM Internals and Garbage Collection in Java
An Introduction to JVM Internals and Garbage Collection in Java
 
Kotlin @ Coupang Backend 2017
Kotlin @ Coupang Backend 2017Kotlin @ Coupang Backend 2017
Kotlin @ Coupang Backend 2017
 

Andere mochten auch

The theory of concurrent programming for a seasoned programmer
The theory of concurrent programming for a seasoned programmerThe theory of concurrent programming for a seasoned programmer
The theory of concurrent programming for a seasoned programmerRoman Elizarov
 
Java Serialization Deep Dive
Java Serialization Deep DiveJava Serialization Deep Dive
Java Serialization Deep DiveMartijn Dashorst
 
ACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems ReviewACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems ReviewRoman Elizarov
 
Statechart modeling of interactive gesture-based applications
Statechart modeling of interactive gesture-based applicationsStatechart modeling of interactive gesture-based applications
Statechart modeling of interactive gesture-based applicationsTom Mens
 
Black Hat EU 2010 - Attacking Java Serialized Communication
Black Hat EU 2010 - Attacking Java Serialized CommunicationBlack Hat EU 2010 - Attacking Java Serialized Communication
Black Hat EU 2010 - Attacking Java Serialized Communicationmsaindane
 
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...Christopher Frohoff
 
Efficient Data Storage for Analytics with Apache Parquet 2.0
Efficient Data Storage for Analytics with Apache Parquet 2.0Efficient Data Storage for Analytics with Apache Parquet 2.0
Efficient Data Storage for Analytics with Apache Parquet 2.0Cloudera, Inc.
 
Serialization/deserialization
Serialization/deserializationSerialization/deserialization
Serialization/deserializationYoung Alista
 
Building a Server-less Data Lake on AWS - Technical 301
Building a Server-less Data Lake on AWS - Technical 301Building a Server-less Data Lake on AWS - Technical 301
Building a Server-less Data Lake on AWS - Technical 301Amazon Web Services
 
Construcción del blog
Construcción del blogConstrucción del blog
Construcción del blogEmmanuelBustos
 
Rust samurai lightning talk
Rust samurai lightning talkRust samurai lightning talk
Rust samurai lightning talkNaruto TAKAHASHI
 
Derechos de la trabajadora del hogar
Derechos de la trabajadora del hogarDerechos de la trabajadora del hogar
Derechos de la trabajadora del hogarjackelin chincha
 
Intervento renza luigi_contratto
Intervento renza luigi_contrattoIntervento renza luigi_contratto
Intervento renza luigi_contrattoRenza Cambini
 
Module #3a nursing disciplines overview
Module #3a nursing disciplines overviewModule #3a nursing disciplines overview
Module #3a nursing disciplines overviewgls0006
 
Inspire [autosaved]
Inspire [autosaved]Inspire [autosaved]
Inspire [autosaved]kcmom24
 

Andere mochten auch (20)

The theory of concurrent programming for a seasoned programmer
The theory of concurrent programming for a seasoned programmerThe theory of concurrent programming for a seasoned programmer
The theory of concurrent programming for a seasoned programmer
 
Java Serialization Deep Dive
Java Serialization Deep DiveJava Serialization Deep Dive
Java Serialization Deep Dive
 
ACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems ReviewACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems Review
 
Statechart modeling of interactive gesture-based applications
Statechart modeling of interactive gesture-based applicationsStatechart modeling of interactive gesture-based applications
Statechart modeling of interactive gesture-based applications
 
Black Hat EU 2010 - Attacking Java Serialized Communication
Black Hat EU 2010 - Attacking Java Serialized CommunicationBlack Hat EU 2010 - Attacking Java Serialized Communication
Black Hat EU 2010 - Attacking Java Serialized Communication
 
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
 
Efficient Data Storage for Analytics with Apache Parquet 2.0
Efficient Data Storage for Analytics with Apache Parquet 2.0Efficient Data Storage for Analytics with Apache Parquet 2.0
Efficient Data Storage for Analytics with Apache Parquet 2.0
 
Serialization/deserialization
Serialization/deserializationSerialization/deserialization
Serialization/deserialization
 
Building a Server-less Data Lake on AWS - Technical 301
Building a Server-less Data Lake on AWS - Technical 301Building a Server-less Data Lake on AWS - Technical 301
Building a Server-less Data Lake on AWS - Technical 301
 
Construcción del blog
Construcción del blogConstrucción del blog
Construcción del blog
 
2.1 ordinal numbers
2.1 ordinal numbers2.1 ordinal numbers
2.1 ordinal numbers
 
Rust samurai lightning talk
Rust samurai lightning talkRust samurai lightning talk
Rust samurai lightning talk
 
Lineas de producto PHOTOGRAPHY SHOW
Lineas de producto PHOTOGRAPHY SHOWLineas de producto PHOTOGRAPHY SHOW
Lineas de producto PHOTOGRAPHY SHOW
 
Dia 1
Dia 1Dia 1
Dia 1
 
Derechos de la trabajadora del hogar
Derechos de la trabajadora del hogarDerechos de la trabajadora del hogar
Derechos de la trabajadora del hogar
 
En el paradisíaco lago titicaca
En el paradisíaco lago titicacaEn el paradisíaco lago titicaca
En el paradisíaco lago titicaca
 
Intervento renza luigi_contratto
Intervento renza luigi_contrattoIntervento renza luigi_contratto
Intervento renza luigi_contratto
 
Module #3a nursing disciplines overview
Module #3a nursing disciplines overviewModule #3a nursing disciplines overview
Module #3a nursing disciplines overview
 
Freello | Mobile Marketing 4 Media
Freello | Mobile Marketing 4 MediaFreello | Mobile Marketing 4 Media
Freello | Mobile Marketing 4 Media
 
Inspire [autosaved]
Inspire [autosaved]Inspire [autosaved]
Inspire [autosaved]
 

Ähnlich wie Java Serialization Facts and Fallacies

Scala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud FoundryScala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud FoundryPray Desai
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updatesVinay H G
 
Scala in the Wild
Scala in the WildScala in the Wild
Scala in the WildTomer Gabel
 
Design patterns
Design patternsDesign patterns
Design patternsAlok Guha
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Martijn Verburg
 
Pune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCDPune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCDPrashant Rane
 
Ups and downs of enterprise Java app in a research setting
Ups and downs of enterprise Java app in a research settingUps and downs of enterprise Java app in a research setting
Ups and downs of enterprise Java app in a research settingCsaba Toth
 
BP-9 Share Customization Best Practices
BP-9 Share Customization Best PracticesBP-9 Share Customization Best Practices
BP-9 Share Customization Best PracticesAlfresco Software
 
Unit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rdUnit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rdprat0ham
 
Introduction to Software - Coder Forge - John Mulhall
Introduction to Software - Coder Forge - John MulhallIntroduction to Software - Coder Forge - John Mulhall
Introduction to Software - Coder Forge - John MulhallJohn Mulhall
 
Jax london 2011
Jax london 2011Jax london 2011
Jax london 2011njbartlett
 
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil BartlettJava Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil BartlettJAX London
 
BP-7 Share Customization Best Practices
BP-7 Share Customization Best PracticesBP-7 Share Customization Best Practices
BP-7 Share Customization Best PracticesAlfresco Software
 

Ähnlich wie Java Serialization Facts and Fallacies (20)

Javasession6
Javasession6Javasession6
Javasession6
 
Scala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud FoundryScala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud Foundry
 
Hibernate tutorial
Hibernate tutorialHibernate tutorial
Hibernate tutorial
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updates
 
Java and the JVM
Java and the JVMJava and the JVM
Java and the JVM
 
Scala in the Wild
Scala in the WildScala in the Wild
Scala in the Wild
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)
 
Pune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCDPune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCD
 
ppt_on_java.pptx
ppt_on_java.pptxppt_on_java.pptx
ppt_on_java.pptx
 
Ups and downs of enterprise Java app in a research setting
Ups and downs of enterprise Java app in a research settingUps and downs of enterprise Java app in a research setting
Ups and downs of enterprise Java app in a research setting
 
BP-9 Share Customization Best Practices
BP-9 Share Customization Best PracticesBP-9 Share Customization Best Practices
BP-9 Share Customization Best Practices
 
Unit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rdUnit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rd
 
Introduction to Software - Coder Forge - John Mulhall
Introduction to Software - Coder Forge - John MulhallIntroduction to Software - Coder Forge - John Mulhall
Introduction to Software - Coder Forge - John Mulhall
 
Jax london 2011
Jax london 2011Jax london 2011
Jax london 2011
 
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil BartlettJava Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
 
CS8392 OOP
CS8392 OOPCS8392 OOP
CS8392 OOP
 
oop unit1.pptx
oop unit1.pptxoop unit1.pptx
oop unit1.pptx
 
Scala-Ls1
Scala-Ls1Scala-Ls1
Scala-Ls1
 
BP-7 Share Customization Best Practices
BP-7 Share Customization Best PracticesBP-7 Share Customization Best Practices
BP-7 Share Customization Best Practices
 

Mehr von Roman Elizarov

Kotlin Coroutines in Practice @ KotlinConf 2018
Kotlin Coroutines in Practice @ KotlinConf 2018Kotlin Coroutines in Practice @ KotlinConf 2018
Kotlin Coroutines in Practice @ KotlinConf 2018Roman Elizarov
 
Deep dive into Coroutines on JVM @ KotlinConf 2017
Deep dive into Coroutines on JVM @ KotlinConf 2017Deep dive into Coroutines on JVM @ KotlinConf 2017
Deep dive into Coroutines on JVM @ KotlinConf 2017Roman Elizarov
 
Introduction to Coroutines @ KotlinConf 2017
Introduction to Coroutines @ KotlinConf 2017Introduction to Coroutines @ KotlinConf 2017
Introduction to Coroutines @ KotlinConf 2017Roman Elizarov
 
Fresh Async with Kotlin @ QConSF 2017
Fresh Async with Kotlin @ QConSF 2017Fresh Async with Kotlin @ QConSF 2017
Fresh Async with Kotlin @ QConSF 2017Roman Elizarov
 
Scale Up with Lock-Free Algorithms @ JavaOne
Scale Up with Lock-Free Algorithms @ JavaOneScale Up with Lock-Free Algorithms @ JavaOne
Scale Up with Lock-Free Algorithms @ JavaOneRoman Elizarov
 
Kotlin Coroutines Reloaded
Kotlin Coroutines ReloadedKotlin Coroutines Reloaded
Kotlin Coroutines ReloadedRoman Elizarov
 
Lock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesLock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesRoman Elizarov
 
Introduction to Kotlin coroutines
Introduction to Kotlin coroutinesIntroduction to Kotlin coroutines
Introduction to Kotlin coroutinesRoman Elizarov
 
Многопоточное Программирование - Теория и Практика
Многопоточное Программирование - Теория и ПрактикаМногопоточное Программирование - Теория и Практика
Многопоточное Программирование - Теория и ПрактикаRoman Elizarov
 
ACM ICPC 2015 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2015 NEERC (Northeastern European Regional Contest) Problems ReviewACM ICPC 2015 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2015 NEERC (Northeastern European Regional Contest) Problems ReviewRoman Elizarov
 
ACM ICPC 2014 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2014 NEERC (Northeastern European Regional Contest) Problems ReviewACM ICPC 2014 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2014 NEERC (Northeastern European Regional Contest) Problems ReviewRoman Elizarov
 
Многопоточные Алгоритмы (для BitByte 2014)
Многопоточные Алгоритмы (для BitByte 2014)Многопоточные Алгоритмы (для BitByte 2014)
Многопоточные Алгоритмы (для BitByte 2014)Roman Elizarov
 
Теоретический минимум для понимания Java Memory Model (для JPoint 2014)
Теоретический минимум для понимания Java Memory Model (для JPoint 2014)Теоретический минимум для понимания Java Memory Model (для JPoint 2014)
Теоретический минимум для понимания Java Memory Model (для JPoint 2014)Roman Elizarov
 
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems ReviewACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems ReviewRoman Elizarov
 
ACM ICPC 2012 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2012 NEERC (Northeastern European Regional Contest) Problems ReviewACM ICPC 2012 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2012 NEERC (Northeastern European Regional Contest) Problems ReviewRoman Elizarov
 
Пишем самый быстрый хеш для кэширования данных
Пишем самый быстрый хеш для кэширования данныхПишем самый быстрый хеш для кэширования данных
Пишем самый быстрый хеш для кэширования данныхRoman Elizarov
 

Mehr von Roman Elizarov (16)

Kotlin Coroutines in Practice @ KotlinConf 2018
Kotlin Coroutines in Practice @ KotlinConf 2018Kotlin Coroutines in Practice @ KotlinConf 2018
Kotlin Coroutines in Practice @ KotlinConf 2018
 
Deep dive into Coroutines on JVM @ KotlinConf 2017
Deep dive into Coroutines on JVM @ KotlinConf 2017Deep dive into Coroutines on JVM @ KotlinConf 2017
Deep dive into Coroutines on JVM @ KotlinConf 2017
 
Introduction to Coroutines @ KotlinConf 2017
Introduction to Coroutines @ KotlinConf 2017Introduction to Coroutines @ KotlinConf 2017
Introduction to Coroutines @ KotlinConf 2017
 
Fresh Async with Kotlin @ QConSF 2017
Fresh Async with Kotlin @ QConSF 2017Fresh Async with Kotlin @ QConSF 2017
Fresh Async with Kotlin @ QConSF 2017
 
Scale Up with Lock-Free Algorithms @ JavaOne
Scale Up with Lock-Free Algorithms @ JavaOneScale Up with Lock-Free Algorithms @ JavaOne
Scale Up with Lock-Free Algorithms @ JavaOne
 
Kotlin Coroutines Reloaded
Kotlin Coroutines ReloadedKotlin Coroutines Reloaded
Kotlin Coroutines Reloaded
 
Lock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesLock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin Coroutines
 
Introduction to Kotlin coroutines
Introduction to Kotlin coroutinesIntroduction to Kotlin coroutines
Introduction to Kotlin coroutines
 
Многопоточное Программирование - Теория и Практика
Многопоточное Программирование - Теория и ПрактикаМногопоточное Программирование - Теория и Практика
Многопоточное Программирование - Теория и Практика
 
ACM ICPC 2015 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2015 NEERC (Northeastern European Regional Contest) Problems ReviewACM ICPC 2015 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2015 NEERC (Northeastern European Regional Contest) Problems Review
 
ACM ICPC 2014 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2014 NEERC (Northeastern European Regional Contest) Problems ReviewACM ICPC 2014 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2014 NEERC (Northeastern European Regional Contest) Problems Review
 
Многопоточные Алгоритмы (для BitByte 2014)
Многопоточные Алгоритмы (для BitByte 2014)Многопоточные Алгоритмы (для BitByte 2014)
Многопоточные Алгоритмы (для BitByte 2014)
 
Теоретический минимум для понимания Java Memory Model (для JPoint 2014)
Теоретический минимум для понимания Java Memory Model (для JPoint 2014)Теоретический минимум для понимания Java Memory Model (для JPoint 2014)
Теоретический минимум для понимания Java Memory Model (для JPoint 2014)
 
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems ReviewACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems Review
 
ACM ICPC 2012 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2012 NEERC (Northeastern European Regional Contest) Problems ReviewACM ICPC 2012 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2012 NEERC (Northeastern European Regional Contest) Problems Review
 
Пишем самый быстрый хеш для кэширования данных
Пишем самый быстрый хеш для кэширования данныхПишем самый быстрый хеш для кэширования данных
Пишем самый быстрый хеш для кэширования данных
 

Kürzlich hochgeladen

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
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
 
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
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
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
 
"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
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 

Kürzlich hochgeladen (20)

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
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
 
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
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
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
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
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
 
"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
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 

Java Serialization Facts and Fallacies

  • 1. Java Serialization Facts and Fallacies © 2013, Roman Elizarov, Devexperts
  • 2. Serialization … is the process of translating data structures or object state into a format that can be stored (for example, in a file or memory buffer, or transmitted across a network connection link) and resurrected later in the same or another computer environment. -- WIkipedia Object Bytes Network/Storage
  • 3. Use-cases • Transfer data over network between cluster nodes or between servers and clients - Serialization is a key technology behind any RPC/RMI • Serialization if often used for storage - but then data transfer is still often a part of the picture
  • 4. Java serialization facility (key facts) • Had appeared in 1997 as a part of JDK 1.1 release • Uses java.io.Serializable as a marker interface • Consists of java.io.ObjectInputStream/ObjectOutputStream with related classes and interfaces • Has “Java Object Serialization Specification” that documents both API and object serialization stream protocol • Is part of any Java platform (even Android has it) • Somehow has a lot of myths around it
  • 5. It is a joke … and the only JEP joke (!) … and it has a big grain of truth: There are lots of folk myths about serialization
  • 6.
  • 7. Hazelcast Portable Google protobuf Hessian Protostuff Kryo Coherence POF JBoss serialization Apache Avro fast-serialization Apache Thrift Hadoop Writable jserial quickser GridGain serialization msgpack wobly Burlap EclipseLink MOXy Gson Json-lib JAXB XStream FLEXJSON Javolution XML Jackson svenson java.beans.XMLEncoder/XMLDecoder jsonij
  • 8. The obvious fact of live Real hackers write everything from scratch  Every mature appserver/framework/cache/eventbus/soa/rpc/db/etc must have its own serialization that is better than everybody else’s 
  • 9. How to choose a serialization lib? • Cross-language or Java-only • Binary or text (XML/JSON/other) format • Custom or automatic object-to-serialized format mapping • Needs format description/mapping/annotation or not • Writes object scheme (e.g. field names) with each object, once per request, once per session, never at all, or some mixed approach • Writes object fields or bean properties • Serializes object graph with shared objects or not • Performance - CPU consumption to serialize/deserialize - Network consumption (bytes per object)
  • 10. Java built-in serialization lib? • Cross-language or Java-only • Binary or text (XML/JSON/other) format • Custom or automatic object-to-serialized format mapping • Needs format description/mapping/annotation or not • Writes object scheme (e.g. field names) with each object, once per request, once per session, never at all, or some mixed approach • Writes object fields or bean properties • Serializes object graph with shared objects or not • Performance - CPU consumption to serialize/deserialize - Network consumption (bytes per object)
  • 11. Serious serialization lib choice diagram YES YES Java to JS? Cross-platform data transfer? NO Use built-in Java Serialization YES Jackson/gson/etc do further research NO Do you have problems with it? NO
  • 12. Serialization myth #1 I’ve found this framework called XYZ… … it has really simple and fast serialization All you have to do is to implement this interface! Easy! I’ve tested it! It is really fast! It outperforms everything else I’ve tried! /* This is almost actual real-life conversation. * Names changed */
  • 13. In fact this is corollary to “The obvious fact of life” • Of course it is the fastest possible way! But this does not solve the most complex serialization problems - You can implement java.io.Externalizable if you are up to writing a custom serialization code for each object. • Maintenance cost/efforts are often underestimated - How are you planning to evolve your system? Add new fields? New classes? • What will keep you from forgetting to read/write them? • Ah… yes, you write a lot of extra tests in addition to writing your write/read methods to make sure your serialization works - How about on-the-wire compatibility of old code and new one? • But I deploy all of my system with a new version at once! • But how do you work with it during development?
  • 14. Serialization myth #2 java.io.Serializable … “This interface limits how its implementing classes can change in the future. By implementing Serializable you expose your flexible in-memory implementation details as a rigid binary representation. Simple code changes--like renaming private fields--are not safe when the changed class is serializable.” http://developer.android.com/reference/java/io/Serializable.html
  • 15. So what about this code evolution? write read got
  • 16. serialVersionUID • serialVersionUID = crazy hash of your class - If you change your class -> serialVersionUID changes -> incompatible • But you can set serialVersionUID as a “private static final long” field in your class to fix it. • With a fixed serialVersionUID java serialization supports: - Adding/removing fields without any additional hurdles and annotations - Moving fields around in class definition - Extracting/inlining super-classes (but without moving serializable fields up/down class hierarchy). • It basically means you can evolve your class at will, just a you would do with key-value map in json/other-untyped-system
  • 17. serialver • That’s the tool to compute serialVersionUID as some crazy hash of your class - You only need it when your class is “in the wild” without explicitly assigned serialVersionUID and you want to be backwards compatible with that version of it • DO NOT USE serialver for freshly created classes - It is a pseudo random number that serves no purpose, but to make your gzipped class files and gzipped serial files larger - Just set serialVersionUID = 0 • It is no worse, but better than any other value
  • 18. So what about this code evolution (2)? wrie got symbol – as written quantity – as written price – as written orderType – null read Profit! It works the other way around, too!
  • 19. What if I want to make my class incompatible? • You have two choices - serialVersionUID++ - Rename class • So, having serialVersionUID in a modern serialization framework is an optional feature - They just did not have refactorings back then in 1996, so renaming a class was not an option for them - They chose a default of “your changes break serialization” and force you to explicitly declare serialVersionUID if you want “your changes are backwards compatible” • I would have preferred the other default, but having to manually add serialVersionUID is a small price to pay for a serialization facility that you have out-of-the box in Java.
  • 20. Complex changes made compatible • Java serialization has a bunch of features to support radical evolution of serializable classes in backwards-compatible way: - writeReplace/readResolve • Lets you migrate your code to a completely new class, but still use the old class for serialization. - putFields/writeFields/readFields Lets you completely redo the fields of the object, but still be compatible with the old set of fields for serialization. It really helps if you are working on, evolving, improving, and refactoring really big projects
  • 21. What about “renaming private fields is unsafe”? • It is just a matter of developer’s choice on what actually constitutes “serial form” of the class: - It’s private fields • like in Java serialization - It’s public API with its getter/setter methods • aka “Bean Serialization” • many serialization frameworks follow this approach • good match when you need to expose public API via serialization - A totally separate code, file, or annotation defines serial form • you have to write it in addition to your class • more work, but the approach is the most flexible and pays of in case of highly heterogeneous system (many platforms/languages)
  • 24. In practice • It really matters when very verbose text formats like XML are used in a combination with not-so-fast serializer implementations • Most binary formats are fast and compact enough, so that they do not constitute a bottleneck in the system - Data is usually expensive to acquire (compute, fetch from db, etc) - Otherwise (if data is in cache) and the only action of the system is to retrieve it from cache and send, then cache serialized data in binary form, thus making serialization performance irrelevant aka “marshalled object”
  • 25. Popular myth #4 © Stack Overflow authors, emphasis is mine
  • 26. A popular way to benchmark serialization https://github.com/eishay/jvm-serializers/blob/master/tpc/src/serializers/JavaBuiltIn.java
  • 27. The real fact about serialization performance • ObjectOutputStream/ObjectInputStream are expensive to create - >1KB of internal buffers allocated - It matters if you really do a lot of serialization • You can reuse OOS/OIS instances if you need - It is easy when you write a single stream of values • Just keep doing writeObject(!) • That is what it was designed for • The added benefit is that class descriptors are written just once - It is slightly tricky if you want to optimize it for one time writes • The actual gain is modest and depends on the kinds of objects you are serializing (their size, your heap/gc load, etc)
  • 28. The real fact about serialization performance (2) • Each ObjectOutputStream writes class descriptor on the first encounter - reset() clears internal handles table that keep both written objects (for object graph serialization) and written class descriptors • BEWARE: All written objects are retained until you call reset() • Writing class descriptor is a signification portion of both CPU time consumption and resulting space - That is the price you pay for all the automagic class evolution features without having to manually define field ids, create mappings, or write custom code - The data itself is relatively fast to write and has straightforward binary format (4 bytes per int, etc)
  • 29.
  • 30. Beware of benchmarks • A typical benchmark compares different serialization frameworks doing tasks of absolutely different complexity • With Java serialization facility you necessary pay for - No hassle object-to-serial format mapping • (no writing of interface descriptions, no code generation) - Support for wide range of class evolution scenarios - Support for object graph writes - Support for machines with different byte-endianness • Most significant performance/size improvements are gained by forfeiting one of these qualities - Be sure to understand what exactly you forfeit
  • 31. Real cons of Java serialization • Just one reset() to rule them all - No way to “resetObjects()” to clear all message-level object graph info (referenced objects), but keep session-level information (written class descriptors) to avoid repetition when keeping a network session to recipient open • Anyone knows ins-and-outs of JEP process to improve it? • Can use some performance improvement  - Some obviously unnecessary allocations of internal objects can be removed, code simplified, streamlined • I’m looking for help in “contributing to JDK” area - But do remember, that it rarely matters in practice
  • 32. Summary • Java serialization is there out-of-the box • It handles most Java-to-Java serialization needs well - While providing a wide range of goodies • It provides non-compact, but binary representation - It works especially good, if you have collections of repeated business objects • It covers a wide range of class evolution scenarios - Set serialVersionUID = 0 to be happy • It has decent performance that does not often show on profiler’s radar in practice • We use it in Devexperts for all our Java-to-Java non-market-data
  • 33. 46000 305400 Sent orders in one day Users on-line in one day We create professional financial software for Brokerage and Exchanges since 2002 99.99% Our software index of trouble-free operation 350 Peoples in our team 365 7 24 We support our products around-the-clock
  • 34. Headquarters 197110, 10/1 Barochnaya st. Saint Petersburg, Russia +7 812 438 16 26 mail@devexperts.com www.devexperts.com
  • 35. Contact me by email: elizarov at devexperts.com Read my blog: http://elizarov.livejournal.com/