Graeme Rocher with DevOpsSpeakeasy at DevoxxMA 2022

October 4, 2022

< 1 min read

In this interview, we speak with Graeme Rocher @graemerocher who is the creator of several popular Open Source projects including Grails (https://grails.org) and Micronaut (https://Micronaut.io), about GraalVM Cloud Native & Micronaut what are the most important features and a little bit about the story of both projects.

Speakers

Melissa McKay

    Melissa McKay

    Melissa is a long-time developer/software engineer turned international speaker and is currently a Developer Advocate on the JFrog Developer relations team, sharing in the mission to improve the developer experience with DevOps methodologies. Her background and experience as a software engineer span a slew of languages, technologies, and tools used in the development and operation of enterprise products and services. She is a mom, Java Champion, Docker Captain, co-author of the upcoming book DevOps Tools for Java Developers, a huge fan of UNconferences, and is always on the lookout for ways to grow and learn. She has spoken at Kubecon, DockerCon, CodeOne, JFokus, Java Dev Day Mexico, the Great International Developer Summit, and is part of the JCrete and JAlba UNconference teams. Given her passion for teaching, sharing, and inspiring fellow practitioners, you are likely to cross paths with her in the conference circuit — both online and off!

    Video Transcript

    hello everybody I am Melissa McKay we’re

    getting ready to start another devops

    Speakeasy session here at devox Morocco

    and I am sitting here with graham Rocher

    hello would you like to introduce

    yourself to the audience thanks for

    having me yes Graham Russia I’m the uh

    architect Oracle Labs on Micronaut

    um and I work with the girl VM team as

    well so uh yeah I’ve been working on

    Oracle for a few years now and also

    created a couple of relatively

    well-known Frameworks in the Java World

    Grails before Micronaut yeah nice and

    worked in The Groovy community so yeah

    nice so Grails one of my first projects

    that I ever worked on was Ruby on Rails

    yeah way back when is girls inspired by

    that absolutely yes it was uh you know I

    was I looked at Ruby on Rails it was

    ages ago back in like 2006 and it was

    you know revolutionary at the time at

    the time

    um and probably still there there’s in a

    lot of ways and uh we had a lot of enemy

    in the Java world like why can’t we have

    this you know same coolness in on the in

    the Java ecosystem

    and you know I was doing projects with

    spring and hibernate and jabber and yeah

    so we’re both can’t deal with this and

    um but I was also doubling with groovy

    at the time for like some like online

    Generation

    Um of e-learning courses and so forth so

    I thought you know why can’t we use

    groovy to like have the same experience

    as Ruby on Rails but in Java

    um so I started rails and and yeah the

    rest is history I suppose it kind of got

    pretty popular

    um

    and uh you know a large community in in

    like in like between 2007 and 2015 kind

    of thing and it still has a large

    community

    and still is probably unrivaled when it

    comes to rapidly generating crud uis and

    so forth for databases so right yeah I

    love your perspective you have on that

    why can’t Java have this coolness and it

    absolutely can but it takes people like

    you in the community to produce that you

    know make that happen it’s not just

    magic this is something that the Java

    Community can work on this is something

    where we can all get together and decide

    what we want and this is what’s

    happening right now right with the jdk

    with getting you know new releases out

    there getting this release schedule

    going and making sure that we’re

    responding to what the community

    actually needs and as far as features

    and stuff in Java well

    another item that I want to talk with

    you about is based on your session that

    you had the first day here yeah I did a

    deep dive yes and would you just give us

    a quick summary and then I want to

    unpack it a little bit sure yeah I did a

    deep dive on Micronaut and growl the app

    so Micronaut is relatively new compared

    to Grails it’s like four years old but

    it’s a Java framework

    um that uses compilation time processing

    to optimize your application during the

    compile phase

    uh and that’s what I’ve been working on

    uh for the last four years and last you

    know at Oracle Labs that’s what I do on

    an everyday basis is work on Micronaut

    uh with that with the team there

    uh so uh and you know with the girl VM

    team and gravyam is a is a um virtual

    machine out of Oracle Labs that you know

    works with the regular jdk by plugging

    into the jet that also allows you to

    compile uh self self-contained native

    executables uh which which is you know

    proving very popular use case for a lot

    of folks especially on

    serverless command line apps that kind

    of thing yeah that makes sense so

    something I’ve heard in the past is you

    know why would you put Java out in the

    cloud that’s that’s goes territory

    that’s that’s other you know languages

    or other Technologies and um I think

    with crawl VM with Frameworks like

    Micronaut it makes it more feasible more

    possible and it just makes sense so well

    first of all there’s one thing to say

    about that is that you know uh people

    have been trying trying to say the Java

    is dead for years and as much as you

    people like to repeat it like it’s it’s

    just never gonna happen and jobber is

    already in the cloud right right Java

    Powers you just

    the vast majority of the cloud and

    they’re a massive job Java based

    companies out there that you know

    companies like LinkedIn and Twitter and

    all these massive companies that Netflix

    that run Java in the cloud and are based

    on So like

    um yeah go has had some uptake in Cloud

    applications especially with kubernetes

    being you know trendy whatever but

    ultimately jabber has a huge foothold in

    Cloud applications

    um having said that there’s definitely

    been a drive to optimize Java for

    running in containerized workloads

    especially on kubernetes for serverless

    right for Tech and that’s where a

    language like go can have the edge when

    it comes to like cold starts and keeping

    memory footprint low

    um

    um and uh gravity I’m native image has a

    great role to play there because you

    know it can convert a normal Java app

    using a closed level analysis into a

    native executable that run when it runs

    containerized right and uses very little

    memory is extremely fast to start up so

    you get all the benefits to go but you

    still get you know the massive mature

    Java ecosystem with its you know amazing

    IDE tooling that you don’t get in other

    languages whether it’s IntelliJ Visual

    Studio code eclipse or the mature build

    ecosystem around Gradle and Maven

    um you know jfrog with the artifactory

    ETC and you know all the security and

    maturity you know of the platform in the

    ecosystem is you can get to maintain

    that but you know just build your

    application into a neighbor native

    skeetable when you need it yeah

    and there’s really been a concerted

    effort over the last few years to make

    Java lighter and Micronaut has had a

    huge

    role to play in that you know more

    lightweight applications smaller run

    times moving more logic into the

    compiler you know because originally

    most Java Frameworks and you know

    traditional Technologies

    were built for that time when we used to

    run Java applications inside servlet

    containers or you know the cloud AE

    containers right

    um

    so when you have to um

    now optimize instead of deploying Wall

    Files and jar files we have to deploy

    Docker containers you know exactly

    language in the platform has to adapt a

    bit and it’s doing that yeah and I think

    we’re doing an excellent job of that I I

    loved your presentation on Micronaut

    let’s talk about that a little bit more

    sure

    um one of the items in there that you

    expounded on quite a bit is reflection

    and how Micronaut deals with reflection

    can you talk to the audience a little

    bit about that yeah sure so you know I

    spent a lot of time

    in the 2010s looking at

    how we could optimize

    the startup performance of Grails and

    spring applications

    and you know whenever I was deep in with

    my head in the profiler and the memory

    profiler and you know analyzing

    workloads it always came down to the

    bottleneck being you know just reading

    all the reflection information

    um because if when used at scale it can

    you know take a lot of time and memory

    to load all the reflection data into

    memory

    um

    and it’s one of the reasons why you know

    uh when Java is used in Android contacts

    they you know none of the Frameworks for

    Android allow or you know

    the use of reflection because it’s

    um it’s inefficient from a memory usage

    perspective because it essentially

    initializes reflective data for the an

    entire class so if you have a if you

    have a class that has 100 methods and 50

    fields you get 100 references to those

    methods and 50 references to those

    fields exactly which are not garbage

    collected until you know the

    um Technologies they’re held in software

    references and so until the application

    is actually running out of memory which

    is not ideal with so with micro note we

    shifted that to

    compile what we you know essentially

    method handles and handles to fields and

    so forth

    um at compilation time and we maintain

    you know only the methods that we need

    to invoke from the framework

    um and that that keeps memory

    consumption lower because we never have

    to touch the reflective information

    um that makes sense and then that

    includes you know competing All The

    annotation information that build time

    and and so we don’t have to test the

    annotations we never have to initialize

    the actual reflective data

    um which is which is really useful in

    keeping memory low

    um and keeping the runtime small yeah so

    we don’t we don’t need all this

    infrastructure at runtime to do the

    analysis at runtime all of that analysis

    happens in the compiler interesting

    um so when you build like an application

    itself it’s actually you know smaller

    right

    um and you can see that with

    you know some of our Solutions you know

    so an example of that is Micronaut

    serialization

    which lets you serialize and deserialize

    Json to and from java objects you know

    and it supports like 90 of what

    capabilities of Jackson data bind okay

    um but Jackson is like 2.4 megabyte jar

    file right it’s massive because at

    runtime because it has so much

    um infrastructure in place to

    uh you know use reflection to Cache the

    reflective data to analyze your classes

    and it needs all this runtime weight uh

    whilst microphone sterilization is like

    300 kilobytes right

    um which which you you thought

    developers often don’t think about that

    jar file sizes but then when you

    transfer translate that into a native

    image with a group called VM uh it’s

    actually a five megabyte reduction in

    the size of the Native executable right

    wow

    um so if you’re going crazy

    um you know you’re shrinking your images

    which is which is good yeah and this is

    good because

    in yeah I think we assume

    maybe everyone understands why this

    makes a difference and it’s it makes a

    big difference in Cloud native

    environments just because you know

    startup time yes

    costs yeah if your containers are coming

    up and down

    um a lot so you need to scale

    um you know down to zero or scale down

    to one or you know you’re using Auto

    auto scaling in the cloud you want those

    instances to come up as as quickly as

    possible and if you think about it as

    well as if you have a a cluster of

    containerized applications if if you

    spin up 10 of them right and

    um each container requires 500 megabyte

    of memory right that’s a lot of memory

    that’s being used for 10 instances right

    first if you’re using uh Native Native

    image you know each running instance is

    only occupying like 50 megabytes right

    so you can you can actually scale out

    more applications in parallel right wow

    so it’s about scaling up and scaling

    down within containerized workloads and

    um and then also optimizing for the

    architecture that you’re building for

    yeah

    so just like Grails got the coolness of

    Ruby on Rails in Java we now have Cloud

    native coolness for Java as well I love

    seeing that there’s a lot of movement

    here there’s a lot of improvement like

    you said it is not dead this is a

    language that’s going to continue to

    grow and continue to adapt as our needs

    change so I’m just curious what is your

    background originally what’s the first

    language you learned

    wow well

    I got it I uh

    um I guess I don’t know probably many

    people uh through the gaming industry so

    I love you know video games the fun way

    yeah video games and as a kid I love the

    game so you know

    um and you know I played uh

    in the 90s I was playing games like doom

    and

    Wolfenstein and and Quake and that that

    is actually what got me into programming

    because

    um I the actually the first language I

    Learned was that was uh probably not the

    easiest language to learn first but it

    was a variant on on C called Quake C so

    Quake the game had a variant of the C

    language called Quake C and I was like

    yeah I really want to make these

    explosions bigger or all right all right

    I I really want you know the Rockers to

    fire like you know not in a straight

    line but like this so I started getting

    into programming modifications for games

    and this is you know when I was like 15.

    more or less nice and that’s what

    actually got me into programming so you

    know um probably a healthy way to get

    into programming and you know I love it

    I think that’s an awesome story yeah as

    a kid when you when you get a kid into

    programming it’s like you need a

    uh you you need some effort reward like

    why am I doing this right what is the

    aim of you know what writing this piece

    of code what’s going to happen right

    yeah so it was fun like um and actually

    you ended up starting a website which

    you can still find if you go to the way

    out Wayback machine internet history

    thing

    um if you do I think it was converted to

    converted in the number two.com and it

    was a website in the late 90s about

    writing game modifications nice

    tutorials and stuff like that and that’s

    how I started getting into actually

    website design and learned HTML

    JavaScript and all that kind of stuff

    because

    um it was like okay now we know how to

    make these modifications we need to get

    this information out there and like

    people learn about it and share create a

    community and it’s not that different

    from open source right right building a

    community of and you know that’s how I

    started I really loved that um

    interacting with with other people and

    getting feedback and and I think that uh

    with working on open source is kind of a

    similar thing to that there but yeah I

    think you hit on something really

    important because I’m very similar uh in

    order for me to really learn something

    and get in deep with it I need a purpose

    I need something I’m doing something I

    care about and I think

    um

    I know like I do a lot of kids workshops

    and

    um

    I know I see that like if there’s an end

    result if there’s something that the

    that they’re working toward they’re more

    apt to get there right absolutely I mean

    it’s one thing to sit in a classroom and

    learn how to do a for Loop right that’s

    so exciting I think that’s why I think

    it’s like Minecraft are fantastic you

    know because you you know kids can

    see the reason for you know writing a

    few

    a script or you know learning Java to

    you know program Minecraft mods or you

    know that kind of thing right

    um

    so uh yeah I think when there is a

    purpose

    um and you know games are a great way to

    to kind of get an entry into

    why you would program and then you

    realize there’s so many more ways to be

    creative in you know in our industry

    right there’s like lots of ways to be

    creative and the programming is such a

    creative activity you know people think

    about programmers just like oh you know

    fighting away in a keyboard but it’s

    it’s really creative and um and a

    rewarding you know activity to for

    example with like things like Frank

    Northern Grails to

    um design apis like that other

    developers are going to consume you know

    that’s a creative Endeavor itself I

    think there’s a lot of

    um

    I don’t know uh Artistry to designing a

    good API you know and thinking about how

    an API is works and yeah well and um

    that’s a lot that’s a lot of fun

    um

    and

    um yeah but I you know I also think that

    as developers we need to unders also

    think about how

    other developers come to our products

    you know so like working in open source

    you realize you know you need good

    documentation you need to write guides

    you need to compete you need to be a

    good writer you need to be a good you

    know it’s not just programming right

    exactly you often need to for technology

    to be successful you probably need to

    you know end up writing books about it

    and so you know so you end up learning

    all sorts of skills because you know

    just to public speaking Yeah yeah

    exactly so which I was I was terrified

    of the first time I spoke oh in public

    so yeah I can relate to you for sure

    um I think I did my first one was Java

    one in 2008. you know I was wow

    terrified

    that’s a big crowd too like that yeah

    yeah but you uh you adapt and you learn

    and you have fun you have fun with it

    well and here we are years later at

    devox Morocco yeah and I got the

    privilege of going to your session it

    was great I think a lot of people in

    there learned a lot about micro knot and

    gravian this is definitely something I’m

    gonna go play with more I’m my

    background is a lot of spring boots so

    I’m curious about that one of the the

    purposes of Micronaut was a uh to build

    a better Spring right so um it’s a small

    Arena spring that has compile time

    checking and and a better development

    experience for starting faster and so

    forth so it has a lot taken a lot of

    inspiration from spring so if you if you

    from an API design perspective

    um so if you uh if you’re used to if

    you’re a Sprint developer and you’re

    used to Spring Market is pretty

    comfortable right awesome

    well we used a lot of keywords here

    today girl VM Micronaut spring Java of

    course

    Grails Ruby on Rails if you really yeah

    interested in the inspiration if there’s

    one resource that you’d like to leave

    our audience with for something new for

    them to go out and play with what would

    it be well if you’re looking to learn

    Micronaut or try out Micronaut for the

    first time I would go to

    guides.micronaut.io okay it is we have

    so many guides you know from creating a

    basic app and then compiling it into a

    native image throughout the um two

    guides on you know integrating with

    cloud services and databases and you

    know from basically beginner’s material

    to and the cool thing about the guys is

    each one of them comes with sample code

    so you’re not like you can download the

    app the sample app check out how it

    works you know regardless uh of the your

    build system preference so they have we

    have great little even guides we we have

    guides for also Java kotlin and groovy

    so even if you like kotlin you’ve got

    guys for Scotland users as well uh

    groovy as well so cool there’s your

    language preference great well I’m

    certainly going to go check those out

    um thank you Graham for interviewing

    with us today and uh we’ll cross paths

    again I’m sure at a future conference

    yes thank you very much for the

    interview thank you thanks