Today, you’ll find a number of items that you should take the time to read through. Are app rewrites a bad idea? How can you be secure in the cloud? Why is there a big fork in the Linux world? When is autoscaling bad? Check out more below.
[article] You can’t stop the business, or why rewrites fail. Rewrites are tricky, build a new-next-to-old is tricky, and modernization piece by piece is tricky. Basically, anyone promising an easy solution is making things up!
[blog] Buffer workflow executions with a Cloud Tasks queue. Buffering is a key strategy for modernization when you might be introducing load that existing components can’t handle. Cloud Tasks is a pretty cool solution for protecting apps from HTTP surges.
[article] Downsides to using cloud autoscaling systems. Autoscaling is a primary reason to use cloud in the first place, but you can get in trouble if you don’t know the triggers or caps.
##
Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below:
Happy Monday to you. Dig in below for a handful of thought-provoking content pieces that I discovered today.
[site] Go Frequently Asked Questions. The Go documentation has an outstanding FAQ page for learning about Go, or getting insight into advanced topics. Some quick Googling only uncovered one other language that has something similar, and that’s Python.
[article] The three kinds of leverage that anchor effective strategies. Interesting post that emphasizes the need to focus on (differentiated) strengths versus trying fix your weaknesses. I agree, as long as you’re self-aware enough to know your personal/company weaknesses and the “right” way to ignore them.
[article] Red Hat kicked off a tempest in a teapot. Matt’s takeaway here is that Red Hat competition won’t come from other Linux vendors; it’ll come from cloud providers making Linux trusted and invisible.
[blog] Product Risk Taxonomies. What type of risks should you consider when trying to figure out if a solution is worth building? This post calls out four big ones that matter most.
[guide] Authentication at Google. Here’s a new reference guide and flowchart for picking the right authentication approach for your app.
Do you have a nice weekend planned? Take some time away from screens and do something unplanned. Before then, scan through some good items I read today.
[blog] When customers are “willing” to pay. As you’re pricing your product and planning for long term growth, how should approach it? I learned some things from this post.
[blog] Keeping up with big shifts in tech. Here’s a panel-style blog post with experienced developers who have seen paradigm changes in the past, and offer advice on how to handle each new wave.
[blog] Custom Environment Variables in Workflows. If you’re building long-running processes, you’re probably using a workflow engine. This cloud option is a good one, and this new feature is useful.
[blog] Testing Kafka Applications with Testcontainers. These folks have been publishing great blog posts lately. Here’s an example of Java unit tests and fire up an ephemeral Kafka instance.
[blog] Kindness Ratio. What’s your praise-to-criticism ratio? One sided towards the negative? That sometimes explains why someone has challenging relationships at work or home. Good reminder here.
[article] Microservices Security in a Nutshell. You’ll find a comprehensive list of dimensions to consider when planning out your security approach.
Today I read many items that made me go “hmmm” in a good way. Check out a handful of written pieces on cloud, security, and more.
[blog] Five Nos. Someone who gets a lot of “yeses” likely also gets a lot of “nos.” They take chances. They ask for what they want and can handle rejection. Good post.
[blog] Google Cloud Interactive Tutorials Series — Week 6 : July 6 — July 12, 2023. Uniquely, Google Cloud offers product tutorials from within our cloud console. This blog series points out interesting ones each week, and this week’s offerings let you try CI/CD, serverless, and orchestration for free.
I had a good long weekend for the US Independence Day holiday, and now have 3 days to do 5 days of work! I read lots of good items today, and hope you find one or two that resonate with you.
[article] FinOps Gaining Ground, But Progress is Slow. It looks like a lot of companies are formally investing cost management for cloud, but the timeline for positive results seems too long.
[article] PlatformCon 2023: Bigger and Even Better. Is PlatformCon becoming one of the next great events in our industry? Maybe so. Terrific write up here of what we’re all learning about platform engineering.
[article] Getting started with Google’s PaLM API. This is a good step-by-step example of using a notebook to interact with our LLM to write a blog post for you.
##
Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below:
Today was a fairly quiet Friday before a long weekend here in the States. We’re off Monday and Tuesday, so I’ll be back Wednesday with a fresh reading list.
[blog] Navigating Complexity in Systems Architecture. Brian looks at whether you can avoid complexity (you can’t, really) and how to navigate the inherent complexity in a system and organization.
[blog] Java ecosystem trends report 2023. Conference talks tell you what’s hot, not necessarily what everyone is actually doing right now. This post analyzes four recent Java events to see what’s emerging in our industry.
[report] 2023 State of the API Report. New from Postman, this survey shows what people are doing now with APIs and where APIs are going.
Kubernetes and machine learning content today. That’s my life now. You’ll also find some other great stuff in the mix.
[blog] No Time To Lead? Then Be Prepared To Fail. This is an important perspective, and definitely a major risk with the player/coach model. If you’re not investing in leadership activities, you’re hurting the team.
[blog] GKE Security Posture dashboard now generally available with enhanced features. Do you have a good handle on the security risks and applicable security bulletins for your Kubernetes clusters? If yes, then you’re very special. If not, you might like that GKE now turns this new service on by default, for free.
[blog] Running Wasm in a container. My colleague Mete has been digging into Web Assembly, and this is his next post. It’ll be interesting to see if folks combine containers and Wasm in the real world.
I took most of yesterday off to go to the San Diego Zoo with my visiting niece, but I’m back here today and read a lot of useful items. You’re seeing a real-time re-configuration of many mature ecosystems—including low-code and data analytics—to account for this new AI-crazy world. Find some related pieces below, along with much more.
[blog] 10 principles for your event driven architecture. I don’t think I’ve seen advice like this in one place. This post offers some useful principles for those relying more on messaging and async communication.
[blog] Meta developer tools: Working at scale. What do developers at Meta use to write code, build software, and then deploy it? This short post highlights the key tools.
[blog] Thoughts on event sourcing: Replaying events. It’s useful to be able to re-process failed messages in your event driven architecture, but there can be side effects of sending data through again.
[youtube-video] Building Projects. This is a terrific series of videos that shows off building the same sort of REST API in a variety of tech stacks. It’s a great way to get a look at different platforms like Go, JavaScript, Python. .NET, Java, and more.
The world is a better place now that no one pays me to write code. You’re welcome. But I still try to code on a regular basis, and there are a handful of activities I don’t particularly enjoy doing. Most of these relate to the fact that I’m not coding every day, and thus have to waste a lot of time looking up information I’ve forgotten. I’m not alone; the latest StackOverflow developer survey showed that most of us are spending 30 or more minutes a day searching online for answers.
Generative AI may solve those problems. Whether we’re talking AI-assisted development environments—think GitHub Copilot, Tabnine, Replit, or our upcoming Duet AI for Google Cloud—or chat-based solutions, we now have tools to save us from all the endless lookups for answers.
Google Bard has gotten good at coding-related activities, and I wanted to see if it could address some of my least-favorite developer activities. I won’t do anything fancy (e.g. multi-shot prompts, super sophisticated prompts) but will try and write smart prompts that give me back great results on the first try. Once I learn to write better prompts, the results will likely be even better!
#1 – Generate SQL commands
Virtually any app you build accesses a database. I’ve never been great at writing SQL commands, and end up pulling up a reference when I have to craft a JOIN or even a big INSERT statement. Stop judging me.
Here’s my prompt:
I’m a Go developer. Give me a SQL statement that inserts three records into a database named Users. There are columns for userid, username, age, and signupdate.
The result?
What if I want another SQL statement that joins the table with another and counts up the records in the related table? I was impressed that Bard could figure it out based on this subsequent prompt:
How about a join statement between that table and another table called LoginAttempts that has columns for userid, timestamp, and outcome where we want a count of loginattempts per user.
The result? A good SQL statement that seems correct to me. I love that it also gave me an example resultset to consider.
I definitely plan on using Bard for help me with SQL queries from now on.
#2 – Create entity definitions or DTOs
For anything but the simplest apps, I find myself creating classes to represent the objects used by my app. This isn’t hard work, but it’s tedious at times. I’d rather not plow through a series of getters and setters for private member variables, or setup one or more constructors. Let’s see how Bard does.
My prompt:
I’m a Java developer using Spring Boot. Give me a class that defines an object named Employees with fields for employeeid, name, title, location, and managerid.
The result is a complete object, with a “copy” button (so I can paste this right into my IDE), and even source attribution for where the model found the code.
What if I wanted a second constructor that only takes in one parameter? Because the chat is ongoing and supports back-and-forth engagement, I could simply ask “Give me the same class, but with a second constructor that only takes in the employeeid” and get:
This is a time-saver, and I can easily start with this and edit as needed.
#3 – Bootstrap my frontend pages
I like using Bootstrap for my frontend layout, but I don’t use it often enough to remember how to configure it the way I want. Bard to the rescue!
I asked Bard for an HTML page that has a basic Bootstrap style. This is where it’s useful that Bard is internet-connected. It knows the latest version of Bootstrap, whereas other generative chat tools don’t have access to the most recent info.
My prompt is:
Write an HTML page that uses the latest version of Bootstrap to center a heading that says “Feedback Form.” Then include a form with inputs for “subject” and “message” to go with a submit button.
I get back valid HTML and an explanation of what it generated.
It looked right to me, but I wanted to make sure it wasn’t just a hallucination. I took that code, pasted it into a new HTML file, and opened it up. Yup, looks right.
I may not use tools like Bard to generate an entirely complex app, but scaffolding the base of something like a web page is a big time-saver.
#4 – Create declarative definitions for things like Kubernetes deployment YAML
I have a mental block on remembering the exact structure of configuration files. Maybe I should see a doctor. I can read them fine, but I never remember how to write most of them myself. But in the meantime, I’m stoked that generative AI can make it easier to pump out Kubernetes deployment and service YAML, Dockerfiles, Terraform scripts, and most anything else.
Let’s say I want some Kubernetes YAML in my life. I provided this prompt:
Give me Kubernetes deployment and service YAML that deploys two replicas and exposes an HTTP endpoint
What I got back was a valid pile of YAML.
And I do like the results also explain a bit about what’s going. on here, including the actual command to apply these YAML files to a cluster.
Dockerfiles still intimidate me for some reason. I like the idea of describing what I need, and having Bard give me a starter Dockerfile to work with. Full disclosure, I tried getting Bard to generate a valid Dockerfile for a few of my sample GitHub repos, and I couldn’t get a good one.
But this prompt works well:
Show me a Dockerfile for a Go application that has the main Go file in a cmd folder, but also uses other folders named web and config.
The result is a Dockerfile, and it’s well explained in the accompanying text.
Bard also seems pretty good at giving me Terraform, Java property file configurations, and more. As always, verify the results!
#5 – Create sample data
I build a lot of sample apps, which means I need sample data. That might mean input into a REST endpoint, or it could be data for a starter database. Instead of struggling to produce a bunch of fake records, generative AI solutions can give me all the structured data I need.
In the SQL section above, I generated a SQL insert command that I could use for a database. But I can also generate some seed data for my app.
For instance, how about this prompt:
Generate a JavaScript variable holding a JSON array of five baseball players. Pull names from the baseball Hall of Fame. Each record should have an id, name, position, and age.
I get back valid JSON that I could drop in my Node.js app.
I can then ask Bard to convert that to XML, CSV, or any number of formats. I might want more records or fewer records. This also works if you ask for your favorite television characters, musicians from the 1990s, or types of potatoes. Generate data without taxing your brain.
#6 – Explain code I come across in GitHub, blog posts, or StackOverflow
Do you ever find some interesting code in a blog post or StackOverflow answer but can’t exactly figure out how it works? Happens to me all the time. Instead of going further down the rabbit hole to figure out what each line of code does, I can use generative AI to make some sense of it all.
What does this code do? Explain it to me as if I’m new to C#. public string RandomDigits(int length) { var random = new Random(); string s = string.Empty; for (int i = 0; i < length; i++) s = String.Concat(s, random.Next(10).ToString()); return s; }
What I get back is a written description of each line. And then, helpfully, a restating of the code with comments added before each statement.
If you’re learning a new language, consider using generative AI to explain code snippets to you. I acknowledge that I’ve had mixed luck pointing Bard at a code file or repo and getting a perfect explanation. I sometimes get hallucinations (e.g. refer to files to methods that don’t exist), but I expect this functionality to get better quickly.
#7 – Convert code from one language (or version) to another
Do you ever come across code that shows a useful pattern, but isn’t in the language you’re coding in? Maybe I found that code above to generate a random number, but want the equivalent in Go. Not a big problem any more. A prompt following the above prompt:
Convert this C# code to Go code instead
I get back Go code, and a description of what’s different.
Consider the case where you find code for calling a particular HTTP endpoint, but it’s in Java and your app is written in Go. My colleague Guillaume just wrote up a great post about calling our new Google PaLM LLM API via a Java app. I can ask for all the code in the post to be converted to Go.
That’s pretty cool. I wasn’t sure that was going to work.
With all of these examples, it’s still important to verify the results. Generative AI doesn’t absolve you of responsibility as a developer; but it can give you a tremendous head start and save you from wasting tons of time navigating from source to source for answers.
Any other development activities that you’d like generative AI to assist you with?