I’ve officially attended my first developer conference. Although I didn’t get to snag one of the cool t-shirts modelled by the Oracle employees at the event, I came away having had a good experience, a sharpened mind and a few stickers to slap on my laptop.
The day started at 8am and ended at 8pm. Whilst there were around 30 elements to the schedule, I hadn’t mastered the art of omnipresence yet so I had to select a number of presentations to attend.
My interest in technology spans far and wide. However, my work is currently in the microservices space, so I chose to focus on that area where I could.
High Performance Managed Languages
I’m not a developer in my current role but my skill-set is development derived and I have a particular place in my heart that yearns to achieve high levels of performance in anything I build (where the time constraints allow).
Fortunately, I made it to London in time to attend this presentation, given by Martin Thompson. He explained that there are many cases where, even with his knowledge of native languages like C/C++ and Assembly, he’d choose to use a managed language like Java to achieve low latency at runtime.
He argued that because of the runtime analysis you can perform in a managed language (thanks to JIT compilation), it’s more time efficient to achieve performant code in contrast to achieving highly performant code in a language like C.
“Sometimes, time to performance is the better option to all out performance” - Martin Thompson
In an attempt to keep this post from becoming too monolithic, the quick and easy point made around code optimisation was:
- Keep your code as sequential as possible.
- Branch at the last possible moment.
- Inline methods/functions that have few dependants. (Sometimes, code duplication = better performance)
This stops the program jumping from code block to code block during runtime. Simple but effective. He also mentioned using intrinsics for methods that contain large amounts of looping. I’d never heard of intrinsic functions before then and I will certainly be doing more research on them.
Martin went on to discuss generational and depth-first garbage collection. I assumed that the standard garbage collection in Java was as good as it gets (as I thought it was the only option) - turns out that there are many options available, such as Azul Zing.
His last slide highlighted some areas of focus for high performance code:
- Codecs (avoid text-based)
- Data Structures
- Mechanical Sympathy
I enjoyed watching Martin discuss optimisation and how it reflects in the code’s execution by a CPU. I left his talk with wide eyes and an itch in my brain to explore this subject further.
Honey, I Shrunk the Container
Ewan Slater started his presentation by illustrating how the industry is moving away from monolithic software and servers, towards microservices and containerisation in the pursuit of agility and maintenance simplicity.
He went on to discuss the concept of micro-containers - containers that encapsulate the bare-minimum dependencies required to run a contanerised application.
Docker has had a multi-stage build feature as of version 17.05 and docker builds can make use of the
--squash flag to collapse all of the filesystem layers produced by a build into a single layer.
An intriguing alternative to this was shown by Ewan and he demonstrated its effectiveness at reducing docker image sizes dramatically. Using this tool, the httpd image was reduced from its ‘full-fat’ size of 177Mb down to a mere 4.62Mb. This was one example of many but it’s the only one I had time to write down due to my poor ability to swiftly write words on paper.
The benefits of using this alternative for building microcontainers are:
- Small in size (obviously)
- Defend against privilege escalation (by removal of the linux user space)
- Better vulnerability management (less out-of-date dependencies = less attack space)
This alternative tool is an open source project, developed by a collection of clever people at Oracle (including Ewan), called Smith. I would definitely recommend checking it out.
Building Real-Time Data in Web Applications With Node.js
This talk, presented by Dan McGhan, started with a demo. The demo showed a voting application on screen and as attendees used the voting buttons on their phones, the voting counts on-screen increased.
I have never done any real-time work in the browser and was intrigued by how he had achieved this. Dan confirmed my suspicions that there was no AJAX involved - AJAX is pretty old and requires constant polling for new information from a database.
Whilst WebRTC and it’s suitability for streaming media was presented, Dan revealed that WebSockets currently has greater web browser support and it was this technology that his demo was based upon. He basically described WebSockets as a protocol which enables real-time communication between a service and a web browser by standardising a way for the web service to inform the browser of data updates.
Dan then went on to showcase SocketIO, which uses WebSockets as a transport where possible and eleviates browser support issues, reverting to AJAX long polling where absolutely necessary.
An interesting slice of knowledge which caught me was that the Oracle Database has a feature called Continuous Query Notification, allowing applications to register for Object Change Notifications or Query Result Change Notifications. You can learn a little more about it here. I didn’t know about this feature and apparently it’s been part of Oracle’s Database for some time!
Building Event-Driven (Micro)Services with Apache Kafka
Oracle Ace Director Guido Schmutz told of the history of moving from traditional applications, through to SOA, to the use of a Service Bus, and finally to microservices - describing them as SOA done right.
The Asynchronous approach to service interaction we all know and love was described before Guido went on to suggest the use of streaming data sources and events. Essentially, events are published to a queue and subscribed to by other services.
This requires a different way of thinking when approaching integration because instead of a service saying “Hey, I need this info from you!” to another service and that service responding directly once it has done it’s work or even asked for data from other services, a service would just publish an event saying “Hey guys! So, this thing just happened…” and then all the services that are subscribed to that particular event would reactively jump into action.
Guido likened this interaction to one of a kitchen in a restaurant - where each cook has their station (for frying steak, or tossing salad for example) and a new order comes in via a slip a waiter has pinned to the counter. The person frying steak looks at the slip and works out that they need to fry steak like a machine for the next 20 minutes, whilst the salad tosser looks at the slip and works out that they’ve tossed enough salad and it’s time to move onto bigger things.
While I don’t think I remembered the metaphor word for word, the counter is the event queue (with the slips being events) and the cooks each represent a microservice.
Note that microservices don’t have the option to ‘move onto bigger things’ like our salad specialist does. Microservices are supposed to serve a single purpose and damn well enjoy it!
The presentation continued by showing some well crafted architectural diagrams, illustrating how this streaming approach can be applied to different types of analytics, change data capture and legacy applications. Unfortunately, there wasn’t enough time available for a live demo but the climax of the talk represented how Apache Kafka could be used as a central hub for facilitating all of these requirements (beyond being a simple event broker/store).
Microservices in a Monolith World
My colleague, Phil Wilkins, another Oracle Ace Director showcased a methodology for moving a client’s monolithic software to a microservice architecture.
After describing the ‘what and why’ of microservices, he laid out a plan of action using an application using a single database, a WebLogic application server and a single application as an example.
Without going into so much detail that I’d render Phil’s future talks on the subject redundant, the outline of his plan involves:
- Breaking down the application into individual areas of functionality and hosting them on the single application server.
- Removing the application server and replacing it with a containerisation solution (Docker/Kubernetes).
- Splitting up the database to match the data with the functionality of each microservices and implementing into the relevant containers, making each microservices truly single purpose.
It was certainly an insightful presentation and it represents a story that’s faced by so many companies right now. If you get the opportunity to see this presentation, I’d recommend you take it.
Democratising Serverless: The Fn Project
Unfortunately, due to my intended train time home, I was unable to attend this talk. However the project presented here is something I’ve been following since it’s conception and it’s a little bit special.
The Fn Project allows you to deploy an open source, polyglot serverless platform anywhere you can run a docker container. Forget about AWS and Google, now you can roll your own!
I had an awesome day, even if it was fuelled by no more than 4 hours sleep and ended with train delays.
I enjoyed drinking beer, brewed to perfection by the power of IoT devices and big data. I also met Pepper the robot, who took a pic of me to share on twitter - I agreed to this not knowing it was going to shame me by giving away my diabolical score on the quiz it gave me. I made her dance as a punishment.
Hopefully, I’ll be able to attend next year and get my hands on one of those t-shirts I spent too long eyeing up.