What is Elastic Compute? - Sorry, Functions

What is Elastic Compute? – Sorry Functions!

Here’s a quick blog from one of our Technical Architects at Cloud Galacticos, Mike Gill. He was interested to see that Salesforce Functions is now generally available. Here’s his initial thoughts:

 

Mike Gill

Mike Gill

What is Elastic Compute? – Sorry, Functions!

A couple of years ago, our COO Paul wrote one of our most popular blogs ever on Salesforce Evergreen after it was announced at Dreamforce 2019 calling it a game-changer for Salesforce developers. A little over 2 years have passed since then and Evergreen has now finally become Generally Available and has a new name – Salesforce Functions. But what are “Functions”? Elastic Compute; sometimes called Serverless, or now simply put “Functions” is Salesforce’s answer to services already provided by other major cloud providers.

It’s little more than that. It has been talked about for ages; why can’t Apex be more like Java? Well now you can now use proper Java in Salesforce!! And if you have been expanding your Node.js skills like I have, you now have the ability to build out solutions leveraging the wealth of Node.js npm libraries out there.

 

What are the benefits of Functions?

Whilst you have been able to integrate with Salesforce using other languages for a long time, the big difference here is that with Functions all your code runs within the “Salesforce trust boundary.” This means all of your permissions and security are handled for you. Also, it doesn’t even count against your Salesforce request limits!

 

Get involved

Why not start playing around with it today? The keys to the kingdom are now unlocked!

 

Why not sign up?

If something is too good to be true, then it probably is! We’ve heard this before with Salesforce… Well, not this time if seeing is believing.  Functions have landed and you can start your New Year off with an exciting new tool!

Sign up here and try it out  https://functions.salesforce.com/signups

 

About Cloud Galacticos

Cloud Galacticos is a  Salesforce Consulting Partner with an all-star team. We are user and developer group leaders, bloggers, MVPs and all round Salesforce nerds. Our Salesforce consultancy has people all over the UK including Manchester, Leeds, Newcastle, Sheffield, and London. If you are looking for a Salesforce partner with experience who can help you make the most of your org, why not give us a call?

fallbackcg

Salesforce Developer Podcast – Weird Apex and Being Inquisitive

Recently Josh Birk interviewed my for the Salesforce Developer Podcast on “Weird Apex”. You can find the full recording here. I’m going to share some additional thoughts about the background to the discussion and how the simple act of being inquisitive has lead me to some of the weird and wonderful things I discussed on the podcast.

 

Weird Apex Salesforce Developer Podcast

Image taken of https://developer.salesforce.com/podcast/2021/05/episode-82-weird-apex-with-paul-battisson.html

Love What You Do

When we meet clients for the first time, we tell them that at Cloud Galacticos we are 100% Salesforce nerds. We have team members who are MVPs, user and developer group leaders, and authors. We also have speakers, CTAs, and a number who tick multiple of these boxes. When hiring, one of the things we focus on is how much people enjoy working with the platform. I always ask “Why Salesforce?” Of course, sometimes working your way through a big set of profiles and permissions to figure out what the gaps are is not the most riveting work. I find that it is important to ensure I take time to do things I enjoy within my work to stay inquisitive.

A prime example of this is the VR setup I built with Vincent Reeder for a Dreamforce talk. Virtual Reality is cool and still fairly new tech, however it is not really enterprise friendly (as we discuss in the podcast). Still, Vincent and I took it as a technical challenge to see how we could get different pieces of the Salesforce Platform to play together to deliver something cool. Is this a completely practical exercise that we will reuse? No, but the learnings on how to use the different bits of technology will definitely help me in the future. It’s a much more fun way of learning.

 

Build a Career You’re Interested In

I’d highly encourage anyone who is looking to learn more about a particular topic to approach it in this way. By trying to keep this in mind I have built my career on Salesforce and have had a great time doing so. It has helped me learn enough to be able to write two books on Apex as well as given me the opportunity to speak at events all over the globe. I would recommend listening to other episodes of the Salesforce Developer Podcast. You will notice this is a common theme.

