Author: Richard Seroter

  • Daily Reading List – July 24, 2024 (#362)

    Today’s reading list is full of pieces where I said “that’s interesting” after finishing. I imagine that you’ll say the same thing after a few of these.

    [article] Software Architecture in an AI World. Big post, but an important topic. I haven’t seen as much written on the impact of AI on software architecture practices.

    [blog] Mistral AI’s Codestral launches as a service, first on Vertex AI. This is an excellent new open model, and it’s available as-a-service on Vertex AI. I tried it out today and was impressed.

    [blog] Supply Chain Security Trifecta – SBOM, SLSA, Scorecard. This post will quickly help you understand these three important components of a secure software supply chain.

    [blog] Orchestrate Generative AI Applications. Can you coordinate a bunch of interacts with LLMs without ever writing a line of code? Yes, when you use no-code workflow engines like Cloud Workflows. I like this new integration with Vertex AI endpoints.

    [blog] Is AWS Lambda a Halo Product? Are serverless products just shiny services that get you in the door to then buy the steady and dependable cloud infrastructure services? It’s likely revisionist history to say that Lambda was never intended to “win” or make money, but this is still a great argument.

    [article] Research: How Passion Can Backfire at Work. What an interesting point of view! Do passionate people have an inflated sense of their importance, and act consistently over-confident?

    [blog] Even GenAI-Trained Execs Are Confused About It (Our Survey Shows) — So Give Them Better Training. Yikes. Lots of execs have taken AI training, yet fundamentally misunderstand key points about generative AI and what it’s (not) good for.

    [article] Is Vertical Slice Architecture better than Clean Architecture or Ports and Adapters? Derek takes another look at this architectural approach that focuses on features and capabilities, not independent layers of the stack.

    [article] Hugging Face Transformers: Leverage Open-Source AI in Python. Learn how to work with models using the Transformers library from Hugging Face.

    [blog] The Chronicles of Llama: The new Llama 405b on Vertex AI! it’s gotten easier to experiment with new tech. Use new models, new frameworks, and new cloud services without much setup.

    [blog] Let’s talk about Developer Experience: The Spectrum of DX. This is a neat way to think about developer experiences, and what you should be aiming for.

    Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below:

  • Daily Reading List – July 23, 2024 (#361)

    I like remote work as much as the next person, but I’ve been in at least two long-running group chats at work today that would have been “solved” in minutes if we were all sitting in a room together. Yes, video chats help, but nothing beats an intense, spontaneous collaboration of people in the same space.

    [report] State of Enterprise Tech 2024. There’s a lot here in a survey of enterprise tech leaders. Some of the AI investment findings were fascinating—why are so many folks fine-tuning models?—and answers on dev productivity reinforced other data I’ve seen.

    [blog] Meta’s Llama 3.1 is now available on Google Cloud. The latest and greatest model from Meta is out, and already available in your public cloud of choice. When you try it out in Vertex AI on Google Cloud, you get some nice features for tuning, agent building, and grounding.

    [blog] Profiling in Go: A Practical Guide. Go has a built-in profiler to collect CPU and memory usage that you can then study afterwards and use to optimize your app. Good walkthrough.

    [article] Top takeaways from the CrowdStrike outage for IT teams. There will be lots of posts like this in the coming days and weeks.

    [blog] The Factory metaphor makes sense for building applications, but not for deployment and operations. Brian thinks that referring to the delivery of software as an “assembly line” is a valid metaphor, but it breaks down when thinking of operations tasks. Agree? Disagree?

    [blog] The Cloud Run Security Gap You Didn’t Know You Had (and How to Fix It). Principles of least privilege need to be applied to your cloud services too. Make sure you know how to allow (or disallow) access, as JK shows here.

    [blog] Maestro: Netflix’s Workflow Orchestrator. Big post from the Netflix team about their open source product for managing “large scale workflows such as data pipelines.”

    [article] 3 Ways To Improve Your Container Build Process. It might not be the most interesting work, but tuning your container build process pays dividends down the road.

    [blog] How Airbnb Smoothly Upgrades React. Solid post about what it means to keep the frontend in a good state, and how the team at Airbnb does it.

    [article] Avoid These 3 Pitfalls When Giving a Sales Presentation. This is targeted at folks doing sales presentations, but this advice works for anyone “pitching” to an audience. It could apply to architects selling a new internal strategy, a proposal for a new product, etc.

    [blog] Running Google’s Gemma2 LLM locally with LangchainJS & Ollama. Good demo of using a mix of tools to build an AI app.

    [blog] Are We Ready for Multi-Image Reasoning? Launching VHs: The Visual Haystacks Benchmark! It’s one thing to find a “needle in a haystack” of textual content, but what about a large image set? The Berkeley AI Research team shares new ideas.

    Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below:

  • Daily Reading List – July 22, 2024 (#360)

    I was called for jury duty today, which meant I waited in a room with a couple hundred folks to see if I was needed for a trial. Alas, I wasn’t chosen. But I was able to do some reading while I waited!

    [blog] How to build user authentication into your gen AI app-accessing database. Your AI app augments it’s LLM input with info from a database? Cool. How do you control access and avoid giving sensitive data to the wrong person? This post offers up an access pattern.

    [blog] HTMX or React: What Should You Choose? If you’re getting lukewarm on frontend frameworks, you might like the the built-in dynamism of HTMX.

    [article] Hands On. I often wonder when I stop going on “hands on” with tech, and I think the answer is “never.” I find it rewarding to roll up my sleeves and use whatever I talk about.

    [blog] Developing domain expertise: get your hands dirty. Somewhat related to the above piece. It’s about going deep by studying, talking to others, and getting personally involved in the work.

    [blog] Modern SecOps Masterclass: Now Available on Coursera. Legit-looking course that spans six weeks and is platform-agnostic.

    [article] Survey Surfaces Troubling Signs of Software Supply Chain Insecurity. As often seems to be the case, execs are out of sync with what practitioners say is really happening within the org.

    [blog] Control LLM costs with context caching. Here’s a nice little example of the power of context caching for LLMs like Gemini that take in a long context.

    [article] State of Developer Experience 2024, This offers a deeper dive into some of the data I shared last week. See what developers care about.

    Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below:

  • Daily Reading List – July 19, 2024 (#359)

    I had a strong end to the week. Thanks to help from a teammate, I figured out my silly SQL error from yesterday and finished building demos for my upcoming keynote at Google IO Connect in China. I also started to dig out of my email hole, and still made time to read some informative items.

    [article] Major Windows BSOD issue hits banks, airlines, and TV broadcasters. Yikes, what a mess. Lots to read about on this, including a Forrester piece (CrowdStrike Global Outage: Critical Next Steps For Tech And Security Leaders) and a giant Reddit thread.

    [blog] Accelerating code migrations with AI. Here’s a detailed story of a new internal Google tool that helps our team generate and validate code changes for migration.

    [blog] Introducing Genkit for Go: Build scalable AI-powered apps in Go. Ok, this will convince me to give Genkit a try. Here’s another framework for building apps that use LLMs. Looks solid.

    [blog] The case for conferences in 2024. It might be easier to justify conference travel now than a few years ago (fewer health risks, more dynamic tech environment), but it’s still not easy. Forrest looks at how to make the case.

    [docs] Releasing code. How does Google open source its code? This documents our process for releasing any of our source code outside of Google. It might be useful to you if you’re crafting or updating your company’s OSS strategy.

    [blog] Story Points are Pointless, Measure Queues. If you have agile software teams, you might be familiar with estimation of work through “story points.” This post takes that apart.

    [article] Don’t blame AI for rise in carbon emissions, says Google exec. We shared data a couple weeks ago about our resource consumption, which most folks attributed to AI. Jeff says “not so fast.”

    [article] After a Decade of React, Is Frontend a Post-React World Now? There are few frameworks that seem to maintain their dominance for 10+ years. Good for React, and we’ll see if they can hold onto it!

    [blog] VMware Cloud Foundation on Google Cloud VMware Engine: 20% lower price and up to 40% in migration incentives. Cloud computing may indeed be cheaper than your data center. Especially if you depend on a hypervisor.

    [article] AI budgets poised to surge in 2025. Many folks will spend something on AI, but as this article rightly points out, a trained workforce and solid data foundation are a must-have.

    [article] Pair of Surveys Surface Primary Developer Productivity Challenges. Some good news and bad news in these surveys. There’s a lot of wasted time, but there’s also fresh investment in dev experience. Related piece in The New Stack (Why Do Developers Lose 1 Day a Week to Inefficiencies?).

    Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below:

  • Daily Reading List – July 18, 2024 (#358)

    I spent an hour today trying to get a SQL query to work. How was YOUR day? I’m sure it’s something silly, and at some point I’ll downgrade the conference demo to something simpler, but I can’t quit yet. Meanwhile, I also read some good items today.

    [article] Developer Experience in the Age of Generative AI. This video and transcript offers a panel’s perspective on wide set of topics. How does AI help developers? What are the pitfalls? What’s the future of developer experience?

    [blog] Don’t talk about non-functional requirements, talk about quality attributes. I need to be better about this too. Don’t call things like performance, maintainability, and performance “non functional requirements.” Quality attributes is a better term.

    [blog] Scaling Up Malware Analysis with Gemini 1.5 Flash. Can AI help with large-scale malware dissection by analyzing executables and libraries for malware? Here’s details of the attempt.

    [article] Over budget and under-performing: Department of Defense IT challenges in the spotlight. I’m sure this is a familiar story to a lot of you. A lot of spending on “keep the lights on” work, without even getting the benefits of strong performance metrics.

    [blog] How we built AlphaFold 3 to predict the structure and interaction of all of life’s molecules. Here’s a short peek at some details of how we trained this fascinating model that may have actual world-changing impact.

    [blog] Bringing cloud and AI capabilities to the tactical edge: Google Distributed Cloud air-gapped appliance is generally available. Use the public cloud wherever possible, but if you need a rugged, disconnected platform, this is a good option. News story here.

    [blog] Introducing the Coalition for Secure AI (CoSAI) and founding member organizations. A bunch of major players have joined us to invest in AI security practices.

    [blog] Is a Zero Temperature Deterministic? Karl wrote such an interesting piece about the temperature parameter of LLM requests. What impact does it have on creativity in response? Read to find out.

    Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below:

  • Daily Reading List – July 17, 2024 (#357)

    Do you ever get that dopamine hit when a meeting gets cancelled? I admit that I rarely feel upset when I see a cancellation come across. Today had a couple of cancelled meetings, which meant I was able to complete a few tasks unexpectedly. Win!

    [article] Google Open Sources 27B Parameter Gemma 2 Language Model. I read this InfoQ story about our latest open model release. Good summary.

    [article] Starting an Analytics Org From Scratch — Lessons From a Decade at DoorDash. What capabilities matter, when do you need what, and who should you hire? There’s useful advice here.

    [blog] Introducing GKE extended support: Stay on a GKE minor version for up to 24 months. There are many legit reasons why you can’t always be on the latest Kubernetes version—consider cases where commercial software doesn’t support the latest—so I’m glad we’re extending support.

    [blog] Docker Best Practices: Choosing Between RUN, CMD, and ENTRYPOINT. It’s a very specific topic, but also quite helpful for those building container images.

    [blog] Import and export Markdown in Google Docs. This is great. Import and export Docs as Markdown. For those writing tech docs or sharing content in a standard format, this is a big time saver.

    [article] “We’ll move slowly”: Wells Fargo CEO reveals bank’s cautious approach to Generative AI. Understandable, and I like how this executive points out the distinction between “traditional” AI and generative AI. There’s no single “AI strategy.” There are lots of layers and dimensions!

    [docs] When to use generative AI or traditional AI. Related to the above, I came across these docs today and thought it was a very helpful way to think about which AI is right for you.

    [article] Using long-token contexts to quality check an entire API doc set. Tom keeps exploring the intersection of technical writing and AI, and this piece digs into the use case for the long context window.

    [blog] 10 fun facts about emoji for World Emoji Day. Wow, World Emoji Day really snuck up on me this year. I didn’t have time to buy a new suit. Oh well, celebrate with new emojis and some fun insider info.

    [article] What do developers perceive as productive days? It wouldn’t surprise you to learn that developers feel most productive when they complete tasks without a lot of interruption or context switching.

    Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below:

  • Daily Reading List – July 16, 2024 (#356)

    Today’s reading list is once again full of lots of thought-provoking content and solid advice. Check out some good pieces on open source strategy, controlling LLM output, creating pull requests, and making software for a living.

    [blog] New Atlassian research on developer experience highlights a major disconnect between developers and leaders. These are good data points to have when trying to justify investment in dev experience. Many devs are losing time to inefficiencies, and devs place a high value in working at places with an investment in dev experience.

    [docs] Google models. We shipped a new page in our Cloud docs that explains our LLMs well, and, lets you click through to run them in Vertex AI even if you don’t have a Cloud account.

    [blog] The Post-Valkey World. Launch an open source project, reach scale, and relicense to something proprietary. This has been a popular playbook as of late, but Stephen wonders if the tide has turned.

    [article] Presti is using GenAI to replace costly furniture industry photo shoots. This is another case where you see how companies of all sizes can compete differently with AI at their disposal.

    [blog] Control LLM output with response type and schema. Mete helpfully walks through each step of getting incrementally more structured output from the LLM.

    [blog] Amazon GenAI Services. I saw a lot of hand-wringing last week from AWS customers/superfans after the AWS Summit. Maybe it was ok when other clouds focused heavily on AI, but not when AWS does it? Or, the concern could be that the AWS approach isn’t differentiated, and they’re clearly behind in mindshare? Either way, interesting.

    [article] Watch a robot navigate the Google DeepMind offices using Gemini. Fun, but informative, look at where large context helps this office-dwelling robot.

    [blog] In Praise of Small Pull Requests. A small pull request (or changelist, in Google terms) isn’t always possible, but should be the goal. That’s according to this short post from our Testing blog.

    [blog] The CEO’s Guide To Building Generative AI. Some optimistic and helpful guidance from the CEO at Forrester Research.

    [docs] Advanced load balancing overview. Some of the planet-scale, battle-tested load balancing algorithms used by Google itself are now available in the Cloud Service Mesh product.

    [blog] Lessons learned in 35 years of making software. Wonderful lessons here, especially for those that want to leave a positive mark behind.

    [blog] New Spanner geo-partitioning improves performance and lowers costs. Super cool. Partition your table’s data at the row level, but still get all the cohesion of a unified table.

    Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below:

  • Daily Reading List – July 15, 2024 (#355)

    Happy Monday! I had a productive weekend and also a lot of fun with the family. During some quiet time, I wrote up a blog post about using Apache Kafka in the cloud. That was the result of a dozen or so hours of experimentation during my vacation week.

    [article] What exactly is an AI agent? There’s not exactly consensus here, so this article explores how a handful of folks are defining it.

    [youtube-video] The software engineering industry in 2024: what changed in 2 years, why, and what is next. Here’s an excellent talk from Gergely on a wide range of topics including career progress in tech, choosing boring tech, and what to do with AI.

    [docs] Disaster recovery planning guide. How often are you exercising your DR plans? Be honest with me. Do you have DR plans that you trust? This is a great set of documentation for those properly planning for disasters.

    [article] Are You Done Yet? Mastering Long-Running Processes in Modern Architectures. I shared some pieces last week about long-running HTTP requests, and here’s more about design considerations for long-running processes.

    [blog] Text classification with Gemini and LangChain4j. This is a terrific look at text classification techniques with generative AI. All Java fans should be reading Guillaume if they aren’t already.

    [article] As CISOs grapple with the C-suite, job satisfaction takes a hit. There’s a lot of pressure on the top security folks, and their satisfaction seems connected to how well they can access and impact senior leaders.

    [blog] Cloud CISO Perspectives: How to think about security budgets. Phil offers fresh guidance for CISOs as they plan for budget requests.

    [article] Designing a Successful Reskilling Program. Are you planning or running a reskilling program right now? I thought this article had good guidance on metrics, bringing the team along, and providing the right air cover.

    [blog] Flexible committed-use discounts are now even more flexible. Smart tech leaders use whatever financial instruments they have at their disposal, and CUDs are an important one. I like that you can now use them across compute products in Google Cloud.

    [blog] GenAI or Die. Some blazing hot perspective, but I do think the underlying point is right. This time it’s different, and disruption is going to hit some harder than others.

    [blog] Safeguarding App Health and Consumer Experience with Metric-Aware Rollouts. The Doordash Engineering team does a nice job explaining the metrics they track during rollouts, how they support experimentation, and more.

    Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below:

  • Three Ways to Run Apache Kafka in the Public Cloud

    Three Ways to Run Apache Kafka in the Public Cloud

    Yes, people are doing things besides generative AI. You’ve still got other problems to solve, systems to connect, and data to analyze. Apache Kafka remains a very popular product for event and data processing, and I was thinking about how someone might use it in the cloud right now. I think there are three major options, and one of them (built-in managed service) is now offered by Google Cloud. So we’ll take that for a spin.

    Option 1: Run it yourself on (managed) infrastructure

    Many companies choose to run Apache Kafka themselves on bare metal, virtual machines, or Kubernetes clusters. It’s easy to find stories about companies like Netflix, Pinterest, and Cloudflare running their own Apache Kafka instances. Same goes for big (and small) enterprises that choose to setup and operate dedicated Apache Kafka environments.

    Why do this? It’s the usual reasons why people decide to manage their own infrastructure! Kafka has a lot of configurability, and experienced folks may like the flexibility and cost profile of running Apache Kafka themselves. Pick your infrastructure, tune every setting, and upgrade on your timetable. On the downside, self-managed Apache Kafka can result in a higher total cost of ownership, requires specialized skills in-house, and could distract you from other high-priority work.

    If you want to go that route, I see a few choices.

    There’s no shame in going this route! It’s actually very useful to know how to run software like Apache Kafka yourself, even if you decide to switch to a managed service later.

    Option 2: Use a built-in managed service

    You might want Apache Kafka, but not want to run Apache Kafka. I’m with you. Many folks, including those at big web companies and classic enterprises, depend on managed services instead of running the software themselves.

    Why do this? You’d sign up for this option when you want the API, but not the ops. It may be more elastic and cost-effective than self-managed hosting. Or, it might cost more from a licensing perspective, but provide more flexibility on total cost of ownership. On the downside, you might not have full access to every raw configuration option, and may pay for features or vendor-dictated architecture choices you wouldn’t have made yourself.

    AWS offers an Amazon Managed Streaming for Apache Kafka product. Microsoft doesn’t offer a managed Kafka product, but does provide a subset of the Apache Kafka API in front of their Azure Event Hubs product. Oracle cloud offers self-managed infrastructure with a provisioning assist, but also appears to have a compatible interface on their Streaming service.

    Google Cloud didn’t offer any native service until just a couple of months ago. The Apache Kafka for BigQuery product is now in preview and looks pretty interesting. It’s available in a global set of regions, and provides a fully-managed set of brokers that run in a VPC within a tenant project. Let’s try it out.

    Set up prerequisites

    First, I needed to enable the API within Google Cloud. This gave me the ability to use the service. Note that this is NOT FREE while in preview, so recognize that you’ll incur changes.

    Next, I wanted a dedicated service account for accessing the Kafka service from client applications. The service supports OAuth and SASL_PLAIN with service account keys. The latter is appropriate for testing, so I chose that.

    I created a new service account named seroter-bq-kafka and gave it the roles/managedkafka.client role. I also created a JSON private key and saved it to my local machine.

    That’s it. Now I was ready to get going with the cluster.

    Provision the cluster and topic

    I went into the Apache Kafka for BigQuery dashboard in the Google Cloud console—I could have also used the CLI which has the full set of control plane commands—to spin up a new cluster. I get very few choices, and that’s not a bad thing. You give the CPU and RAM capacity for the cluster, and Google Cloud creates the right shape for the brokers, and creates a highly available architecture. You’ll also see that I choose the VPC for the cluster, but that’s about it. Pretty nice!

    In about twenty minutes, my cluster was ready. Using the console or CLI, I could see the details of my cluster.

    Topics are a core part of Apache Kafka represent the resource you publish and subscribe to. I could create a topic via the UI or CLI. I created a topic called “topic1”.

    Build the producer and consumer apps

    I wanted two client apps. One to publish new messages to Apache Kafka, and another to consume messages. I chose Node.js and JavaScript as the language for the app. There are a handful of libraries for interacting with Apache Kafka, and I chose the mature kafkajs.

    Let’s start with the consuming app. I need (a) the cluster’s bootstrap server URL and (b) the encoded client credentials. We access the cluster through the bootstrap URL and it’s accessible via the CLI or the cluster details (see above). The client credentials for SASL_PLAIN authentication consists of the base64 encoded service account key JSON file.

    My index.js file defines a Kafka object with the client ID (which identifies our consumer), the bootstrap server URL, and SASL credentials. Then I define a consumer with a consumer group ID and subscribe to the “topic1” we created earlier. I process and log each message before appending to an array variable. There’s an HTTP GET endpoint that returns the array. See the whole index.js below, and the GitHub repo here.

    const express = require('express');
    const { Kafka, logLevel } = require('kafkajs');
    const app = express();
    const port = 8080;
    
    const kafka = new Kafka({
      clientId: 'seroter-consumer',
      brokers: ['bootstrap.seroter-kafka.us-west1.managedkafka.seroter-project-base.cloud.goog:9092'],
      ssl: {
        rejectUnauthorized: false
      },
      logLevel: logLevel.DEBUG,
      sasl: {
        mechanism: 'plain', // scram-sha-256 or scram-sha-512
        username: 'seroter-bq-kafka@seroter-project-base.iam.gserviceaccount.com',
        password: 'tybgIC ... pp4Fg=='
      },
    });
    
    const consumer = kafka.consumer({ groupId: 'message-retrieval-group' });
    
    //create variable that holds an array of "messages" that are strings
    let messages = [];
    
    async function run() {
      await consumer.connect();
      //provide topic name when subscribing
      await consumer.subscribe({ topic: 'topic1', fromBeginning: true }); 
    
      await consumer.run({
        eachMessage: async ({ topic, partition, message }) => {
          console.log(`################# Received message: ${message.value.toString()} from topic: ${topic}`);
          //add message to local array
          messages.push(message.value.toString());
        },
      });
    }
    
    app.get('/consume', (req, res) => {
        //return the array of messages consumed thus far
        res.send(messages);
    });
    
    run().catch(console.error);
    
    app.listen(port, () => {
      console.log(`App listening at http://localhost:${port}`);
    });
    

    Now we switch gears and go through the producer app that publishes to Apache Kafka.

    This app starts off almost identically to the consumer app. There’s a Kafka object with a client ID (different for the producer) and the same pointer to the bootstrap server URL and credentials. I’ve got an HTTP GET endpoint that takes the querystring parameters and publishes the key and value content to the request payload. The code is below, and the GitHub repo is here.

    const express = require('express');
    const { Kafka, logLevel } = require('kafkajs');
    const app = express();
    const port = 8080; // Use a different port than the consumer app
    
    const kafka = new Kafka({
        clientId: 'seroter-publisher',
        brokers: ['bootstrap.seroter-kafka.us-west1.managedkafka.seroter-project-base.cloud.goog:9092'],
        ssl: {
          rejectUnauthorized: false
        },
        logLevel: logLevel.DEBUG,
        sasl: {
          mechanism: 'plain', // scram-sha-256 or scram-sha-512
          username: 'seroter-bq-kafka@seroter-project-base.iam.gserviceaccount.com',
          password: 'tybgIC ... pp4Fg=='
        },
      });
    
    const producer = kafka.producer();
    
    app.get('/publish', async (req, res) => {
      try {
        await producer.connect();
    
        const _key = req.query.key; // Extract key from querystring
        console.log('key is ' + _key);
        const _value = req.query.value // Extract value from querystring
        console.log('value is ' + _value);
    
        const message = {
          key: _key, // Optional key for partitioning
          value: _value
        };
    
        await producer.send({
          topic: 'topic1', // Replace with your topic name
          messages: [message]
        });
    
        res.status(200).json({ message: 'Message sent successfully' });
    
      } catch (error) {
        console.error('Error sending message:', error);
        res.status(500).json({ error: 'Failed to send message' });
      }
    });
    
    app.listen(port, () => {
      console.log(`Producer listening at http://localhost:${port}`);
    });
    
    

    Next up, containerizing both apps so that I could deploy to a runtime.

    I used Google Cloud Artifact Registry as my container store, and created a Docker image from source code using Cloud Native buildpacks. It took one command for each app:

    gcloud builds submit --pack image=gcr.io/seroter-project-base/seroter-kafka-consumer
    gcloud builds submit --pack image=gcr.io/seroter-project-base/seroter-kafka-publisher

    Now we had everything needed to deploy and test our client apps.

    Deploy apps to Cloud Run and test it out

    I chose Google Cloud Run because I like nice things. It’s still one of the best two or three ways to host apps in the cloud. We also make it much easier now to connect to a VPC, which is what I need. Instead of creating some tunnel out of my cluster, I’d rather access it more securely.

    Here’s how I configured the consuming app. I first picked my container image and a target location.

    Then I chose to use always-on CPU for the consumer, as I had connection issues when I had a purely ephemeral container.

    The last setting was the VPC egress that made it possible for this instance to talk to the Apache Kafka cluster.

    About three seconds later, I had a running Cloud Run instance ready to consume.

    I ran through a similar deployment process for the publisher app, except I kept the true “scale to zero” setting turned on since it doesn’t matter if the publisher app comes and goes.

    With all apps deployed, I fired up the browser and issued a pair of requests to the “publish” endpoint.

    I checked the consumer app’s logs and saw that messages were successfully retrieved.

    Sending a request to the GET endpoint on the consumer app returns the pair of messages I sent from the publisher app.

    Sweet! We proved that we could send messages to the Apache Kafka cluster, and retrieve them. I get all the benefits of Apache Kafka, integrated into Google Cloud, with none of the operational toil.

    Read more in the docs about this preview service.

    Option 3: Use a managed provider on your cloud(s) of choice

    The final way you might choose to run Apache Kafka in the cloud is to use a SaaS product designed to work on different infrastructures.

    The team at Confluent does much of the work on open source Apache Kafka and offers a managed product via Confluent Cloud. It’s performant, feature-rich, and runs in AWS, Azure, and Google Cloud. Another option is Redpanda, who offer a managed cloud service that they operate on their infrastructure in AWS or Google Cloud.

    Why do this? Choosing a “best of breed” type of managed service is going to give you excellent feature coverage and operational benefits. These platforms are typically operated by experts and finely tuned for performance and scale. Are there any downside? These platforms aren’t free, and don’t always have all the native integrations into their target cloud (logging, data services, identity, etc) that a built-in service does. And you won’t have all the configurability or infrastructure choice that you’d have running it yourself.

    Wrap up

    It’s a great time to run Apache Kafka in the cloud. You can go full DIY or take advantage of managed services. As always, there are tradeoffs with each. You might even use a mix of products and approaches for different stages (dev/test/prod) and departments within your company. Are there any options I missed? Let me know!

  • Daily Reading List – July 12, 2024 (#354)

    Finished the week mostly caught up and ready for the weekend. I’m trying to finish writing a tech blog post for publication here, but my demo app is misbehaving. Hopefully better luck this weekend.

    [article] How To Measure Platform Engineering. This article proposes using a series of specific metrics to measure how useful your platform is for developers and the business overall.

    [blog] How to Implement OAuth 2.0 into a Golang App. I’ll be honest with you, authentication protocols (SAML, OAuth, OIDC) are not my love language. I like my security stuff to be as invisible as possible. But this is a good walkthrough of the plumbing.

    [blog] IAM so lost: A guide to identity in Google Cloud. Relatedly, identity management is my kryptonite. It’s easy for it to kill my momentum when building an app. However, I liked the way it was explained in this post.

    [blog] How to Run Hugging Face Models Programmatically Using Ollama and Testcontainers. It’s been interesting to watch how the Docker team has leveraged their acquisition of AtomicJar (testcontainers). Posts like this make me think this was a great match.

    [docs] From multi-cluster edge to mesh: Globally distributed applications exposed through GKE Gateway and Cloud Service Mesh. I read through this brand new architecture guide that shows you how to build a resilient architecture with Kubernetes clusters and a service mesh.

    [article] CIOs resist vendor-led AI hype, seeking out transparency. Make good choices, pick tech for the right reasons. But it’s also interesting to read this take where CIOs are saying their being too cautious on using generative AI. I don’t know what to believe anymore.

    [blog] Firebase Just Got Smarter: Meet Your New AI Development Assistant. This offers a deeper dive into the AI assistance included in this mobile and app platform.

    [article] Barriers to AI adoption. So good. This summary of a recent research paper provides such a relatable set of concerns that AI superfans need to consider as they try to grow adoption.

    [blog] Google BigQuery vs. Snowflake: A head-to-head comparison of cloud data warehouses. Here’s a fairly massive deep-dive into these two platforms, with details that may help you choose the right one for your situation.

    [paper] Speculative RAG: Enhancing Retrieval Augmented Generation through Drafting. This new paper proposes a different RAG framework that can increase accuracy and decrease latency.

    Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below: