2. About author
• Works in IT since 2000
• 10 year of Java SE/EE experience
• Occupied senior Java developer/Team Lead
positions
• Winner of 2013 JBoss Community Recognition
Award. https://www.jboss.org/jbcra
3. Software witchcraft
•
•
•
•
•
•
•
•
•
•
•
Software Development in a nutshell
Art of interview
Java under microscope
Magic of refactoring
Pattern-driven design
Java Developer Toolkit
Deconstructing Java
From novice to architect
Business and technical English
Business thinking and communication
Successful career in IT
9. Java serialization
• Your class should implement Serializable interface
• The easiest programming effort
• Out-of-the-box functionality
10. Java serialization
• Decreases the flexibility to change a class’s
implementation once it has been released
• Doesn’t allow to exchange data with C++/Python
applications
• Due to default constructors hole for invariant
corruption and illegal access
• No customization
• You should have access to the source code
11. Java externalization
• Serialization but by implementing Externalizable
interface to persist and restore the object
• Responsibility of the class to save and restore the
contents of its instances
• Requires modifications in marshalling/unmarshalling
code if the class contents changed
17. Simple
• High performance XML serialization and
configuration framework for Java.
• Requires absolutely no configuration
• Can handle cycles in the object graph
18. Simple
• High performance XML serialization and
configuration framework for Java.
• Requires absolutely no configuration
• Can handle cycles in the object graph
22. Json-io
• Doesn’t require custom interfaces/attributes
usage/source code
• Handles cyclic references
• Reader/writer customization
• Does not depend on any native or 3rd party
libraries.
23. Google gson
• A Java library to convert JSON to Java objects and
vice-versa
• Doesn’t require source code of serialized objects
• Allow custom representatives
26. BSON for Jackson
• Binary encoded JSON
• Main data exchange format for MongoDB
• Allows writing custom extensions
27. Protocol buffers
• Way of encoding structured data in an efficient yet
extensible format.
• Google uses Protocol Buffers for almost all of its
internal RPC protocols and file formats.
28. Protocol buffers
message User {
required string login = 1;
repeated Order orders = 2;
}
message Order {
required int32 id = 1;
optional string date = 2;
}
30. FST
• Focus on speed, size and compatibility
• Use case is high performance message oriented
software
• Drop-in replacement
• Custom optimization using annotations, custom
serializers
31. GridGain
• Part of distributed computing system
• Don’t require any custom interfaces or API
• Direct memory copying by invoking native "unsafe"
operations
• Predefined fields introspection
32. Kryo
• Fast and efficient object graph serialization
framework for Java
• Open source project on Google code
• Automatic deep and shallow copying/cloning
• Doesn’t put requirements on the source classes(in
most cases)
46. Advices
Framework
Usage
Kryo
When you need fast and compact serializer for complex
objects over network
Protocol buffers
When you need fast serializer for simple objects
Jackson(smile)
When you need Jackson-based serializer for Web usage
Google JSON
When you need dirty solution to quickly serialize/deserialize
objects
Apache Avro
When you need to serialize objects into files with possible
schema changes
Java
When you need out-of-the-box solution without additional
libraries