Salesforce Evergreen

Salesforce Evergreen

Last week was Salesforce’s annual Dreamforce conference in San Francisco. It’s when over 100,000 Salesforce fans descend upon the city to listen to the latest innovations from Salesforce. I was unable to attend this year, but followed along closely at home to the announcements. The one that stood out to me in particular was not Salesforce Blockchain, Einstein Voice or Customer 360 – it was the Salesforce Evergreen announcement. For me could be the real game changer.

 

The Impact of Serverless

To understand why, you have to perhaps take a step back. Look at how the rise of AWS and in particular, the AWS Lambda and the serverless paradigm has impacted development.

Take the following example – you want to upload an image in Salesforce against a case both before and after work is completed. These images should be stored off platform in Amazon S3. You want to have both the original and a thumbnail, with the thumbnail being displayed on the case. Whilst uploading the images to S3 could be done via Apex in Salesforce, the resizing must be done off platform currently. So how do we do this and where?

 

Heroku

We can either have an endpoint available on a platform like Heroku with a dyno running, or have a Lambda function that will run whenever called. That’s the key difference here, we have to have the Heroku dyno (at least 1) running to handle requests whereas with Lambda we are only paying per executed function. (Note this example is based upon a Lambda example from AWS you can read about here.) Whilst I am a big fan of Heroku, use cases like this lend themselves more to Lambda for running small jobs and repetitive functions where there is no need for a full web server framework to be setup, just receiving and processing some data from an event.

Such scenarios are becoming more common as organisations want to connect more pieces of their process seamlessly. This has driven a number of people towards using serverless based solutions to handle these simple problems – they just need the code to run and perform the action. Many organisations are also working to modularise their systems into more discrete functional blocks, often referred to as microservices. I’ve written before on Salesforce and Microservices and spoken on the topic previously at Dreamforce 2015 and Dreamforce 2017.

Previously, the conversation has always been how to make Salesforce interact nicely with serverless systems, or how to rearchitect parts of your existing Salesforce setup to operate in a more modular way. As soon as some more complicated processing was required (such as image resizing) you were forced off platform and had to decide which platform to use. How would you manage security and authentication? How could you invoke the new service – API via code or a Platform Event? You couldn’t think of doing all this on Salesforce – until now.

 

Enter Evergreen

Salesforce Evergreen is a new toolkit that will allow developers to write small functions and microservices using Apex, Java and Node.js which can be invoked natively from within Salesforce using both declarative and code based tools, as well as having native visibility to the platform – so no need to manage authentication.

Salesforce Evergreen Architecture

Taking our previous example, instead of a service running off platform, whether Heroku or AWS, we could now have a small set of functions that are called directly from the declarative tools in Salesforce. Whenever a case is closed. upload the images from Salesforce to S3, process these images and update the case. No additional infrastructure needed, no authentication required, all on a single platform.

This is truly game changing, by allowing developers to build these functions using existing languages in Java and Node.js, you are enabling the developer to utilise all of the existing ecosystem of functionality out there. For example, npm, the package ecosystem for Node.js, has somewhere in the region of a million packages, covering all types of functionality – csv parsing to providing random jokes. Almost all of these libraries become available for use alongside your existing Salesforce applications with all the plumbing and authentication done for you! You simply add in what you need, leveraging the existing tools and off you go.

Similarly, if you have an existing complex function in Java from an existing application, you can migrate that to become an Evergreen function and deploy it for use from within Salesforce! As wonderful a language as Apex is there are some things that it cannot do or that Java or Node.js will be a better tool for, now you can leverage these languages to do more with your Salesforce data.

 

Summary

The new Evergreen toolkit is going to make a huge difference to what is possible for Salesforce developers. It opens up exciting new possibilities which should lead to some incredible new solutions. I am already signed up for updates from Salesforce on the Developer Preview. And I will be looking ahead for different applications for this toolkit for our customers. If you want to read more, Salesforce have posted a blog here.