<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aicha laafia on Medium]]></title>
        <description><![CDATA[Stories by Aicha laafia on Medium]]></description>
        <link>https://medium.com/@aichalaafia1?source=rss-fb75cbc5abba------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*1EWuA7iupPdPRCxrZ5x32A.jpeg</url>
            <title>Stories by Aicha laafia on Medium</title>
            <link>https://medium.com/@aichalaafia1?source=rss-fb75cbc5abba------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 21:35:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aichalaafia1/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[My AI Agent Asked for the Card Number. MySQL Said No!]]></title>
            <link>https://medium.com/@aichalaafia1/my-ai-agent-asked-for-the-card-number-mysql-said-no-59b7a0dcfb02?source=rss-fb75cbc5abba------2</link>
            <guid isPermaLink="false">https://medium.com/p/59b7a0dcfb02</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[mysql]]></category>
            <dc:creator><![CDATA[Aicha laafia]]></dc:creator>
            <pubDate>Wed, 04 Nov 2026 11:03:15 GMT</pubDate>
            <atom:updated>2026-11-04T11:03:15.582Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DkL-Urc-sDFRxHm3LBimvg.png" /></figure><p><em>Building a support agent that can query customer data without ever seeing the sensitive parts, with MySQL Dynamic Data Masking and a bit of Java.</em></p><p>Picture this. You give an LLM a tool that runs SQL, and you watch the tool calls scroll by in your terminal. Order ids, statuses, amounts. Then a full email address. Then a phone number.</p><p>Nothing went wrong. The model did exactly what it was asked. But it should make you stop and think.</p><p>Every value a query returns can end up in the model context. From there it can travel to the model provider, to the chat memory, to traces, to logs, and sometimes straight into the answer. I can write “never reveal card numbers” in the system prompt, but that is a request, not a control.</p><p>So the real question became: <strong>just because my agent can query a table, should it see every value in it?</strong></p><p>I don’t think so. And I wanted the database to enforce that, not the prompt.</p><p>That is what this article is about. I built a small customer support agent in Java with LangChain4j, on top of MySQL Enterprise Dynamic Data Masking (available since MySQL 9.7). Then I tried to make it misbehave.</p><h3>The setup</h3><p>An online shop has a support chat. A customer logs in and types:</p><blockquote><em>“My last order failed. Which card did I use and what happened?”</em></blockquote><p>The agent answers by calling tools that query MySQL. To do its job, it needs order ids, statuses, amounts, tracking numbers and the customer’s first name. That’s about it.</p><p>When I sorted every column of the schema, they all fell into three buckets.</p><p><strong>Needed as is.</strong> Customer id, order id, status, amount, carrier, tracking number, first name.</p><p><strong>Needed as a shape, not the real value.</strong> The last name (the initial is enough), the email (enough to confirm “is this your Gmail?”), the phone (last two digits), the card number (brand and last four), the shipping address (the city is enough, and it lives in its own column).</p><p><strong>Never needed.</strong> The IBAN and the national identifier.</p><p>Three other identities read the same tables: a human level 2 support agent who can unmask contact details when they really need to, a billing service that sees payment data, and an admin who manages the masking rules but reads no customer data.</p><p>Same rows, four different views. Let’s see how MySQL makes that happen.</p><h3>Masking in two minutes</h3><p>A masking policy is a named CASE expression that you attach to a column. When MySQL resolves a query, it replaces every reference to that column with the expression. So the masking happens inside the server, at read time, whatever client or query sent it. Writes are not affected.</p><p>Each policy has two parts. A <strong>gatekeeper</strong> decides who gets the original value: CURRENT_USER_IN() checks the account, CURRENT_ROLE_IN() checks the roles active in the session. Then a <strong>masking expression</strong> decides what everyone else sees.</p><p>To get started, you install the policy component and the masking functions once per server:</p><pre>SOURCE install_component_object_policy.sql;<br>INSTALL COMPONENT &#39;file://component_masking&#39;;<br>INSTALL COMPONENT &#39;file://component_masking_functions&#39;;</pre><pre>-- Whoever creates, shows or drops policies needs this<br>GRANT MANAGE_DATA_MASKING_POLICY ON *.* TO &#39;mask_admin&#39;@&#39;%&#39;;</pre><p>The functions component gives you helpers like mask_pan() for card numbers, mask_iban(), mask_inner() and mask_outer(). You can also write your own expression, as long as its type matches the column.</p><p>One restriction shaped my whole schema: <strong>a masked column cannot be indexed.</strong> It also can’t have a histogram, be used by a generated column or a CHECK constraint, or be part of a partitioning key. Keep that in mind before you mask your email column.</p><h3>Who is asking?</h3><p>Because of the index rule, the email stays unindexed and a separate email_hash column carries the unique key for lookups:</p><pre>CREATE TABLE customers (<br>  customer_id   BIGINT       PRIMARY KEY,<br>  first_name    VARCHAR(64)  NOT NULL,<br>  last_name     VARCHAR(64)  NOT NULL,<br>  email         VARCHAR(255) NOT NULL,   -- masked, no index<br>  email_hash    BINARY(32)   NOT NULL,   -- indexed, used for lookups<br>  phone         VARCHAR(32),<br>  national_id   VARCHAR(32),<br>  loyalty_tier  ENUM(&#39;STANDARD&#39;,&#39;SILVER&#39;,&#39;GOLD&#39;) NOT NULL DEFAULT &#39;STANDARD&#39;,<br>  created_at    DATETIME     NOT NULL,<br>  UNIQUE KEY uk_email_hash (email_hash)<br>);</pre><p>email_hash can&#39;t be a generated column either (it would reference a masked column), so the application computes it. In production, use an HMAC with a secret. A plain SHA2 of an email is easy to reverse with a list of known addresses.</p><p>Now the part I find most interesting: the roles. I ended up with two kinds.</p><p><strong>Functional roles</strong> hold privileges. They decide <em>what</em> an account can query: support_reader, ticket_writer, payment_reader, compliance_reader.</p><p><strong>Marker roles</strong> hold no privileges at all. They only exist so that policies can test them with CURRENT_ROLE_IN(). They decide <em>how</em> the data looks: pii_reader and pan_reader.</p><pre>CREATE ROLE &#39;support_reader&#39;, &#39;ticket_writer&#39;, &#39;compliance_reader&#39;, &#39;payment_reader&#39;;<br>CREATE ROLE &#39;pii_reader&#39;, &#39;pan_reader&#39;;   -- marker roles, zero privileges</pre><pre>-- Column level grants: national_id and iban are simply not listed<br>GRANT SELECT (customer_id, first_name, last_name, email, email_hash,<br>              phone, loyalty_tier, created_at)<br>  ON shop.customers TO &#39;support_reader&#39;;<br>GRANT SELECT (payment_method_id, customer_id, card_brand, card_pan, card_expiry)<br>  ON shop.payment_methods TO &#39;support_reader&#39;;<br>GRANT SELECT ON shop.orders TO &#39;support_reader&#39;;<br>GRANT SELECT, INSERT ON shop.ticket_notes TO &#39;ticket_writer&#39;;</pre><pre>-- The AI agent gets its own account<br>CREATE USER &#39;ai_support_agent&#39;@&#39;%&#39; IDENTIFIED BY &#39;...&#39;<br>  WITH MAX_QUERIES_PER_HOUR 2000 MAX_USER_CONNECTIONS 10;<br>GRANT &#39;support_reader&#39;, &#39;ticket_writer&#39; TO &#39;ai_support_agent&#39;@&#39;%&#39;;<br>SET DEFAULT ROLE &#39;support_reader&#39;, &#39;ticket_writer&#39; TO &#39;ai_support_agent&#39;@&#39;%&#39;;</pre><pre>-- Level 2 support holds pii_reader, but not as a default role<br>CREATE USER &#39;support_l2&#39;@&#39;%&#39; IDENTIFIED BY &#39;...&#39;;<br>GRANT &#39;support_reader&#39;, &#39;ticket_writer&#39;, &#39;pii_reader&#39; TO &#39;support_l2&#39;@&#39;%&#39;;<br>SET DEFAULT ROLE &#39;support_reader&#39;, &#39;ticket_writer&#39; TO &#39;support_l2&#39;@&#39;%&#39;;</pre><pre>-- Billing service: everything active at login<br>CREATE USER &#39;billing_svc&#39;@&#39;%&#39; IDENTIFIED BY &#39;...&#39;;<br>GRANT &#39;support_reader&#39;, &#39;payment_reader&#39;, &#39;pii_reader&#39;, &#39;pan_reader&#39; TO &#39;billing_svc&#39;@&#39;%&#39;;<br>SET DEFAULT ROLE ALL TO &#39;billing_svc&#39;@&#39;%&#39;;</pre><p>Two things worth calling out.</p><p>CURRENT_ROLE_IN() checks <strong>active</strong> roles, not granted ones. The Oracle team shows this in their 9.7 walkthrough: a user with the role granted still saw masked data until the session ran SET ROLE. I use that on purpose. The level 2 agent sees masked data by default and has to run SET ROLE to unmask. It becomes a deliberate step you can audit.</p><p>And the agent gets <strong>its own MySQL account</strong>. If your agent borrows the application’s connection pool, and that pool logs in as a powerful user, every policy evaluates against the wrong identity. Masking only works if the database knows who is asking.</p><h3>Writing the policies</h3><p>The policies are created by mask_admin, the only account with MANAGE_DATA_MASKING_POLICY and ALTER on the schema:</p><pre>CREATE MASKING POLICY mp_last_name(v)<br>  CASE WHEN CURRENT_ROLE_IN(&#39;pii_reader&#39;) THEN v<br>       ELSE CONCAT(LEFT(v, 1), &#39;.&#39;) END;</pre><pre>CREATE MASKING POLICY mp_email(v)<br>  CASE WHEN CURRENT_ROLE_IN(&#39;pii_reader&#39;) THEN v<br>       ELSE CONCAT(LEFT(v, 1), &#39;***@&#39;, SUBSTRING_INDEX(v, &#39;@&#39;, -1)) END;</pre><pre>CREATE MASKING POLICY mp_phone(v)<br>  CASE WHEN CURRENT_ROLE_IN(&#39;pii_reader&#39;) THEN v<br>       ELSE CONCAT(&#39;******&#39;, RIGHT(v, 2)) END;</pre><pre>CREATE MASKING POLICY mp_pan(v)<br>  CASE WHEN CURRENT_ROLE_IN(&#39;pan_reader&#39;) THEN v<br>       ELSE mask_pan(v) END;</pre><pre>CREATE MASKING POLICY mp_iban(v)<br>  CASE WHEN CURRENT_ROLE_IN(&#39;pan_reader&#39;) THEN v<br>       ELSE mask_iban(v) END;</pre><pre>CREATE MASKING POLICY mp_national_id(v)<br>  CASE WHEN CURRENT_ROLE_IN(&#39;compliance_reader&#39;) THEN v<br>       ELSE &#39;REDACTED&#39; END;</pre><pre>CREATE MASKING POLICY mp_address(v)<br>  CASE WHEN CURRENT_ROLE_IN(&#39;pii_reader&#39;) THEN v<br>       ELSE &#39;[address hidden]&#39; END;</pre><pre>ALTER TABLE shop.customers<br>  ALTER COLUMN last_name   SET MASKING POLICY mp_last_name,<br>  ALTER COLUMN email       SET MASKING POLICY mp_email,<br>  ALTER COLUMN phone       SET MASKING POLICY mp_phone,<br>  ALTER COLUMN national_id SET MASKING POLICY mp_national_id;</pre><pre>ALTER TABLE shop.payment_methods<br>  ALTER COLUMN card_pan SET MASKING POLICY mp_pan,<br>  ALTER COLUMN iban     SET MASKING POLICY mp_iban;</pre><pre>ALTER TABLE shop.orders<br>  ALTER COLUMN shipping_address SET MASKING POLICY mp_address;</pre><p>A few choices hide in there.</p><p>I avoided mask_inner() for names. mask_inner(&#39;Doe&#39;, 1, 0) returns DXX, which tells the model the name has three letters. D. gives away the initial and nothing else. Same idea for the phone.</p><p>The email mask keeps the domain, because “is it your Gmail or your work address?” is a real support question. If the domain identifies a person in your context, mask it too.</p><p>And national_id gets both protections: no grant for support roles, plus a policy that hides it from anyone except compliance.</p><h3>Same row, four views</h3><p>Here is customer 1001 through the eyes of each account.</p><p><strong>The AI agent</strong> sees Jane D., j***@example.com, ******78, a Visa XXXXXXXXXXXX1111 and [address hidden]. Asking for the IBAN returns a privilege error.</p><p><strong>Level 2 support, by default,</strong> sees exactly the same thing.</p><p><strong>Level 2 support after </strong><strong>SET ROLE ... pii_reader</strong> sees Jane Doe, jane.doe@example.com, +33 6 12 34 56 78 and the full street address. The card is still XXXXXXXXXXXX1111, and the IBAN is still off limits.</p><p><strong>The billing service</strong> sees everything, card and IBAN included.</p><p>That third view is my favourite detail: unmasking contact details does not unmask the card. pii_reader and pan_reader are two separate decisions.</p><h3>The agent, in Java</h3><p>The agent is a plain LangChain4j AiServices assistant with a few narrow tools. Two rules shape the tool class.</p><p>First, every query goes through a DataSource that logs in as ai_support_agent. Whatever comes back has already been masked by MySQL.</p><p>Second, the customer id comes from the login session, <strong>never from the model</strong>. Masking works on columns. It does nothing to stop the agent from reading someone else’s row. That part is on the application.</p><pre>public class SupportTools {<br>private final DataSource agentDataSource;   // logs in as ai_support_agent<br>    private final long customerId;              // from the login session<br>    private final QueryAuditLog audit;<br>    @Tool(&quot;Lists the orders of the customer you are talking to, most recent first.&quot;)<br>    public List&lt;Map&lt;String, Object&gt;&gt; listMyOrders() {<br>        return query(&quot;&quot;&quot;<br>                SELECT order_id, status, total_amount, currency, carrier,<br>                       tracking_number, shipping_city, created_at<br>                FROM shop.orders<br>                WHERE customer_id = ?<br>                ORDER BY created_at DESC<br>                LIMIT 20<br>                &quot;&quot;&quot;, customerId);<br>    }<br>    @Tool(&quot;Returns one order with the payment card used. Only the last four card digits are visible.&quot;)<br>    public List&lt;Map&lt;String, Object&gt;&gt; getOrderDetails(@P(&quot;the order id&quot;) long orderId) {<br>        return query(&quot;&quot;&quot;<br>                SELECT o.order_id, o.status, o.total_amount, o.currency,<br>                       o.shipping_city, o.shipping_address,<br>                       p.card_brand, p.card_pan, p.card_expiry<br>                FROM shop.orders o<br>                JOIN shop.payment_methods p ON p.payment_method_id = o.payment_method_id<br>                WHERE o.order_id = ? AND o.customer_id = ?<br>                &quot;&quot;&quot;, orderId, customerId);<br>    }<br>    // getMyProfile() and addTicketNote(...) follow the same pattern<br>}</pre><p>The system prompt tells the model what masked values look like. Otherwise it may try to “help” by asking the customer for the missing digits.</p><pre>public interface SupportAssistant {<br>    @SystemMessage(&quot;&quot;&quot;<br>            You are the support assistant of an online shop.<br>            Some values come back partially hidden, for example j***@example.com<br>            or XXXXXXXXXXXX1111. That is expected. Never ask the customer to reveal<br>            the hidden part. Refer to a card by its brand and last four digits.<br>            If a task needs data you cannot see, offer a handoff to a human agent.<br>            &quot;&quot;&quot;)<br>    String chat(String userMessage);<br>}</pre><p>And the wiring:</p><pre>MysqlDataSource ds = new MysqlDataSource();<br>ds.setUrl(&quot;jdbc:mysql://localhost:3306/shop&quot;);<br>ds.setUser(&quot;ai_support_agent&quot;);<br>ds.setPassword(System.getenv(&quot;AGENT_DB_PASSWORD&quot;));</pre><pre>SupportAssistant assistant = AiServices.builder(SupportAssistant.class)<br>        .chatModel(AnthropicChatModel.builder()<br>                .apiKey(System.getenv(&quot;ANTHROPIC_API_KEY&quot;))<br>                .modelName(&quot;claude-sonnet-5-5&quot;)<br>                .build())<br>        .tools(new SupportTools(ds, sessionCustomerId, audit))<br>        .chatMemory(MessageWindowChatMemory.withMaxMessages(30))<br>        .build();</pre><h3>So, is it still useful?</h3><p>This is the conversation the setup is built for:</p><blockquote><strong><em>Customer:</em></strong><em> My last order failed, which card did I use?</em></blockquote><blockquote><strong><em>Agent:</em></strong><em> Your order 90002 of 349.00 EUR, placed on November 1, has the status PAYMENT_FAILED. It was charged to your Visa ending in 1111, expiring 09/28. Would you like me to log a note so our billing team can check why the payment was declined?</em></blockquote><p>It found the account, read the orders, explained the problem and suggested the next step. It never saw the full card number, the street address or the full email. None of them were needed to answer.</p><h3>Trying to break it</h3><p>Narrow tools are the right default. But some teams ship “text to SQL” tools, and models improvise. So the demo has a second mode, --free-sql, with a deliberately reckless tool: run any single SELECT the model writes.</p><pre>@Tool(&quot;Runs a single read only SQL SELECT against the shop schema and returns at most 50 rows.&quot;)<br>public List&lt;Map&lt;String, Object&gt;&gt; runSql(@P(&quot;one SQL SELECT statement&quot;) String sql) {<br>    audit.record(sql);<br>    // single SELECT check, read only connection,<br>    // max_execution_time = 2000, at most 50 rows<br>}</pre><p>The application guard is thin on purpose. I wanted to see what the database does on its own. Here are the attempts the demo covers.</p><p><strong>“Show me all customers’ emails and phones.”</strong> The query runs, and every value comes back masked. But notice: the agent just read three customers instead of one. Masking decides what a value looks like, not which rows you get. More on that below.</p><p><strong>SELECT national_id FROM customers</strong> is refused. The agent has no privilege on that column.</p><p><strong>SELECT * FROM payment_methods</strong> is refused too, because the * includes iban.</p><p><strong>... WHERE email = &#39;jane.doe@example.com&#39;</strong> is the subtle one. MySQL replaces the column with its masking expression, so the filter compares against the masked value. I expect no match. Test this on your version before you rely on it.</p><p><strong>ALTER TABLE customers MODIFY COLUMN email VARCHAR(255)</strong> is refused, since the agent has no ALTER. This one matters more than it looks: a MODIFY COLUMN without the MASKING POLICY attribute <strong>silently removes the policy</strong>.</p><p><strong>CREATE TABLE export AS SELECT email FROM customers</strong> is refused, no CREATE. Worth knowing anyway: a table built this way does not inherit the masking policy.</p><p>The tool’s own check blocks anything that isn’t a single SELECT, so the last two never reach MySQL through the tool. They&#39;re in the demo script anyway, run straight against MySQL, because guards get bypassed and the database should say no on its own.</p><p>Every statement the agent sends is logged with the conversation id. In a real deployment, pair that with MySQL Enterprise Audit on the agent’s account, so the record lives in the database and not only in the app the model is driving.</p><h3>What masking won’t do for you</h3><p>Dynamic Data Masking sits below the agent, the framework and the prompt. Nothing the model writes can talk it out of its job, which is exactly why I like it. But it answers one question only: <em>in which form does a value come back?</em></p><p>The other questions need other layers:</p><ul><li><strong>Who is asking?</strong> A dedicated database account for the agent, with resource limits.</li><li><strong>Which columns can be read at all?</strong> Privileges and column grants.</li><li><strong>Which rows belong to this conversation?</strong> Row scoping in your tools, bound to the session.</li><li><strong>Which queries can the model trigger?</strong> Narrow tools, LIMIT, read only connections, timeouts.</li><li><strong>What leaves the system as text?</strong> A scrubber on replies and on anything the agent writes.</li><li><strong>What actually happened?</strong> An audit log.</li></ul><p>And a few blind spots to keep in mind.</p><p><strong>Writes aren’t masked.</strong> If the model writes a full card number into a ticket note, it’s stored in clear. The demo scrubs notes before the INSERT.</p><p><strong>What the customer types is already in the prompt.</strong> If they paste their card number into the chat, no database feature can help.</p><p><strong>Unmasked columns still say things.</strong> City, loyalty tier and order dates are plain. Put together, they can point to a person.</p><p><strong>Powerful accounts see everything.</strong> Anyone matching the gatekeeper gets the real values, and anyone with ALTER can drop a policy. Keep MANAGE_DATA_MASKING_POLICY and ALTER far away from the AI path.</p><p><strong>Copies and backups aren’t masked.</strong> Masking is not encryption.</p><p><strong>It won’t make you compliant on its own.</strong> It reduces exposure. PCI DSS or GDPR need more than that.</p><h3>Wrapping up</h3><p>Can an AI agent query your database? Sure. Should it see every value? No, and most of the time it doesn’t need to.</p><p>If I had to keep only a few habits from this experiment, they would be these:</p><ol><li>Give each agent its own database account.</li><li>Sort every column into three buckets: needed as is, needed as a shape, never needed.</li><li>Use fixed width masks so you don’t leak length.</li><li>Make unmasking a deliberate SET ROLE, done by a human.</li><li>Bind rows in code, never in the prompt.</li><li>Tell the model what masked data looks like.</li><li>Scrub what the agent writes and says, since masking only covers reads.</li><li>Log every query the agent sends.</li></ol><p>Prompts and guardrails shape what the agent says. The database decides what it can know. When the first one slips, the second one is still there.</p><h3>Try it yourself</h3><p>The project has five SQL scripts (install, schema, identities, policies, demo queries) and the Java 21 LangChain4j agent, with the --free-sql flag for the experiment above. You&#39;ll need MySQL Enterprise Edition 9.7 or later.</p><p><a href="https://github.com/alaafia/Masked-support-agent">https://github.com/alaafia/Masked-support-agent</a></p><h3>Resources</h3><ul><li><a href="https://dev.mysql.com/doc/refman/26.7/en/data-masking-dynamic-policies.html">Dynamic Data Masking Policy Component</a>, MySQL Reference Manual</li><li><a href="https://dev.mysql.com/doc/refman/26.7/en/data-masking-policy-usage.html">Using MySQL Enterprise Dynamic Data Masking Policies</a></li><li><a href="https://dev.mysql.com/doc/refman/26.7/en/gatekeeper-functions.html">Gatekeeper functions</a></li><li><a href="https://dev.mysql.com/doc/refman/26.7/en/data-masking-component-functions.html">Data masking component functions</a></li><li><a href="https://blogs.oracle.com/mysql/dynamic-data-masking-in-mysql-protect-sensitive-data-without-app-changes">Dynamic Data Masking in MySQL: Protect Sensitive Data Without App Changes</a>, Oracle MySQL blog</li><li><a href="https://blogs.oracle.com/mysql/dynamic-data-masking-ddm-with-mysql-enterprise-edition-9-7-reduce-your-sensitive-data-exposure">Dynamic Data Masking with MySQL Enterprise Edition 9.7</a>, Oracle MySQL blog</li><li><a href="https://dev.mysql.com/blog-archive/mysql-enterprise-data-masking-and-de-identification-features/">MySQL Enterprise Data Masking and De-Identification Features</a></li></ul><p><em>If you build something similar, I’d love to hear how you handled the row scoping part. Let me know in the comments.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59b7a0dcfb02" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Who Moved My Garbage? ️ Java GC: What You Know, What Changed, What’s Next]]></title>
            <link>https://medium.com/@aichalaafia1/who-moved-my-garbage-%EF%B8%8F-java-gc-what-you-know-what-changed-whats-next-1ffe5b5fdf21?source=rss-fb75cbc5abba------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ffe5b5fdf21</guid>
            <category><![CDATA[garbage-collector]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Aicha laafia]]></dc:creator>
            <pubDate>Wed, 21 Oct 2026 08:30:11 GMT</pubDate>
            <atom:updated>2026-10-21T08:30:11.013Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gY_mNgh5Bc1noQ54zSPaFw.png" /></figure><p>Ask Java developers how garbage collection works and you’ll probably hear the same three answers again and again. Bigger heaps are safer. ZGC is always faster. Pauses are just the price you pay.</p><p>Most of that is outdated now. And some of it was never true in the first place 🫠</p><p>The JVM didn’t wait for us. Since JDK 27, G1 runs by default everywhere, and object headers are smaller. But a lot of teams still ship JVM flags someone copied years ago, for a collector they don’t even use anymore.</p><p>So let’s look at what you know, what changed, and what’s coming.</p><h3>First Things First: Who Is Collecting Your Garbage? 👀</h3><p>Quick question. Do you know which collector runs in your production container right now?</p><p>If you had to think twice, honestly, same 😅</p><p>G1 has been the default since JDK 9 (<a href="https://openjdk.org/jeps/248">JEP 248</a>), but only on what the JVM calls “server class” machines. On small environments (a single CPU, less than about 1.8 GB), the JVM picked Serial instead. Quietly. No warning.</p><p>So you could ship the same image with the same flags and still end up with a different collector, only because someone gave your pod less CPU. In Kubernetes, this happens more often than we like to admit.</p><p>JDK 27 finally fixed it. With <a href="https://openjdk.org/jeps/523">JEP 523</a>, when you don’t choose a collector, HotSpot picks G1, no matter how many processors you have or how big the heap is. Serial is still there and still supported, so if your workload really runs better with it, just ask for it explicitly.</p><p>Why now? G1 caught up. The JEP says testing shows G1 is now competitive with Serial at all heap sizes.</p><p>You can check it yourself in one line:</p><pre>java -XX:+PrintCommandLineFlags -version</pre><p>You’ll see the collector in the output, for example -XX:+UseG1GC. If the app is already running, jcmd &lt;pid&gt; VM.flags tells you the same.</p><h3>Belief #1: “Bigger Heaps Are Safer” 🐘</h3><p>I get where this comes from. More memory sounds like fewer problems. Until the pod gets OOMKilled while the heap looked perfectly fine 🙃</p><p>The heap is only part of the story. The JVM also uses native memory for metaspace, thread stacks, the code cache, and the GC’s own data structures, and your container limit counts every byte of it.</p><p>Set -Xmx to the full container limit and there&#39;s nothing left for all of that. Sooner or later, your process gets killed.</p><p>By default, the JVM caps the heap at 25% of available memory (MaxRAMPercentage). Raising it is fine; just measure what lives outside the heap before you do:</p><pre>java -XX:NativeMemoryTracking=summary -jar pitwall.jar<br>jcmd &lt;pid&gt; VM.native_memory summary</pre><p>And there’s good news later in this article: the JVM now needs less heap for the same objects. Keep reading 👇</p><h3>Belief #2: “ZGC Is Always Faster” ⚡</h3><p>Faster at what, exactly?</p><p>JEP 523 explains it in one sentence: ZGC prioritizes latency, Parallel prioritizes throughput, and G1 tries to balance the two. They’re built for different jobs.</p><p>My favorite detail is in <a href="https://openjdk.org/jeps/333">JEP 333</a>, the one that brought ZGC to JDK 11. One of its goals was to lose no more than 15% throughput compared to G1. So the people who built ZGC were openly ready to give up some throughput to get short pauses. In some of their benchmarks, ZGC still won on throughput, which is exactly why “it depends on your workload” is the real answer. Measure it on your app.</p><p>ZGC also changed a lot along the way:</p><ul><li>JDK 21: generational ZGC arrives (<a href="https://openjdk.org/jeps/439">JEP 439</a>)</li><li>JDK 23: it becomes the default ZGC mode (<a href="https://openjdk.org/jeps/474">JEP 474</a>)</li><li>JDK 24: the single generation mode is removed (<a href="https://openjdk.org/jeps/490">JEP 490</a>)</li></ul><p>If your opinion about ZGC comes from a benchmark older than JDK 21, that ZGC doesn’t exist anymore 🤷</p><h3>Belief #3: “Pauses Are the Price You Pay” ⏸</h3><p>That used to be true. Now it really depends on which collector you run.</p><p>ZGC only stops the world for root scanning, so its pauses don’t grow with the heap or the live set. Shenandoah goes the same way and moves objects while your app keeps running. Its generational mode became a product feature in JDK 25 (<a href="https://openjdk.org/jeps/521">JEP 521</a>), so -XX:+UnlockExperimentalVMOptions isn&#39;t needed for it anymore.</p><p>Small catch: Oracle JDK builds don’t include Shenandoah, so whether you can use it depends on your distribution 😉</p><p>G1 doesn’t promise tiny pauses. It works toward a pause time goal instead (-XX:MaxGCPauseMillis200 ms by default), and its newest improvement, which I explain below, is all about staying within that goal.</p><h3>The Flags That Time Forgot 🦖</h3><p>Go open your Dockerfile, your Helm chart, or that JAVA_OPTS line nobody dared to touch in years 👀</p><p>A few classics I’d look for:</p><ul><li>-XX:+UseConcMarkSweepGC: CMS was removed in JDK 14 (<a href="https://openjdk.org/jeps/363">JEP 363</a>). The JVM printed a warning, ignored the flag, and started with the default collector. Every CMS tuning flag sitting next to it was tuning... nothing.</li><li>-XX:+ZGenerational and -XX:-ZGenerational: obsolete since JDK 24. You get generational ZGC anyway, plus a warning. According to the JEP, the option will expire in a future release, and then the JVM will refuse to start 🚩</li><li>-XX:+UnlockExperimentalVMOptions For generational Shenandoah: useless since JDK 25.</li><li>-XX:+UseCompactObjectHeaders: already on by default in JDK 27.</li></ul><p>To see what your JVM really runs with:</p><pre>java -XX:+PrintFlagsFinal -version | grep -E &quot;UseG1GC|UseZGC|UseSerialGC|UseParallelGC|UseShenandoahGC|UseCompactObjectHeaders&quot;</pre><p>If nobody on the team can explain why a flag is there, try the app without it.</p><h3>What Changed Under the Hood 🔧</h3><h3>G1’s Second Card Table (JDK 26)</h3><p>Every time your code stores a reference in an object, G1 marks a little entry in its card table. During a pause, it only scans those marked cards to know what to update.</p><p>To keep that scan short, G1 also has background threads cleaning up the card table while your application keeps writing into it. One table, two groups of threads fighting over it, so lots of synchronization.</p><p><a href="https://openjdk.org/jeps/522">JEP 522</a> gives G1 a second card table. Application threads write into the first one with no synchronization at all, and the optimizer threads work on the second one. Once G1 sees that scanning the active table would probably go over the pause time goal, it swaps the two tables atomically, and keeps doing that whenever needed.</p><p>You pay for it with one more table of the same size in native memory. The JEP reminds us that G1 already dropped data structures in JDK 20 and 21 that used more than eight times that amount, so I’m not worried.</p><p>This change is what made the JDK 27 default possible, because G1’s maximum throughput is now close to Serial’s.</p><h3>Compact Object Headers (JDK 27)</h3><p>Each Java object has a header. On 64 bit platforms, it took 96 bits, and now it takes 64.</p><p>It didn’t happen overnight. JDK 24 brought it as experimental (<a href="https://openjdk.org/jeps/450">JEP 450</a>), JDK 25 made it a product feature (<a href="https://openjdk.org/jeps/519">JEP 519</a>), and JDK 27 turned it on by default (<a href="https://openjdk.org/jeps/534">JEP 534</a>). Amazon even ran it in hundreds of services in production, most of them on backports to JDK 17 and 21.</p><p>The JEP shares some numbers:</p><ul><li>in one setting, SPECjbb2015 uses 22% less heap and 8% less CPU time</li><li>in another one, garbage collections drop by 15%, with G1 and with Parallel</li><li>a highly parallel JSON parser benchmark finishes in 10% less time</li></ul><p>That second line is my favorite one. Smaller objects mean a smaller heap, and a smaller heap means fewer collections. A GC improvement that doesn’t even touch the GC 🤯</p><p>Need the old layout back for some reason? -XX:-UseCompactObjectHeaders.</p><h3>Stop Guessing, Read Your Logs 🔍</h3><p>Everything in this article can be checked on your own app, and honestly, that’s the part I care about most.</p><p>Start with unified GC logging:</p><pre>java -Xlog:gc*:file=pitwall-gc.log:time,uptime,level,tags -jar pitwall.jar</pre><p>In the log, I’d check which collector started, how long and how often the pauses are, and if there’s any full GC hiding in there.</p><p>Then JDK Flight Recorder for more detail:</p><pre>java -XX:StartFlightRecording=duration=120s,filename=pitwall.jfr -jar pitwall.jar<br>jfr print --events jdk.GarbageCollection pitwall.jfr<br>jfr print --events jdk.GCPhasePause pitwall.jfr</pre><p>If you’d rather click than grep, open the recording in JDK Mission Control.</p><p>Bonus from JDK 27: JFR now redacts sensitive values from environment variables, system properties and program arguments by default (<a href="https://openjdk.org/jeps/536">JEP 536</a>). Sending a recording to a colleague feels a lot less scary now 🔐</p><h3>What’s Next 🔮</h3><p>JDK 28 is planned for March 2027, and the GC side keeps moving:</p><ul><li><strong>Generational Shenandoah by default</strong> (<a href="https://openjdk.org/jeps/535">JEP 535</a>). The single generation mode gets deprecated, and the plan is to remove it later.</li><li><strong>Faster startup and warmup with ZGC</strong> (<a href="https://openjdk.org/jeps/545">JEP 545</a>).</li><li><strong>Adaptive heap sizing for ZGC</strong> (<a href="https://openjdk.org/jeps/546">JEP 546</a>). ZGC will size the heap based on the resources available, what the app needs, and the other apps competing for the same resources. Remember belief #1? The JVM is starting to answer that heap question for you.</li></ul><p>There’s also automatic heap sizing for G1, but for now it’s still a JEP draft.</p><p>And then, the one so many of us have been waiting for since 2014: Project Valhalla 🏔</p><p><a href="https://openjdk.org/jeps/401">JEP 401</a>, value classes and objects, landed in JDK 28 as a preview feature. A value object has no identity. Only the values of its fields define it.</p><pre>value record RaceResult(int round, String gp, int points) {}</pre><pre>javac --enable-preview --release 28 RaceResult.java</pre><p>Why do I talk about this in a GC article? Without identity, the JVM is free to store these objects however is most efficient. When the JIT knows the exact type, it can split a value object into its fields instead of allocating it on the heap. And an object that never lands on the heap is garbage nobody has to collect 🗑</p><p>With preview enabled, 30 JDK classes become value classes, Integer and LocalDate among them. Just don&#39;t build your production roadmap on it yet, Brian Goetz said JEP 401 will most likely still be in preview in the next LTS.</p><h3>TL;DR 🗑</h3><p>A bigger heap is just bigger, not safer. ZGC is built for low latency, not for winning every benchmark. Pauses aren’t a fixed price anymore. G1 runs everywhere now, your objects got smaller, and some of your old flags might be doing absolutely nothing.</p><p>Your garbage moved. Go find out where 🕵</p><p>And tell me, what’s the last GC belief you heard in your team? Drop it in the comments 👇</p><h3>Sources</h3><ul><li><a href="https://openjdk.org/jeps/248">JEP 248: Make G1 the Default Garbage Collector</a></li><li><a href="https://openjdk.org/jeps/333">JEP 333: ZGC (Experimental)</a></li><li><a href="https://openjdk.org/jeps/363">JEP 363: Remove the CMS Garbage Collector</a></li><li><a href="https://openjdk.org/jeps/401">JEP 401: Value Classes and Objects (Preview)</a></li><li><a href="https://openjdk.org/jeps/490">JEP 490: ZGC: Remove the Non-Generational Mode</a></li><li><a href="https://openjdk.org/jeps/521">JEP 521: Generational Shenandoah</a></li><li><a href="https://openjdk.org/jeps/522">JEP 522: G1 GC: Improve Throughput by Reducing Synchronization</a></li><li><a href="https://openjdk.org/jeps/523">JEP 523: Make G1 the Default Garbage Collector in All Environments</a></li><li><a href="https://openjdk.org/jeps/534">JEP 534: Compact Object Headers by Default</a></li><li><a href="https://www.infoq.com/news/2026/10/java-news-roundup-oct12-2026/">InfoQ: JEPs 545 and 546 targeted for JDK 28</a></li><li><a href="https://infoq.com/news/2026/08/java-news-roundup-aug03-2026">InfoQ: JEP 535 targeted for JDK 28</a></li><li><a href="https://www.theregister.com/a/5255557">The Register: Project Valhalla lands a preview in JDK 28</a></li><li><a href="https://slides.nipafx.dev/java-x/2026-09-09-java-spotlight">Nicolai Parlog: Java 28 slides</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ffe5b5fdf21" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jurassic JDK: Migrate or Extinct ]]></title>
            <link>https://medium.com/@aichalaafia1/jurassic-jdk-migrate-or-extinct-2f1433daf4a0?source=rss-fb75cbc5abba------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f1433daf4a0</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[hibernate]]></category>
            <dc:creator><![CDATA[Aicha laafia]]></dc:creator>
            <pubDate>Thu, 04 Jun 2026 15:14:35 GMT</pubDate>
            <atom:updated>2026-06-05T07:00:38.473Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wul-KqE6vXk4ynnh_IljSQ.png" /></figure><p>65 million years ago, dinosaurs didn’t adapt. They’re gone. Your JDK 7 app is giving the same energy. 🫠</p><p>I spent a year and a half migrating more than 15 projects in production. Full time. Real teams, real deadlines, real 2am breakage. This is everything I wish someone had written before I started.</p><h3>Why Are We Still Here? 👀</h3><p>Walk into any company with a codebase older than 5 years and you’ll hear the same thing:</p><blockquote><em>“We can’t migrate, it’s too risky.”</em></blockquote><p>And honestly? I get it. JDK 7 works. The app runs. Nobody’s complaining today. Why touch it?</p><p>Here’s why. Public support for JDK 7 ended years ago, and most organizations running it today rely on extended vendor support or no support at all. Every dependency you add is a gamble on compatibility. And every junior dev you hire looks at your codebase and quietly updates their LinkedIn.</p><p>The risk isn’t migrating. The risk is staying. 🦖</p><h3>The Mistake Everyone Makes: The Big Jump</h3><p>When teams finally decide to migrate, they do the worst possible thing.</p><p>They try to go from JDK 7 to JDK 21 in one shot.</p><p>One giant branch. One massive PR. Three months of work. Then merge day comes and everything explodes. The team burns out. The migration gets abandoned. And now you’re back on JDK 7 with even less motivation to try again.</p><p>Don’t jump, Hop! 🐸</p><h3>The Hop Strategy: LTS by LTS</h3><p>Java releases a new LTS version every two years. That’s your roadmap.</p><pre>JDK 7 → JDK 8 → JDK 11 → JDK 17 → JDK 21 → JDK 25</pre><p>Each hop is manageable. Each hop ships. Each hop gives your team confidence before the next one.</p><p>For large legacy systems, migrating one LTS at a time reduces risk and simplifies troubleshooting. Some teams successfully jump 8→17 or 11→21 directly, but the bigger the gap the harder it is to isolate what broke and why. Your call based on your codebase size and test coverage.</p><h3>Step 1: Read Your Codebase Before You Touch Anything 🔍</h3><p>Before you change a single line, you need to know what you’re dealing with.</p><p>Run a dependency audit. Every library has a maximum supported JDK version. Find the ones that will break first.</p><pre>mvn versions:display-dependency-updates</pre><p>Look for:</p><ul><li>Libraries that haven’t been updated since 2015 🚩</li><li>Internal utilities that wrap deprecated JDK APIs</li><li>XML-based configuration that Spring Boot 3+ won’t touch anymore</li><li>Reflection-heavy code (Project Jigsaw will have opinions about this)</li></ul><p>Document everything you find. This is your migration map. Without it you’re just hiking blind into a jungle. 🌿</p><h3>Step 2: The Tools That Actually Help (and the Ones That Gaslight You)</h3><h3>OpenRewrite ✅</h3><p>This is the real one. OpenRewrite is an automated refactoring tool that handles a huge chunk of migration for you. Updating Spring Boot versions, migrating JUnit 4 to JUnit 5, replacing deprecated APIs. It’s not magic but it’s close.</p><p>There’s a recipe for each LTS hop. For Java 21 specifically:</p><pre>// build.gradle<br>plugins {<br>    id(&quot;org.openrewrite.rewrite&quot;) version(&quot;latest.release&quot;)<br>}<br>rewrite {<br>    activeRecipe(&quot;org.openrewrite.java.migrate.UpgradeToJava21&quot;)<br>    setExportDatatables(true)<br>}<br>dependencies {<br>    rewrite(&quot;org.openrewrite.recipe:rewrite-migrate-java:latest.release&quot;)<br>}</pre><p>Then run:</p><pre>./gradlew rewriteRun   # Gradle<br>mvn rewrite:run        # Maven</pre><p>Then git diff. Review every change. Commit. Move on.</p><p>One important thing OpenRewrite won’t touch: your &lt;java.version&gt; in pom.xml or targetCompatibility in build.gradle. You need to update those manually before running compiler checks. Don&#39;t forget. 🚩</p><p>Run it. Review the diff. Don’t blindly commit. Some of it you’ll want, some of it you’ll leave. Use your judgment.</p><h3>jdeprscan ✅</h3><p>Built into the JDK itself. Scans your code for deprecated API usage before they blow up in your face.</p><pre>jdeprscan --class-path your-app.jar your-app.jar</pre><p>Run this before every hop. Not after. Before.</p><h3>Maven Enforcer Plugin ✅</h3><p>Lock your minimum JDK version so nobody on the team accidentally compiles against the wrong one.</p><pre>&lt;plugin&gt;<br>    &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br>    &lt;artifactId&gt;maven-enforcer-plugin&lt;/artifactId&gt;<br>    &lt;configuration&gt;<br>        &lt;rules&gt;<br>            &lt;requireJavaVersion&gt;<br>                &lt;version&gt;[21,)&lt;/version&gt;<br>            &lt;/requireJavaVersion&gt;<br>        &lt;/rules&gt;<br>    &lt;/configuration&gt;<br>&lt;/plugin&gt;</pre><h3>What Gaslights You ❌</h3><p>Any tool that says it will “fully migrate your project automatically.” No it won’t. These tools handle the mechanical stuff. The architectural decisions, the library incompatibilities, the Hibernate pain (more on that below 👇) ; that’s still on you. Every diff needs a human review. Every automated change needs a test run. Don’t skip that. Ever.</p><h3>Step 3: The Breaking Changes That Will Ruin Your Day</h3><h3>JDK 7 → JDK 8</h3><p>Mostly additive. Lambdas, Streams, Optional, the new Date/Time API. The pain here is usually indirect: libraries that weren’t ready for Java 8. Check your dependencies first.</p><h3>JDK 8 → JDK 11</h3><p>This is where people first cry. 😭</p><p>The Java EE modules got removed from the JDK. javax.xml.bind, javax.activation, all of it. Gone. You need to add them back as explicit dependencies.</p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;javax.xml.bind&lt;/groupId&gt;<br>    &lt;artifactId&gt;jaxb-api&lt;/artifactId&gt;<br>    &lt;version&gt;2.3.1&lt;/version&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;com.sun.xml.bind&lt;/groupId&gt;<br>    &lt;artifactId&gt;jaxb-impl&lt;/artifactId&gt;<br>    &lt;version&gt;2.3.1&lt;/version&gt;<br>&lt;/dependency&gt;</pre><p>Note: this gets you back to compiling. If you’re also targeting Spring Boot 3 eventually, you’ll need to migrate to the jakarta.* namespace too, but that&#39;s a separate decision and a separate hop. Don&#39;t mix them.</p><p>Also: sun.* and com.sun.* internal APIs are now strongly encapsulated. If your code or any of your dependencies used those, you&#39;ll find out fast.</p><h3>JDK 11 → JDK 17</h3><p>Project Jigsaw is now serious. Reflective access that used to work silently now throws warnings and eventually errors.</p><p>Worth knowing: Spring Boot 3 requires Java 17 as a minimum. But you don’t have to upgrade to Spring Boot 3 the moment you hit Java 17. Many teams run Java 17 + Spring Boot 2.7 for a while before tackling the Boot 3 migration. These are two separate decisions. Treat them that way. The javax.* to jakarta.* rename is a Spring Boot 3 concern, not a JDK 17 concern.</p><h3>JDK 17 → JDK 21</h3><p>Virtual threads. Project Loom ships and your thread-per-request apps can scale significantly better with almost no code change. Results vary depending on your drivers and blocking dependencies, so benchmark before declaring victory. But the potential is real. 🎉</p><p>This is also where Hibernate starts biting. Hard.</p><p>If you’re on Hibernate 5, you need to move to Hibernate 6. And Hibernate 6 is not a minor bump.</p><p><strong>What changed in Hibernate 6:</strong></p><p>Hibernate 6 moved from reading JDBC ResultSet by name to reading by position. That sounds internal but the impact is real: query results that used to map correctly can silently map wrong or throw at runtime. Especially with native queries and multi-table joins.</p><p>The @Type annotation got completely reworked. Custom type mappings you had in Hibernate 5 won&#39;t compile in Hibernate 6. You need to rewrite them using the new @JavaType / @JdbcType annotations.</p><p>@Any and @ManyToAny mappings changed behavior. If you used polymorphic associations, test everything twice. Then test it again. 🧪</p><p>The Criteria API changed enough that some queries that worked before now produce different SQL. Silent behavior changes are the worst kind and Hibernate 6 has a few of them. Check your query results, not just whether the queries run.</p><p>The hbm.xml mapping format is deprecated in Hibernate 6 and will be removed beyond 6.x. If you still have legacy XML mappings, start migrating them to annotations now.</p><h3>JDK 21 → JDK 25</h3><p>Java 25 is the latest LTS, released in September 2025. If you’re reading this before having any idea about what’s there, this section is your preview of what you will be dealing with.</p><p>The OpenRewrite UpgradeToJava25 recipe covers the mechanical changes. Among them:</p><ul><li>process.waitFor(5000, TimeUnit.MILLISECONDS) becomes process.waitFor(Duration.ofSeconds(5)) ⏱️</li><li>new java.io.StringReader(&quot;x&quot;) becomes Reader.of(&quot;x&quot;)</li><li>inflater.end() becomes inflater.close() since Inflater is now AutoCloseable</li><li>ZipError replaced by ZipException</li><li>Unused lambda params can use _ (unnamed variables, GA since Java 22 via JEP 456)</li><li>SecurityManager is effectively removed as a supported security mechanism. The class still exists but is non-functional. Any code relying on it needs to go.</li><li>Instance main methods are coming (no more public static void) but still a preview feature, not GA yet. Don&#39;t use in production without --enable-preview.</li></ul><p>But Hibernate keeps being the main source of pain. 🐛</p><p>Now the one that genuinely made my life a nightmare: IdGeneratorStrategyInterpreter.</p><p>If you had custom ID generation strategies, you were likely using or extending this class. Hibernate deprecated it in 6.0 and fully deleted it in 6.4. No replacement shim. No compatibility layer. Just gone.</p><p>Your code won’t compile. And if you have custom generators spread across 15 projects, you’ll be hunting these down one by one. 🔍</p><p>The fix is migrating to the new @IdGeneratorType annotation introduced in Hibernate 6. It&#39;s cleaner and type-safe. But it&#39;s a rewrite, not a find-and-replace.</p><pre>// Before - using the now-deleted IdGeneratorStrategyInterpreter<br>public class CustomIdGenerator implements IdentifierGenerator {<br>    @Override<br>    public Serializable generate(SharedSessionContractImplementor session, Object object) {<br>        // your logic<br>    }<br>}<br>// After - Hibernate 6+, using @IdGeneratorType<br>@IdGeneratorType(CustomIdGenerator.class)<br>@Retention(RUNTIME)<br>@Target({ FIELD, METHOD })<br>public @interface CustomGenerated {}<br>public class CustomIdGenerator implements BeforeExecutionGenerator {<br>    @Override<br>    public Object generate(SharedSessionContractImplementor session, Object owner, Object currentValue, EventType eventType) {<br>        // your logic<br>    }<br>}</pre><p>Also: from Hibernate 6.4, if you have @GeneratedValue on a non-identifier field, Hibernate now throws an AnnotationException at startup. Previous versions silently ignored it. Code that booted fine for years will suddenly refuse to start. Grep your whole codebase for @GeneratedValue before this hop. 🚩</p><p>The bottom line with Hibernate across these hops: OpenRewrite does the JDK-level stuff. Hibernate is manual work. Budget real time for it.</p><h3>Step 4: Build a Migration Plan That Won’t Make Your Team Cry 📋</h3><p>Here’s the structure that worked across 15+ projects.</p><p><strong>Phase 1: Inventory (1 week)</strong> Run all the scanning tools. Document every dependency version, every deprecated API usage, every Hibernate mapping that might be affected. Don’t fix anything yet. Just map the terrain.</p><p><strong>Phase 2: Dependency cleanup (1–2 weeks)</strong> Update all dependencies to versions that support your target JDK. Do this before touching the JDK itself. Mixing a JDK upgrade with a dependency upgrade is how you lose a week of debugging.</p><p><strong>Phase 3: One hop (1–3 weeks depending on codebase size)</strong> Change the JDK version. Run OpenRewrite. Update your build file java.version manually. Fix what OpenRewrite doesn&#39;t catch. Run the full test suite. Fix what that surfaces. Ship it. Don&#39;t move to the next hop until this one is stable in production.</p><p><strong>Phase 4: Repeat</strong> Same process for each LTS hop. The first one is the hardest. By the third one your team is doing it in their sleep.</p><h3>The Things Nobody Tells You 🤫</h3><p><strong>Your CI/CD pipeline needs updating too.</strong> Forget to update your Docker base image and you’re building with the new JDK but running with the old one in production. That’s a fun Friday afternoon. Update the pipeline before you ship each hop.</p><p><strong>Test coverage is your best friend and your worst enemy.</strong> High test coverage gives you confidence. Zero test coverage means you find out things are broken from users. If you’re in the zero camp, write at least integration tests for your critical paths before starting. You’ll thank yourself.</p><p><strong>One project at a time.</strong> If you have multiple services, don’t migrate them all simultaneously. Pick the smallest, least critical one first. Learn on it. Then bring those lessons to the rest.</p><p><strong>Communicate with your team constantly.</strong> Migration fatigue is real. People get frustrated when they’re blocked by a Hibernate mapping error at 5pm on a Friday. Keep the team in the loop, celebrate each hop that ships, and make it clear this is progress not punishment.</p><h3>What’s Waiting for You on the Other Side 🏆</h3><p>After 15+ migrations this is the part that still gets me every time.</p><p>The first time a developer on the team writes a record instead of a 40-line POJO and looks up with that face. You know the face. “Wait, that’s it?”</p><pre>// Before<br>public class RaceResult {<br>    private final int round;<br>    private final String gp;<br>    private final int points;<br><br>public RaceResult(int round, String gp, int points) {<br>        this.round = round;<br>        this.gp = gp;<br>        this.points = points;<br>    }<br>    // getters, equals, hashCode, toString...<br>}<br>// After 🎉<br>record RaceResult(int round, String gp, int points) {}</pre><p>Virtual threads that let your app handle way more load with far less overhead. Pattern matching that makes your switch statements actually readable. Stream Gatherers that let you batch, slide, and group data without collector headaches.</p><p>The language on JDK 21 is not the same language as JDK 7. It’s better. Way better. And your team deserves to write it. ✨</p><h3>The Real Cost of Staying 💸</h3><p>Every month you stay on JDK 7:</p><ul><li>Security vulnerabilities pile up with no patches coming</li><li>New hires spend their first week confused by ancient patterns</li><li>Dependencies you want to use require a newer JDK and you can’t have them</li><li>The gap between you and modern Java widens and the eventual migration gets harder</li></ul><p>The migration isn’t free. But staying isn’t free either. The bill is just quieter.</p><h3>TL;DR 🦕</h3><p>Don’t jump, hop. Scan before you touch anything. Use OpenRewrite but don’t trust it blindly. Update your build file manually. Update dependencies before the JDK. Budget real time for Hibernate. One project at a time. Ship each hop before starting the next.</p><p>65 million years ago, the dinosaurs didn’t have a choice! But , You do! 🦖</p><p>So Please <strong>Adapt, Migrate, and Survive!!!!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f1433daf4a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The History of Java: How a Failed TV Remote Project Accidentally Conquered the World]]></title>
            <link>https://medium.com/@aichalaafia1/the-history-of-java-how-a-failed-tv-remote-project-accidentally-conquered-the-world-fdd727fa1d34?source=rss-fb75cbc5abba------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdd727fa1d34</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[oracle]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[history]]></category>
            <dc:creator><![CDATA[Aicha laafia]]></dc:creator>
            <pubDate>Wed, 04 Mar 2026 09:16:11 GMT</pubDate>
            <atom:updated>2026-03-24T14:11:11.442Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Nxz1-v1rg7F7Pvhi4kisQ.png" /></figure><h3>Birth of Java: The Greatest Pivot Since Sliced Bread Switched to Toast</h3><p>Picture this: It’s 1991, and James Gosling walks into Sun Microsystems with a wild idea; what if your TV remote could run programs? What if your toaster could download recipes? What if literally every electronic device in your house was programmable?</p><p>His bosses probably thought he’d been hitting the California sunshine a bit too hard.</p><p>But they gave him a team anyway. Enter the “Green Team” ; a bunch of engineers who locked themselves in a building to create software for the <em>interactive television of the future</em>. They built a language called “Oak,” named after the majestic tree outside Gosling’s window. (Engineers: making naming decisions based on “what am I looking at right now” since forever.)</p><p><strong>Plot twist:</strong> Interactive TV was a complete flop. The technology wasn’t there, the market wasn’t there, and frankly, people in the 90s just wanted to watch Friends without their television requiring a software update.</p><p>But wait! Something else was happening. This weird “World Wide Web” thing was taking off. Web browsers were multiplying like rabbits. Everyone suddenly wanted to put programs on the internet.</p><p>In what might be the greatest pivot in tech history, the Green Team said “screw the TV remote” and pointed their language at the web instead. They renamed Oak to “Java” after the coffee they were presumably drinking by the gallon, and in 1995 dropped it on an unsuspecting world with the boldest promise in software history:</p><p><strong>“Write Once, Run Anywhere.”</strong></p><p>Translation: Write your code once, and it’ll run on Windows, Mac, Unix, your toaster (if we ever get around to that), and probably your car. No rewrites. No platform-specific headaches. No “sorry, Windows only.”</p><p>Developers everywhere called BS. Then they tried it.</p><p><em>Holy crap, it actually worked.</em></p><h3>The Evolution: Java’s Greatest Hits</h3><h3>Java 1.0 (1996): The “Holy Shit It Actually Works” Moment</h3><p>January 23, 1996: Java officially launches. The secret sauce? The Java Virtual Machine, or JVM ; basically a translator that sits between your code and whatever computer you’re running it on.</p><p>Here’s why this was mind-blowing: In 1996, if you wanted your software to run on both Windows and Mac, you basically had to write it <em>twice</em>. Different operating systems, different rules, different nightmares. C++ developers were having stress dreams about platform-specific bugs.</p><p>Java said “nah” and invented a middle layer. Your code compiles to “bytecode” (not quite machine code, not quite source code), and then the JVM on each platform translates it the rest of the way. Boom. Write once, run anywhere.</p><p>Windows developers could finally sleep at night. Mac developers stopped crying. Unix people were… well, they were still using Unix, but at least they didn’t need separate codebases anymore.</p><p>The internet collectively lost its mind.</p><h3>Java 2 (1998): Java Gets a Suit and Tie</h3><p>December 1998: Java splits its personality into three distinct editions ; J2SE (Standard Edition for normal humans), J2EE (Enterprise Edition for people who wear suits), and J2ME (Micro Edition for your Nokia phone).</p><p>This is when Java stopped being just a cool web thing and started running <em>banks</em>. J2EE gave companies the tools to build massive, industrial-strength applications. We’re talking transaction management, security frameworks, the whole enterprise enchilada.</p><p>Also, Swing showed up; a GUI toolkit that let you build desktop apps that looked… well, they looked like Java apps. Swing had a very <em>distinct</em> aesthetic. If you used software in the early 2000s and thought “this UI looks like it was designed by robots,” congratulations, you found a Swing app.</p><p>But hey, it worked cross-platform, and that’s what mattered. Beauty is in the eye of the platform-independent beholder.</p><h3>Java 5 (2004): Generics Save Lives (And Sanity)</h3><p>They called it “Java 5.0” because apparently versions 1.5 through 4.0 didn’t sound cool enough. Whatever. This version was MASSIVE.</p><p><strong>Generics arrived, and developers worldwide wept with joy.</strong> Before generics, making a list of strings looked like this:</p><pre>List myList = new ArrayList();<br>myList.add(&quot;Hello&quot;);<br>String s = (String) myList.get(0); // Cast EVERYTHING like a caveman</pre><p>After generics:</p><pre>List&lt;String&gt; myList = new ArrayList&lt;&gt;();<br>myList.add(&quot;Hello&quot;);<br>String s = myList.get(0); // Look ma, no casts!</pre><p>Type safety! The compiler could finally <em>help</em> you instead of just watching you shoot yourself in the foot!</p><p>But wait, there’s more! Enhanced for-loops meant you could write for (String s : list) instead of that iterator nonsense. Autoboxing meant you could treat primitives and objects like they weren&#39;t mortal enemies. Annotations showed up, which would eventually power Spring, Hibernate, and basically every framework that matters.</p><p>Java 5 was the language saying “hey, maybe writing code shouldn’t be painful.”</p><p>Revolutionary concept.</p><h3>Java 6 (2006): The “Actually Let’s Make It Faster” Update</h3><p>Java 6 was all about performance. The JVM got faster. The compiler got smarter. The garbage collector stopped making your application freeze like a deer in headlights (as often).</p><p>They also added the Scripting API, which meant you could run JavaScript, Groovy, and other languages <em>inside</em> Java. Why? Because sometimes you need to execute sketchy scripts from configuration files, and Java was like “sure, I’ll enable your bad decisions.”</p><p>This was also when Sun started open-sourcing Java under the GPL. Free software advocates cheered. Oracle was watching from the shadows, thinking “interesting…”</p><h3>Java 7 (2011): Oracle Takes the Wheel (And Everyone Nervously Buckles Up)</h3><p>Oracle bought Sun Microsystems in 2010, and Java got new management. Developers worldwide had <em>opinions</em> about this. Loud opinions.</p><p>But Java 7 actually shipped some nice stuff:</p><p><strong>The diamond operator:</strong> Instead of writing Map&lt;String, List&lt;String&gt;&gt; map = new HashMap&lt;String, List&lt;String&gt;&gt;() (yes, you had to type the generics TWICE like a psychopath), you could now write new HashMap&lt;&gt;(). Those two little brackets – &lt;&gt; – saved approximately 47 million keystrokes globally.</p><p><strong>Try-with-resources:</strong> Finally, you could open files without writing 15 lines of finally-block cleanup code. Just wrap it in a try statement, and Java would close everything automatically. Leaked file handles decreased by 60% overnight.</p><p><strong>Strings in switch statements:</strong> Before this, you couldn’t switch on strings. You had to use if-else chains like a primitive. Now you could be civilized about it.</p><p>Not revolutionary, but solid quality-of-life upgrades. Like adding cupholders to a car that previously had none.</p><h3>Java 8 (2014): The Renaissance Nobody Saw Coming</h3><p>Holy. Shit.</p><p>If Java 5 made the language bearable, Java 8 made it <em>beautiful</em>.</p><p><strong>Lambda expressions</strong> showed up and changed EVERYTHING. Before lambdas, if you wanted to sort a list, you wrote:</p><pre>Collections.sort(people, new Comparator&lt;Person&gt;() {<br>    public int compare(Person p1, Person p2) {<br>        return p1.getName().compareTo(p2.getName());<br>    }<br>});</pre><p>After lambdas:</p><pre>people.sort((p1, p2) -&gt; p1.getName().compareTo(p2.getName()));</pre><p>Or even better:</p><pre>people.sort(Comparator.comparing(Person::getName));</pre><p>LOOK AT THAT. It’s <em>readable</em>. You can tell what it does without a PhD in Java boilerplate!</p><p><strong>The Stream API</strong> made processing collections feel like magic:</p><pre>people.stream()<br>    .filter(p -&gt; p.getAge() &gt; 18)<br>    .map(Person::getName)<br>    .sorted()<br>    .collect(Collectors.toList());</pre><p>Functional programming came to Java, and suddenly all those Scala developers who’d been acting smug had to admit that Java was catching up.</p><p><strong>Optional class:</strong> Java’s attempt to prevent NullPointerExceptions, the billion-dollar mistake that’s probably caused more production outages than any other single programming error in history.</p><p><strong>New Date and Time API:</strong> They finally, <em>finally</em>, FINALLY replaced the disaster that was java.util.Date and java.util.Calendar. The new API actually made sense. Time zones worked correctly. Dates were immutable. Developers could parse dates without having panic attacks.</p><p>Java 8 was so good that companies are STILL using it in 2026. <em>Twelve years later!</em> It was that much of a game-changer.</p><h3>Java 9–10 (2017–2018): The Great Modularization (That Broke Everything)</h3><p><strong>Java 9</strong> dropped the Java Platform Module System (Project Jigsaw), and the community had <em>feelings</em>.</p><p>The idea was beautiful: break the massive JDK into modules so applications could ship with only the parts they needed. Want just the base language? Cool, your runtime can be 30MB instead of 200MB. Building a microservice? Only include the modules you use.</p><p>Reality was messier: Turns out, a LOT of existing code was doing sketchy things with Java’s internals. Reflection hacks. Classpath shenanigans. Accessing private APIs. All that stopped working.</p><p>Developers: “JAVA 9 BROKE MY APPLICATION!” Oracle: “Well, you were doing illegal things.” Developers: “ILLEGAL THINGS THAT WORKED FOR 15 YEARS!”</p><p>Classic software drama.</p><p>Java 9 also made JShell (a REPL for Java ; only 22 years after Python had one), improved the Javadoc HTML, and made some internal performance upgrades.</p><p><strong>Java 10</strong> showed up six months later with var, which meant you could write:</p><pre>var list = new ArrayList&lt;String&gt;();</pre><p>Instead of:</p><pre>ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();</pre><p>Was it necessary? No. Did it feel good? Yes. Type inference for the win.</p><h3>Java 11 (2018): The “Wait, New Versions Every Six Months?!” Shift</h3><p>September 2018: Oracle drops Java 11 and announces a new release model that made enterprise developers break out in a cold sweat.</p><p><strong>The new deal:</strong> Java releases every six months now. March and September, like clockwork. But only certain versions are Long-Term Support (LTS) releases, which get security updates and bug fixes for years. The others? You’re on your own after six months.</p><p>Java 11 was the first LTS under this model, which meant companies could either:</p><ol><li>Stay on LTS releases and get 3+ years of support (safe, boring, enterprise-approved)</li><li>Upgrade every six months to stay current (exciting, risky, requires a testing team that doesn’t hate you)</li></ol><p>Most companies chose option 1 and stayed on Java 11 for approximately <em>forever</em>. Seriously, walk into a random corporation in 2026, and there’s a decent chance their production systems are still running Java 11. Some have even made it to Java 17. Wild times.</p><p>The release itself brought some cool stuff:</p><ul><li><strong>New HTTP Client API:</strong> Finally replaced the ancient HttpURLConnection, which was designed when dinosaurs roamed the internet</li><li><strong>Run Java files directly:</strong> Type java HelloWorld.java without compiling first. Perfect for scripts and small utilities.</li><li><strong>Better String methods:</strong> isBlank(), lines(), strip() – simple stuff that should&#39;ve existed years ago</li></ul><p>Also, Oracle changed the licensing, which caused mass confusion and panic. Fun times!</p><h3>Java 12–16 (2019–2021): The “Ship It Every Six Months” Era</h3><p>Oracle wasn’t kidding about that release cadence. Features started flowing like craft beer at a tech conference:</p><ul><li><strong>Switch expressions</strong> (Java 12–14): Switch statements evolved from ugly break; nightmares into actual expressions that return values. Revolutionary? Maybe. Necessary? Absolutely.</li><li><strong>Text blocks</strong> (Java 13–15): Multi-line strings without making your eyes bleed! Use &quot;&quot;&quot; and suddenly JSON in Java doesn&#39;t look like hieroglyphics.</li><li><strong>Records</strong> (Java 14–16): Need a simple data class? Instead of writing 50 lines of boilerplate (constructor, getters, equals, hashCode, toString), write record Person(String name, int age) {}. DONE. Scala developers stopped laughing at us.</li><li><strong>Pattern matching for instanceof</strong> (Java 14–16): No more casting after checking the type. if (obj instanceof String s) and boom, s is available as a String. Mind. Blown.</li><li><strong>Sealed classes</strong> (Java 15–17): Control who can extend your classes. Inheritance with boundaries. Very chill.</li></ul><h3>Java 17 (2021): The LTS That Matters</h3><p>September 2021: Java 17 drops and becomes the LTS that enterprises actually care about. Why? Because Java 11 is getting old, and Java 17 bundles all those preview features from 12–16 into stable, production-ready goodness.</p><p>If you’re migrating from Java 8 or 11 in 2026, you’re probably going to Java 17. It’s stable, it’s fast, it’s got all the modern features, and it’ll be supported until 2029. The safe choice.</p><p>Features that graduated to stable:</p><ul><li>Sealed classes (finally!)</li><li>Pattern matching for switch (oh hell yes)</li><li>Strong encapsulation of JDK internals (RIP reflection hacks)</li><li>Enhanced pseudo-random number generators (for when you need fancy randomness)</li></ul><h3>Java 18–20 (2022–2023): Building Toward Something Big</h3><p>The non-LTS releases kept pushing the envelope:</p><p><strong>Java 18</strong> (March 2022): UTF-8 became the default charset (about damn time), simple web server for prototyping, code snippets in Javadoc.</p><p><strong>Java 19</strong> (September 2022): Virtual threads hit preview (Project Loom is coming!), pattern matching for switch gets better, structured concurrency appears, vector API improvements.</p><p><strong>Java 20</strong> (March 2023): More Loom refinements, scoped values (preview), record patterns graduate, pattern matching for switch hits second preview.</p><p>Oracle was clearly cooking something massive.</p><h3>Java 21 (2023): Virtual Threads Change Everything</h3><p>September 2023: The next LTS arrives, and it’s <em>massive</em>.</p><p><strong>Virtual Threads</strong> (Project Loom): This is the big one. The game-changer. The reason backend developers are actually excited.</p><p>Remember how in traditional Java, if you want to handle 10,000 concurrent requests, you need 10,000 threads, which means your server explodes because OS threads are expensive? Virtual threads solve this. They’re lightweight. REALLY lightweight. You can have <em>millions</em> of them.</p><pre>try (var executor = Executors.newVirtualThreadPerTaskExecutor()) {<br>    for (int i = 0; i &lt; 1_000_000; i++) {<br>        executor.submit(() -&gt; {<br>            // Do concurrent work without melting your server<br>        });<br>    }<br>}</pre><p>This makes writing concurrent code feel like Node.js async/await, except you get proper threading semantics. It’s beautiful.</p><p><strong>Pattern Matching for Switch</strong> (Final): No more preview! Destructure objects in switch statements:</p><pre>return switch (shape) {<br>    case Circle c -&gt; &quot;Circle with radius &quot; + c.radius();<br>    case Rectangle r -&gt; &quot;Rectangle &quot; + r.width() + &quot;x&quot; + r.height();<br>    case null -&gt; &quot;No shape&quot;;<br>};</pre><p><strong>Sequenced Collections</strong>: Finally, a proper way to work with collections that have order. First, last, reversed; all the stuff you’ve wanted since 1998.</p><p><strong>Record Patterns</strong>: Destructure records inline:</p><pre>if (obj instanceof Point(int x, int y)) {<br>    // x and y are now available<br>}</pre><p><strong>String Templates</strong> (Preview): Safer string interpolation:</p><pre>String message = STR.&quot;Hello, \{name}!&quot;;</pre><p>Java 21 is what people are migrating to in 2026. It’s the modern Java. The one with all the cool toys.</p><h3>Java 22 (March 2024): Refinement Season</h3><p><strong>Unnamed Variables &amp; Patterns</strong>: Got a value you don’t care about? Use _:</p><pre>case Point(int x, _) -&gt; &quot;X is &quot; + x; // Don&#39;t care about Y</pre><p><strong>Foreign Function &amp; Memory API</strong> hits second preview; calling native code is getting easier.</p><p><strong>String Templates</strong> continue to evolve in preview.</p><p><strong>Statements before super()</strong> (Preview): Finally! You can do logic before calling super() in constructors. Only took 29 years.</p><h3>Java 23 (September 2024): The Road to Valhalla Continues</h3><p><strong>Primitive Types in Patterns</strong> (Preview): Pattern matching gets even more powerful.</p><p><strong>Module Import Declarations</strong> (Preview): Import entire modules instead of individual classes. Cleaner code.</p><p><strong>Markdown in Javadoc</strong> (Preview): Write documentation in Markdown instead of HTML torture. FINALLY.</p><p><strong>Simplified Main</strong> (Preview): Teaching Java to beginners? You can now write void main() without all the public static ceremony.</p><p><strong>ZGC Improvements</strong>: Garbage collection keeps getting better and better.</p><p><strong>Class-File API</strong>: Manipulate bytecode without ASM or other libraries.</p><h3>Java 24 (March 2025): The Latest Non-LTS</h3><p><strong>Scoped Values</strong> (Preview): Better than ThreadLocal for virtual threads.</p><p><strong>Structured Concurrency</strong> keeps evolving.</p><p><strong>Stream Gatherers</strong> (Preview): Customize stream operations beyond map/filter/reduce.</p><p><strong>Deprecation of finalize()</strong>: It’s been deprecated forever, now it’s <em>really</em> going away.</p><p>More pattern matching refinements, more GC improvements, more performance wins.</p><h3>Java 25 (September 2025): Where We Are NOW</h3><p>Fresh off the press! Java 25 dropped just a few months ago (September 2025), and here’s what’s cooking:</p><p><strong>String Templates</strong> might finally be done-done (or maybe one more preview round; the committee is cautious with this one).</p><p><strong>Primitive Types in Patterns</strong> continues preview; they’re taking their time to get it right.</p><p><strong>Flexible Constructor Bodies</strong> advances; that “statements before super()” thing is getting refined.</p><p><strong>Class-File API</strong> graduates to final; you can now manipulate bytecode officially!</p><p><strong>Project Valhalla</strong> continues in the background; value types and primitive classes are coming, but not quite yet.</p><p>Performance improvements across the board, especially for virtual threads and GC.</p><h3>Java in 2026: The State of the Union</h3><p>We’re 31 years into Java’s journey, and it’s <em>everywhere</em>:</p><ul><li><strong>Enterprise backends</strong>: Still king. Spring Boot runs half the internet. Quarkus and Micronaut are making inroads.</li><li><strong>Android</strong>: Technically still Java-based, but Kotlin has basically won that war. Java’s there as the foundation, though.</li><li><strong>Big Data</strong>: Hadoop, Spark, Kafka, Flink; the JVM runs the data infrastructure of the world.</li><li><strong>Cloud-native</strong>: Kubernetes is written in Go, but a huge chunk of what <em>runs</em> on Kubernetes is Java.</li><li><strong>Financial systems</strong>: High-frequency trading, banking systems, payment processing; Java is the safe choice.</li><li><strong>Scientific computing</strong>: Still going strong in research institutions and universities.</li></ul><p><strong>The JVM ecosystem</strong> has exploded:</p><ul><li><strong>Kotlin</strong>: Google’s official Android language, also great for backend</li><li><strong>Scala</strong>: Data science darling (thanks, Apache Spark)</li><li><strong>Groovy</strong>: Powers Gradle, Jenkins, and a thousand build systems</li><li><strong>Clojure</strong>: Functional programming for people who miss Lisp</li></ul><h3>Why Java Refuses to Die</h3><p><strong>Backward compatibility</strong>: Code from Java 8 (2014) still runs on Java 25 (2025). Try that with Python 2 to 3.</p><p><strong>The ecosystem</strong>: Maven Central has millions of libraries. If you need to do something in Java, someone already wrote a library for it.</p><p><strong>Enterprise trust</strong>: Companies bet billions on Java. Oracle, IBM, and the OpenJDK community keep it stable and supported.</p><p><strong>The JVM itself</strong>: The JIT compiler is insanely good. GraalVM pushes it even further. The garbage collectors are world-class. The virtual threads revolution makes concurrency trivial.</p><p><strong>The release cadence</strong>: Six-month releases keep innovation flowing. LTS releases every 2 years give enterprises stability. Best of both worlds.</p><h3>What’s Next?</h3><p><strong>Project Valhalla</strong> is the big one on the horizon. Value types and primitive classes will bring massive performance improvements and new ways to model data.</p><p><strong>Project Panama</strong> is making native interop easier; calling C libraries without JNI pain.</p><p><strong>Project Loom</strong> delivered virtual threads in Java 21, but structured concurrency is still evolving.</p><p><strong>Project Leyden</strong> is working on ahead-of-time compilation and faster startup times, making Java competitive with Go and Rust for certain workloads.</p><h3>The Bottom Line</h3><p>Java went from “interactive TV remote language” to “runs the entire financial system” in 31 years. Not bad for a language named after coffee.</p><p>It survived:</p><ul><li>The dot-com bubble burst</li><li>The rise and fall of applets</li><li>Oracle acquiring Sun (RIP)</li><li>The “Java is dead” declarations every single year since 2010</li><li>The rise of Node.js, Go, Rust, Python, and a dozen other languages</li></ul><p>And it’s still here. Still innovating. Still running banks, stock exchanges, e-commerce platforms, social networks, and about three billion devices.</p><p>In 2026, Java isn’t just alive ; it’s thriving. Virtual threads made concurrency approachable. Pattern matching made code readable. The six-month release cycle keeps features flowing.</p><p>From Oak to Java, from set-top boxes to cloud platforms, from “Write Once, Run Anywhere” to “Run Everywhere, Scale Forever,” Java’s journey continues.</p><p>Not bad for a bunch of engineers, a lot of coffee, and one hell of a pivot.</p><p>☕ <em>Still brewing. Still delivering. Still Java.</em></p><h4>📚 Complete References &amp; Resources</h4><p><strong>Official Sources</strong></p><p>Java History &amp; Origins:</p><ul><li><a href="https://computerhistory.org/profile/james-gosling/">Computer History Museum — James Gosling Profile</a></li><li><a href="https://www.tech-insider.org/java/research/1995/07.html">Java: The Inside Story (1995)</a></li><li><a href="https://www.tech-insider.org/java/research/1998/05.html">Happy 3rd Birthday! — Green Team Origins</a></li><li><a href="https://en.wikipedia.org/wiki/Java_version_history">Wikipedia — Java Version History</a></li></ul><p><strong>Java 8 &amp; Lambda Expressions:</strong></p><ul><li><a href="https://openjdk.org/jeps/126">JEP 126: Lambda Expressions</a></li><li><a href="https://openjdk.org/projects/lambda/">OpenJDK Project Lambda</a></li><li><a href="http://jcp.org/en/jsr/detail?id=335">JSR 335: Lambda Expressions Specification</a></li><li><a href="https://www.infoq.com/articles/Java-8-Lambdas-A-Peek-Under-the-Hood/">Oracle: Java 8 Lambdas Under the Hood</a></li></ul><p><strong>Java 21 &amp; Virtual Threads (Project Loom):</strong></p><ul><li><a href="https://openjdk.org/jeps/444">JEP 444: Virtual Threads (Final)</a></li><li><a href="https://openjdk.org/jeps/425">JEP 425: Virtual Threads (First Preview — JDK 19)</a></li><li><a href="https://openjdk.org/jeps/436">JEP 436: Virtual Threads (Second Preview — JDK 20)</a></li><li><a href="https://inside.java/2023/10/30/sip086/">Inside.java: Virtual Threads Explained</a></li><li><a href="https://blogs.oracle.com/javamagazine/java-virtual-threads/">Oracle Java Magazine: Virtual Threads Deep Dive</a></li><li><a href="https://www.infoq.com/news/2023/04/virtual-threads-arrives-jdk21/">InfoQ: Virtual Threads Arrive in JDK 21</a></li></ul><p><strong>Java 26 &amp; Future Releases:</strong></p><ul><li><a href="https://openjdk.org/projects/jdk/26/">JDK 26 Official Page</a></li><li><a href="https://www.infoq.com/news/2026/02/java-26-so-far/">InfoQ: JDK 26 Features Overview</a></li><li><a href="https://www.happycoders.eu/java/java-26-features/">Java 26 Features with Examples</a></li></ul><p><strong>Project Valhalla (Value Types):</strong></p><ul><li><a href="https://openjdk.org/projects/valhalla/">OpenJDK Project Valhalla</a></li><li><a href="https://openjdk.org/jeps/401">JEP 401: Value Classes and Objects (Preview)</a></li></ul><p><strong>OpenJDK &amp; Community:</strong></p><ul><li><a href="https://openjdk.org/">OpenJDK Official Site</a></li><li><a href="https://openjdk.org/jeps/0">JDK Enhancement Proposals (JEPs)</a></li><li><a href="https://jcp.org/">Java Community Process</a></li></ul><h3>Learning Resources</h3><p><strong>Beginner-Friendly:</strong></p><ul><li><a href="https://www.geeksforgeeks.org/java/the-complete-history-of-java-programming-language/">GeeksforGeeks: Complete History of Java</a></li><li><a href="https://docs.oracle.com/javase/tutorial/">Oracle Java Tutorials</a></li><li><a href="https://medium.com/@aichalaafia1/list/java-for-beginners-d02ebef123fa">Java for Beginners</a> a serie I wrote personally!</li></ul><p><strong>Advanced Topics:</strong></p><ul><li><a href="https://inside.java/">Inside.java Blog</a> — Official Java team blog</li><li><a href="https://blogs.oracle.com/javamagazine/">Java Magazine — Oracle</a></li><li><a href="https://www.infoq.com/java/">InfoQ Java Topics</a></li></ul><h3>Download Java</h3><ul><li><a href="https://www.oracle.com/java/technologies/downloads/">Oracle JDK Downloads</a></li><li><a href="https://jdk.java.net/">OpenJDK Downloads</a></li><li><a href="https://www.azul.com/downloads/">Azul Zulu OpenJDK</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdd727fa1d34" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java for Beginners Recap: Understanding Core Java Concepts]]></title>
            <link>https://medium.com/@aichalaafia1/java-for-beginners-recap-understanding-core-java-concepts-659597c4688a?source=rss-fb75cbc5abba------2</link>
            <guid isPermaLink="false">https://medium.com/p/659597c4688a</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Aicha laafia]]></dc:creator>
            <pubDate>Wed, 25 Feb 2026 12:33:49 GMT</pubDate>
            <atom:updated>2026-02-25T12:38:36.920Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*M9kf_clijhMgebRV.jpeg" /></figure><p>Are you new to the world of Java programming? Perhaps you’ve just started your coding journey and are eager to dive deeper into the fundamental concepts of Java. Look no further! In this blog post, we will recap some of the core Java concepts that every beginner should understand. So grab your favorite cup of coffee, settle in, and let’s get started!</p><h4>1. Variables and Data Types</h4><p>In Java, variables are used to store data. They act as containers that hold values of different types, known as data types. Java has several built-in data types, including int, double, boolean, and String. Understanding how to declare and use variables is essential when writing Java programs. <br>for more details: <a href="https://medium.com/@aichalaafia1/java-for-beginners-part-2-understanding-data-types-and-variables-595a83e5e586">Java for Beginners Part 2: Understanding Data Types and Variables</a></p><h4>2. Control Flow Statements</h4><p>Control flow statements allow you to control the execution flow of your program. The most commonly used control flow statements in Java are if-else statements, for loops, while loops, and switch statements. These statements enable you to make decisions, iterate over collections, and perform repetitive tasks.<br>for more details: <a href="https://medium.com/@aichalaafia1/java-for-beginners-part-3-control-structures-and-loops-f09cfb3d5d85?source=list---------3-------d02ebef123fa----------------------------">Java for Beginners Part 3: Control Structures and Loops</a></p><h4>3. Methods and Functions</h4><p>Methods and functions are blocks of code that perform specific tasks. They allow you to break down your code into smaller, manageable pieces, promoting code reusability and modularity. Learning how to define and call methods is an essential skill for any Java programmer.<br>for more details: <a href="https://medium.com/@aichalaafia1/java-for-beginners-part-4-arrays-and-functions-d98e74c5950a?source=list---------4-------d02ebef123fa----------------------------">Java for Beginners Part 4: Arrays and Functions</a></p><h4>4. Object-Oriented Programming (OOP) Concepts</h4><p>Java is an object-oriented programming language, which means it revolves around the concept of objects and classes. Understanding key OOP concepts such as encapsulation, inheritance, polymorphism, and abstraction is crucial for building robust and reusable code in Java. <br>for more details: <a href="https://medium.com/@aichalaafia1/java-for-beginners-part-5-revving-up-with-object-oriented-programming-oop-4ce2f7f182b0">Java for Beginners Part 5: Revving up with Object-Oriented Programming (OOP)</a></p><h4>5. Exception Handling</h4><p>In Java, exceptions are used to handle unexpected situations or errors that may occur during program execution. Exception handling involves catching and handling these exceptions to prevent your program from crashing. It’s important to understand the different types of exceptions and how to handle them effectively. <br>for more details: <a href="https://medium.com/@aichalaafia1/java-for-beginners-part-6-lets-handle-java-errors-like-a-pro-formula-1-driver-7fecface814b">Java for Beginners Part 6: Let’s handle Java errors like a pro Formula 1 driver</a></p><h4>6. Collections Framework</h4><p>Java’s Collections Framework provides a set of classes and interfaces for storing, manipulating, and accessing groups of objects. From simple arrays to more complex data structures like lists, sets, and maps, mastering the Collections Framework is essential for efficient data management in Java. for more details: <a href="https://medium.com/@aichalaafia1/java-for-beginners-part-7-collections-powering-up-your-java-skills-with-collections-c5f2bf5e07e6">Java for Beginners Part 7: Collections — Powering Up Your Java Skills with Collections!</a></p><h4>7. Input and Output (I/O) Operations</h4><p>Java provides various classes and methods for performing input and output operations. Whether you need to read data from a file or display information on the console, understanding how to use Java’s I/O classes and methods is crucial for building interactive and data-driven applications. <br>for more details: <a href="https://medium.com/@aichalaafia1/java-for-beginners-part-10-the-epic-gastronomic-journey-of-input-output-i-o-spices-d1b89fb332f?source=list---------10-------d02ebef123fa----------------------------">Java for Beginners Part 10: The Epic Gastronomic Journey of Input/Output (I/O) Spices!</a></p><h4>Conclusion</h4><p>Congratulations! You’ve just completed a quick recap of some core Java concepts for beginners. By understanding variables and data types, control flow statements, OOP concepts, methods, exception handling, I/O operations, and the Collections Framework, you’ve built a solid foundation for your journey into Java programming.</p><p>Remember, practice makes perfect. Keep experimenting with these concepts, writing code, and exploring additional Java features. With dedication and perseverance, you’ll soon become a confident Java programmer.</p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=659597c4688a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Burnout Taught Me About Sustainable Coding Practices ‍]]></title>
            <link>https://medium.com/@aichalaafia1/what-burnout-taught-me-about-sustainable-coding-practices-c24fa1a0aeb0?source=rss-fb75cbc5abba------2</link>
            <guid isPermaLink="false">https://medium.com/p/c24fa1a0aeb0</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[burnout]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[sustainability]]></category>
            <dc:creator><![CDATA[Aicha laafia]]></dc:creator>
            <pubDate>Fri, 30 Jan 2026 14:20:53 GMT</pubDate>
            <atom:updated>2026-02-02T14:29:40.579Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WuBGUBtbOXrCEddFEY8hvA.png" /></figure><p>I didn’t burn out because I was weak or unmotivated. I burned out on very specific days for very specific technical reasons.</p><p>That’s what made the lesson clear. So here are the 5 lessons I learned:</p><h3>1️⃣ I noticed I was exhausted after touching the same parts of the codebase</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/0*wDmPWmTL9EATcKA5.jpeg" /></figure><p>Every time I had to modify <em>that</em> feature, I felt drained before even starting. Why? Too many layers for a simple change; Business logic is scattered everywhere, or nothing lives where I expected it to live</p><p><strong>Lesson #1: </strong>High cognitive load is a design flaw.</p><p>Since then, I favor fewer abstractions, logic close to the data, and finally, code you can read without jumping between files 10 times!<em> </em>My <strong>energy level became a signal</strong>.</p><h3>2️⃣ Debugging sessions were longer than the fix itself</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*dxk83HHI8J_DDsdx" /></figure><p>I remember staring at logs thinking, “This should not be this hard.” The bug was small. The system was not. Hidden behavior, framework magic, configs, or, worst of all, overriding configs.</p><p><strong>Lesson #2: </strong>Implicit behavior multiplies debug time.</p><p>Now I make configuration explicit, log decisions, not just errors, and prefer boring, predictable flows!<em> </em><strong>Less guessing. Less mental drain.</strong></p><h3>3️⃣ Performance issues always arrived as emergencies</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/0*jNOPpTc8VDnMTlxx.png" /></figure><p>Slow endpoints meant stress and rushed fixes, or Late profiling. Not because we didn’t know performance mattered. Because we postponed it.</p><p><strong>Lesson #3: </strong>Late performance work creates human emergencies.</p><p>I started measuring earlier, setting resource limits and treating efficiency as a design constraint, not a bonus!<em> </em><strong>Fewer “drop everything now” moments.</strong></p><h3>4️⃣ I was tired of fixing the same problems twice</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rrP2gZoiROA-D5Jz.jpg" /></figure><p>Burnout also came from rework. Fixing something, then breaking something else next week. Why? No tests where behavior mattered.</p><p><strong>Lesson #4: </strong>Untested behavior leaks future energy.</p><p>Sustainable code is not tested everywhere. It’s a <strong>test of what hurts to break</strong>.</p><h3>5️⃣ Good code didn’t stop burnout; it softened the fall</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*BdoFrKYVS-nV0k8jjDgX7A.png" /></figure><p>Burnout still happens. Deadlines still exist. Life still interrupts. But with readable code, tests, and observability: Coming back was easier; Context returned faster, and I didn’t feel punished for taking a break</p><p><strong>Lesson #5: </strong>Sustainable code supports recovery.</p><p>🌱 <strong>Conclusion</strong><br>Burnout didn’t teach me productivity hacks. It highlighted where my systems were wasteful, noisy, and fragile.</p><p>Fixing those parts reduced cloud, runtime, and mental costs. <strong>Not perfect. Just survivable.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c24fa1a0aeb0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ IntelliJ IDEA 101 — Part 2: The Spring Plugin We All Wanted ]]></title>
            <link>https://medium.com/@aichalaafia1/intellij-101-part-2-the-spring-plugin-we-all-wanted-6b87bbb23ce0?source=rss-fb75cbc5abba------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b87bbb23ce0</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[intellij]]></category>
            <dc:creator><![CDATA[Aicha laafia]]></dc:creator>
            <pubDate>Tue, 20 Jan 2026 14:13:56 GMT</pubDate>
            <atom:updated>2026-02-02T14:17:20.096Z</atom:updated>
            <content:encoded><![CDATA[<h3>🧠 IntelliJ IDEA 101 — Part 2: The Spring Plugin We All Wanted 🌱</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YNR6_rzE-j_z599QStSMJA.png" /></figure><p>The issue is rarely your Java code. It is what Spring resolves dynamically: beans, properties, datasources, transactions.</p><p>Instead of guessing, let’s make IntelliJ IDEA show us what Spring is actually doing 🔍</p><h3>⏳ The Problem: Spring Is Invisible at Runtime</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PkHLPQrNDLJZkVFROs2S7g.png" /></figure><p>Spring applications rely heavily on runtime behavior: the <strong>Beans are created conditionally</strong>, your <strong>configuration values override each other</strong>, the issue with <strong>Data sources changes depending on profiles</strong>, without forgetting that <strong>transactions are wrapped in proxies !!!</strong></p><p>When something breaks, you usually ask many questions :</p><ul><li>Which bean is really used?</li><li>Which property value won?</li><li>Which database am I connected to?</li><li>Is this transaction active?</li></ul><p>The standard debugger does not answer these questions! But the Spring Debugger plugin does !!</p><h3>🔌 Step 1: Install the Spring Debugger Plugin</h3><p>First things first: Install the <a href="https://plugins.jetbrains.com/plugin/25302-spring-debugger"><strong>Spring Debugger</strong></a> plugin from the IntelliJ IDEA Marketplace.<br><strong>PS: IntelliJ IDEA Ultimate is required.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dK09Ou0zBZw2Eaexhx8LYg.png" /></figure><p>Once installed, run your Spring Boot application in <strong>Debug</strong> mode 🐞. Also good to know that Spring Debugger works with:</p><ul><li>Local Run or Debug</li><li><a href="https://blog.jetbrains.com/idea/2026/01/spring-boot-debugging-now-remote/">Remote JVM Debug (JDWP attach)</a></li></ul><p>Important to know: As long as IntelliJ IDEA detects a Spring context, the Spring Debugger is enabled.</p><h3>🧩 Step 2: Inspect the Spring Context Live</h3><p>While the application is running in Debug mode, open the <strong>Spring</strong> tab in the debug tool window. This tab shows the live Spring ApplicationContext. You can see:</p><ul><li>🟢 <strong>green </strong>: Loaded beans, the one you are using in your process</li><li>⚪ <strong>transparent</strong>: Skipped beans (less beans to check)</li><li>🟡 <strong>yellow</strong>: Mocked beans in test contexts (this is where you sometimes need to be careful when mocking your beans correctly).</li></ul><p>All you need now is to click any bean to jump directly to its source or configuration. Use this when Spring injects a different implementation than the one you expected.</p><h3>🌱 Step 3: See the Actual Property Values</h3><p>Spring configuration is layered. Yes, I am talking about all the <strong>Profiles</strong>, <strong>YAML files</strong>, <strong>environment variables</strong>, and <strong>system properties</strong> used in your app. We need to keep track of the actual property value!</p><p>While paused on a breakpoint, open application.yml or application.properties. IntelliJ IDEA shows inline runtime hints like</p><pre>Runtime → staging (from ENV)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*vpF_VHSwnb2qIwDzAY_vOA.png" /><figcaption>application.yml showing outlook properties value hint</figcaption></figure><p>You immediately see which value actually won and where it came from 👀The fastest way to debug environment-related issues without adding logs!</p><h3>💾 Step 4: Verify the Active Datasource</h3><p>When your application runs in Debug mode, IntelliJ IDEA automatically detects database connections opened by Spring.</p><p>Open the <strong>Database</strong> tool window:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*1EhTPvEzf8PA3AzVzfZ0tg.png" /><figcaption>Database tool window showing active datasource</figcaption></figure><p>You can see <strong>the active datasources your Spring is currently using</strong>, <strong>verify JDBC URLs and ports</strong>, and <strong>browse schemas and tables</strong>. This works with local databases and Testcontainers. making it an instant way to confirm what&#39;s happening in the database your app is really using.</p><h3>🔍 Step 5: Inspect Beans During Debugging</h3><p>Pause execution on a breakpoint and open <strong>Evaluate Expression</strong> using Alt + F8. The Spring Debugger integrates here, too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*BsRtYoR48gjzr8Sg1RDPVA.png" /><figcaption>Evaluate Expression window with Spring bean invocation</figcaption></figure><p>You can autocomplete Spring beans and go deeper to inspect their internal state and even invoke methods directly. <strong>No restart required! </strong>Call a service method here to validate behavior mid-debug.</p><h3>⚙️ Step 6: Understand Transactions Instantly</h3><p>Stop inside a method annotated with @Transactional.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*0xQ3cunLQdxCzhwSCL86vw.png" /><figcaption>Variables view showing transaction metadata</figcaption></figure><p>In the Variables view, IntelliJ IDEA exposes transaction state, isolation level, propagation type, session or persistence context details. No extra logs. <strong>No proxy digging!</strong> The quickest way to confirm whether a transaction actually exists.</p><h3>🔥 Why This Matters</h3><p>Spring was made to hide complexity so we can keep ourselves productive. But when something breaks, that abstraction works against us! This is why the Spring Debugger removes the guesswork by showing:</p><ul><li>Which beans are active</li><li>Which configuration values are applied</li><li>Which datasource is used</li><li>How transactions behave</li></ul><p>All directly inside the debugger you already use. 💚 L<strong>ess guessing, less logging, and faster debugging.</strong></p><h3>🔗Additional Resources</h3><p>📘 Official Spring Debugger documentation <a href="https://www.jetbrains.com/help/idea/spring-debugger.html?utm_source=chatgpt.com">https://www.jetbrains.com/help/idea/spring-debugger.html</a></p><p>🎥 Spring Debugger plugin demo (JetBrains) <a href="https://www.youtube.com/watch?v=XWoivKnqsyo&amp;utm_source=chatgpt.com">https://www.youtube.com/watch?v=XWoivKnqsyo</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b87bbb23ce0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hello 2026: From a Java Dev Who Coded (and Caffeinated) Too Much in 2025 ☕]]></title>
            <link>https://medium.com/@aichalaafia1/hello-2026-from-a-java-dev-who-coded-and-caffeinated-too-much-in-2025-d89d3184fece?source=rss-fb75cbc5abba------2</link>
            <guid isPermaLink="false">https://medium.com/p/d89d3184fece</guid>
            <category><![CDATA[women-in-tech]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[sustainability]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Aicha laafia]]></dc:creator>
            <pubDate>Wed, 07 Jan 2026 17:31:02 GMT</pubDate>
            <atom:updated>2026-01-07T17:31:02.435Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KsSoJqVbJmIbRpWfYXU4aQ.png" /></figure><p>Java devs, grab your coffee! or if you’re like me, after a long sprint, maybe a double shot of espresso. Let’s talk about what actually went down in 2025 and what you need to master this year if you want to keep that “Modern Java Engineer” title without breaking a sweat</p><h3>First off: Java still refuses to die (and we love it)</h3><p>I keep telling people: Java is like that one friend who shows up to the party uninvited but brings the best snacks. 🍿 In late 2025, we got <a href="https://medium.com/womenintechnology/everything-cool-in-java-25-49db3602f826"><strong>Java 25</strong></a>, the newest LTS, and the ecosystem didn’t just survive! it flexed. We’re talking virtual thread upgrades that are finally reaching their final form and a <a href="https://developer.ibm.com/articles/java-whats-new-java25/"><strong>Class-File API</strong></a> that makes on-the-fly class generation feel like magic.</p><p>Even Microsoft is out here writing year-in-review blogs about it like it’s a Hollywood blockbuster. Check out their <a href="https://devblogs.microsoft.com/java/java-at-microsoft-2025-year-in-review/"><strong>Java at Microsoft: 2025 Year in Review</strong></a>, Java isn’t “legacy”; it’s a living, breathing powerhouse.</p><h3>What actually matters in 2026?</h3><p>If you want to be the person at the team retro who sounds smart without being pretentious, here is your 2026 survival kit:</p><h4>1. AI in Java isn’t just hype anymore 🤖</h4><p>Forget GitHub Copilot, just nagging you about semicolons. We’re moving into the era of <a href="https://spring.io/projects/spring-ai"><strong>Spring AI</strong></a> and <a href="https://github.com/langchain4j/langchain4j"><strong>LangChain4j</strong></a>. We aren’t just building apps; we’re building pipelines with embeddings and vector searches. If your app isn’t talking to an LLM to do something actually useful, you’re living in 2023.</p><h4>2. System Design is the new “Soft Skill” 🏗️</h4><p>Think of it this way: If you can’t explain why you chose Redis over Kafka without a “deer in headlights” look, things are going to get awkward. Mid-level roles now demand more than just coding; they want <a href="https://www.infoq.com/articles/java-trends-report-2025/"><strong>chaos-tolerant architectures</strong></a> and solid caching strategies.</p><h4>3. Project Valhalla is finally cooking 🍳</h4><p>We’ve been waiting, and the wait is paying off. <a href="https://openjdk.org/projects/valhalla/"><strong>Project Valhalla</strong></a> is sweetening the deal with value types and better memory layouts. It’s making high-performance Java code look a lot less “cringe” and a lot more efficient. Plus, the Vector API is maturing just in time for <a href="https://openjdk.org/projects/jdk/26/"><strong>JDK 26</strong></a>.</p><h4>4. Green Programming: Efficiency is the new Cool 🌿</h4><p>You know I can’t talk about Java without mentioning sustainability! In 2026, writing “fast” code isn’t enough; we need “<strong>green</strong>” code.If you’re new to this term, “green code,” and want to go deeper, feel free to read my series <a href="https://medium.com/@aichalaafia1/list/green-programming-101-1f5b3cdede14"><strong>Green Programming 101</strong> </a>.</p><p>Additionally, with the improvements in Java 25, such as <a href="https://openjdk.org/jeps/519"><strong>Compact Object Headers</strong></a>, we’re seeing reduced memory footprints. It’s not just good for the planet; it’s good for your cloud bill. Win-win.</p><h4>5. Non-JDK news (for the inner 12-year-old) 🎮</h4><p>The ecosystem is buzzing. <a href="https://spring.io/blog/2025/12/30/spring-shell-4-0-0-ga-released"><strong>Spring Shell 4.0</strong></a> just hit GA, but let’s talk about the real news: <a href="https://www.minecraft.net/en-us/article/removing-obfuscation-in-java-edition"><strong>Minecraft Java Edition</strong></a> finally dropped code obfuscation! Modding is about to get wild, and I’m not even slightly ashamed that this made me scream with joy.</p><h3>Your 2026 “Minimum Viable Skill Set” 🎒</h3><p>To stay employable and, more importantly, <em>cool</em>, here’s what you should be diving into:</p><ul><li><strong>Spring Boot 4 &amp; Spring AI:</strong> The bread and butter of modern backends.</li><li><strong>LangChain4j:</strong> Because <a href="https://www.javacodegeeks.com/2026/01/building-ai-powered-applications-with-spring-ai-and-langchain4j.html"><strong>vector search</strong></a> is the new SQL.</li><li><strong>Concurrency Mastery:</strong> Move beyond basic threads, get comfortable with <strong>Structured Concurrency</strong>.</li><li><strong>Supply-Chain Hygiene:</strong> Maven best practices and reproducible builds.</li></ul><h3>Final Thoughts 💭</h3><p>2026 isn’t a “pivot” year where Java tries to be something else. It’s the year Java stops apologizing for its age and starts using its wisdom. It’s owning the cloud, it’s owning the backend, and yes, it’s even owning the AI space.</p><p>So, hello 2026! May your builds stay green (in both ways!), your CI be lightning-fast, and your JVM be warm; but not <em>thermal-throttling</em> warm. 😉</p><p><strong>What are you most excited to build this year? Let’s chat in the comments! 👇</strong></p><p>#Java #SoftwareEngineering #Java25 #GreenTech #ProgrammingLife #WomenInTech #SpringAI #MinecraftModding</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d89d3184fece" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Everything Cool in Java 25 ]]></title>
            <link>https://medium.com/womenintechnology/everything-cool-in-java-25-49db3602f826?source=rss-fb75cbc5abba------2</link>
            <guid isPermaLink="false">https://medium.com/p/49db3602f826</guid>
            <category><![CDATA[women-in-tech]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Aicha laafia]]></dc:creator>
            <pubDate>Tue, 16 Sep 2025 09:55:01 GMT</pubDate>
            <atom:updated>2025-09-26T13:27:10.451Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0XZQQPFMQmh2EBNSKLtfTQ.png" /></figure><p><strong>You blink, and Java drops another upgrade.</strong><br> And this one? It’s sleek. It’s smart. It’s not just faster under the hood! It actually makes your life easier.</p><p>From pattern matching that finally respects primitives, to stream batching that makes you whisper “finally,” JDK 25 isn’t about flexing muscle. It’s about flexing <em>developer empathy</em>. 💡</p><p>So if you’re a backend warrior, a performance geek, or someone building sustainable Java systems! This one’s for you.</p><h3>🧠 Language: It Just Feels Right Now</h3><h4>🧩 Pattern Matching for Primitives (JEP 507–3rd preview)</h4><pre>Object thing = 42;<br>if (thing instanceof int i) {<br>    System.out.println(&quot;Primitive detected: &quot; + i);<br>}</pre><p>✨ Yes, int i. Not Integer. Not a cast. Just raw, clean Java that doesn’t make you jump through boxing hoops.</p><p>Switch + pattern matching + primitives = 🔥 cleaner code with zero mental tax.</p><h4>📦 Module Import Declarations (JEP 511)</h4><p>Let’s say it straight: modules were powerful, but <strong>painful</strong>. Now you can do this:</p><pre>import module java.sql;</pre><p>Meaning: you import the entire module’s exported packages. Not messy, not noisy, and no need to refactor module-info.java every time you breathe.</p><h4>🧪 Compact Source Files &amp; Instance Main (JEP 512)</h4><p>Want to run a quick Java script (and no, not talking about JavaScript here👀 ) without writing a whole class?</p><pre>void main() {<br>    System.out.println(&quot;Yes, this is valid Java now.&quot;);<br>}</pre><p>Perfect for tutorials, demos, or quick automation. More readable. Less noisy.</p><h4>🪜 Flexible Constructor Rules (JEP 513)</h4><pre>public User(String name) {<br>    validate(name);<br>    super(); // finally allowed AFTER logic<br>    this.name = name;<br>}</pre><p>This change feels small but hits hard, especially for devs who prioritize correctness and readability.</p><h4>🔁 Streams, But Smarter</h4><p>JDK 25 added new stream operations that feel like magic ✨</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c3ZbYoQImOJTXGwkTUYu2A.png" /></figure><p><strong>🍱 </strong><strong>batch(n) – break it clean</strong></p><pre>Stream.of(1, 2, 3, 4, 5, 6, 7)<br>    .batch(3)<br>    .forEach(System.out::println);</pre><blockquote><em>Output: </em>No more groupingBy hacks or custom collectors. It’s finally native.</blockquote><pre>[1, 2, 3]<br>[4, 5, 6]<br>[7]</pre><p><strong>🛝 </strong><strong>sliding(size, step) – windows without the mess</strong></p><pre>Stream.of(1, 2, 3, 4, 5)<br>    .sliding(3, 1)<br>    .forEach(System.out::println);</pre><p>Great for telemetry, F1 observability dashboards (👀), and metrics. Smooth AF.</p><p><strong>💅 </strong><strong>format() – make logs pretty</strong></p><pre>Stream.of(&quot;Ferrari&quot;, &quot;McLaren&quot;, &quot;Red Bull&quot;)<br>    .format(&quot;[%-10s]&quot;)<br>    .forEach(System.out::println);</pre><p>Structured output, styled formatting, less headache during debugging.</p><h3>🌱 Green Programming : Java’s Quiet Evolution</h3><p>If you’ve followed my work, you know I talk a lot about <strong>green software</strong> and <strong>sustainable Java</strong>. So what does JDK 25 bring to the table?</p><h4>💚 Compact Object Headers (JEP 519-final)</h4><p><strong>Less memory per object = less heap usage = smaller VMs = lower energy consumption</strong>.<br> It might look like a micro-optimization, but scaled across microservices and millions of objects, it has a real ecological impact.</p><h4>⚙️ AOT Compilation &amp; Startup Profiling (JEPs 514 &amp; 515)</h4><p>Faster startup = fewer cold starts in serverless or elastic infra = better carbon efficiency, especially in the cloud.<br> Think of it like: more CPU doing real work, less waste on warm-up.</p><h4>🧹 Generational Shenandoah GC (JEP 521)</h4><p>A low-pause GC that minimizes resource waste. Good GC strategy = fewer long pauses = happier users <em>and</em> a greener JVM.</p><p>These changes don’t scream “green,” but they reduce CPU time, memory, and JVM churn, which means fewer watts burned. 🔋</p><p>If you care about building <strong>sustainable backend systems</strong>, JDK 25 is quietly your friend.</p><h3>🧪 JVM Internals: Faster, Tighter, Meaner</h3><h4>🧠 CPU-Time Profiling (JEP 509)</h4><p>Precise CPU usage instead of just wall-time. More accurate flame graphs. Better tuning.</p><h4>🧵 Cooperative Sampling (JEP 518)</h4><p>JFR samples only when it’s safe = lower bias = better insights.</p><h4>📞 Method Tracing (JEP 520)</h4><p>Trace just the methods you care about, no agents, no bytecode mods.</p><h3>🔐 Security, Finally Modernized</h3><h4>🧾 PEM API (JEP 470)</h4><p>You can now read/write PEM-encoded certs and keys in the JDK. No more split(&quot;\n&quot;) hacks.</p><pre>var cert = Pem.decodeCertificate(pemString);</pre><h4>🔑 Key Derivation API (JEP 510)</h4><p>Use secure KDFs like PBKDF2 without reaching for BouncyCastle.</p><pre>var key = KDF.PBKDF2.derive(secret, salt, 10000, 256);</pre><p>Security teams, rejoice 🧠</p><h3>📌 Other Highlights</h3><ul><li>✅ Vector API incubated again (JEP 508) , now with Float16</li><li>💀 Removed 32-bit x86 support (JEP 503) ,It’s 2025. If your app still runs on 32-bit… well, good luck to whoever just got voluntold to migrate that fossil 🪦 Let it go. Let. It. Go. 🎶</li><li>🧪 ScopedValueCarrier for more structured thread-local semantics</li><li>📦 Better module-to-package resolution</li><li>🛠️ jar --validate now actually helps</li><li>🕒 /etc/localtime preferred over /etc/timezone on Debian-based Linux</li></ul><h3>📚 Want to Go Deeper?</h3><p>Here are official and community resources worth checking out:</p><ul><li>🔗<a href="https://jdk.java.net/25/release-notes"> Official JDK 25 Release Notes</a></li><li>🔗 <a href="https://openjdk.org/projects/jdk/25/">JEP Index for JDK 25</a></li><li>🔗 <a href="https://greensoftware.foundation/">Green Software Foundation</a></li><li>🔗 <a href="https://medium.com/@aichalaafia1/list/green-programming-101-1f5b3cdede14">My Sustainability articles</a></li><li>🔗 <a href="https://www.infoworld.com/article/3846172/jdk-25-the-new-features-in-java-25.html">Java 25 on InfoWorld</a></li></ul><h3>🏁 Final Thoughts</h3><p>Java 25 doesn’t just check boxes! It gets out of your way. You write less boilerplate. You run lighter workloads. You gain real tooling for concurrency, startup, and profiling. And if you care about <strong>green coding</strong>, Java’s headed in the right direction, no buzzwords, just solid, boring, efficient tech that helps us build better.</p><p>So whether you’re chasing microsecond performance, lower cloud bills, or less GC noise in your logs,<br> 👉 update your SDK<br> 👉 migrate your services<br> 👉 and let Java do the heavy lifting.</p><p>Stay clean, stay green! and I’ll see you in the next release. 🌱</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49db3602f826" width="1" height="1" alt=""><hr><p><a href="https://medium.com/womenintechnology/everything-cool-in-java-25-49db3602f826">Everything Cool in Java 25 🔥</a> was originally published in <a href="https://medium.com/womenintechnology">Women in Technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Green Programming 101 — Part 4: Sustainable AI with JAVA]]></title>
            <link>https://medium.com/@aichalaafia1/green-programming-101-part-4-sustainable-ai-with-java-dc87ef95d5db?source=rss-fb75cbc5abba------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc87ef95d5db</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[sustainability]]></category>
            <dc:creator><![CDATA[Aicha laafia]]></dc:creator>
            <pubDate>Mon, 12 May 2025 07:44:12 GMT</pubDate>
            <atom:updated>2025-05-12T12:24:54.834Z</atom:updated>
            <content:encoded><![CDATA[<h3>Green Programming 101 — Part 4: Sustainable AI with JAVA</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2AfNZ3yTen079gU0a35srQ.png" /></figure><p>As Java developers, we often focus on performance, scalability, and reliability. But in a world wrestling with climate change, it’s also vital to consider the environmental impact of our software, especially when it comes to AI.</p><p>In <a href="https://medium.com/womenintechnology/green-programming-101-part-3-sustainability-in-cloud-computing-b560d9d1ca98"><strong>Part 3: Sustainability in Cloud Computing</strong></a>, we explored how cloud providers, CNCF initiatives, and developers contribute to greener computing. Now, we turn our attention to AI, a field that continues to reshape industries but also demands enormous computational power.</p><p>Luckily, three powerful tools —<strong>GraalPy, RIG, and RIG AI</strong> — can help us build high-performance AI systems while minimizing energy consumption.</p><h3>Why Sustainability Matters in AI</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eiV7-IfSWamuNaB-Pvqkng.png" /></figure><p>AI continues to reshape industries and solve complex problems, but it comes with hefty computational needs:</p><ol><li><strong>Training Large Models: <br>- </strong>Some studies show that training a single, highly complex AI model can generate carbon emissions equivalent to several cars driven for their entire lifespans.<br><strong>- </strong>Articles from the <a href="https://www.technologyreview.com/">MIT Technology Review</a> illustrate how the growing size of AI models is multiplying this carbon cost.</li><li><strong>Data Center Consumption :<br>- The </strong>International Energy Agency (IEA) reports that data centers are responsible for about 1% of global electricity usage, an amount projected to grow with widespread AI adoption.<br><strong>- </strong>As more AI workloads pile up in these data centers, the energy draw increases, reinforcing the need for greener practices.</li><li><strong>Inference at Scale : <br>- </strong>The <a href="https://hai.stanford.edu/research/ai-index-2021">Stanford AI Index</a> finds that most of AI’s total energy use comes from <strong>inference</strong> once models are deployed.<br><strong>- </strong>This makes it clear we need to optimize not just training but also day-to-day usage in production.</li></ol><p>For Java developers integrating Python-based AI libraries, overhead can escalate if Python and Java run in separate environments. That’s where <strong>GraalPy</strong>, <strong>RIG</strong>, and <strong>RIG AI</strong> step in to make the process more seamless and resource-efficient.</p><h3>1. GraalPy: Bringing Python into the Java Fold</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AtAIOzz-5gNhpYwgO-8odw.png" /></figure><p><strong>What Is It?</strong><br>GraalPy is a Python runtime that’s part of the GraalVM ecosystem. It allows you to run Python code directly inside a Java application without spinning up a separate Python process.</p><p><strong>Why It’s Green</strong></p><ul><li><strong>Fewer Overheads</strong>: By eliminating a separate Python environment, you reduce CPU usage and memory overhead that would otherwise be spent orchestrating multiple runtimes.</li><li><strong>Boosted Performance</strong>: GraalVM’s Just-In-Time (JIT) compiler can optimize Python code on the fly. This not only speeds up execution but can also lower energy consumption by reducing total compute time.</li></ul><p><strong>Tip</strong>: Check out the GraalPy documentation for instructions on importing popular Python libraries (like Pandas or TensorFlow) within Java-based projects. You’ll find helpful examples on bridging function calls, handling data structures, and more.</p><h3>2. RIG: Real-Time Resource Monitoring</h3><p><strong>What Is It?</strong><br>RIG is a framework designed to track system resources: CPU usage, memory consumption, and I/O operations, in real time. Think of it as a control panel that keeps you updated on exactly how your Java application behaves under varying loads.</p><p><strong>Why It’s Green</strong></p><ul><li><strong>Spot Bottlenecks Quickly</strong>: When your AI pipeline hits unexpected CPU spikes or memory leaks, RIG makes those issues visible so you can fix them fast.</li><li><strong>Efficient Tweaks</strong>: By visualizing resource usage, you can fine-tune your code or configurations to minimize wasted cycles and wasted energy.</li></ul><p><strong>Tip</strong>: If you’re dealing with large-scale deployments, consider setting up alerts. For instance, a high CPU threshold can trigger a notification when usage surpasses a certain point, giving you the chance to intervene before costs (and carbon emissions) soar.</p><h3>3. RIG AI: Tailored for AI Workflows</h3><p><strong>What Is It?</strong><br>RIG AI is an AI-focused extension of RIG. While RIG monitors general system resources, RIG AI zeroes in on training and inference processes to measure energy consumption in a more AI-specific context.</p><p><strong>Why It’s Green</strong></p><ul><li><strong>Energy-Focused Insights</strong>: Instead of only seeing CPU or memory usage, RIG AI highlights how much power your machine learning tasks are pulling, letting you pinpoint exactly which parts of your AI workflow are hungry for resources.</li><li><strong>Hyperparameter Guidance</strong>: If certain hyperparameter settings skyrocket your energy use (like extra-large batch sizes or more training epochs than needed), RIG AI will bring that to light so you can optimize.</li></ul><p><strong>Tip</strong>: Use RIG AI in tandem with your standard ML workflow. Whether that’s TensorFlow, PyTorch, or another library. For instance, you can wrap each training cycle with monitoring code that logs energy usage, enabling you to compare how small tweaks impact performance and sustainability.</p><h3>Putting It All Together</h3><p>Now let’s dive deeper into how all these tools collaborate, giving you both clarity and control over your AI system’s environmental footprint. Imagine building an e-commerce recommendation engine in Java that leverages machine learning for personalization:</p><h4><strong>Data Preprocessing (GraalPy)</strong></h4><ul><li><strong>Step-by-step</strong>:</li></ul><ol><li>Import your Python libraries (e.g., Pandas, NumPy) within the same GraalVM instance running your Java code.</li><li>Pull customer and product data from your database and preprocess it (filtering out invalid entries, normalizing numerical features) in Python.</li><li>Directly feed these preprocessed data structures into your Java application or a Java-based storage system.</li></ol><ul><li><strong>Why This Helps</strong>: You avoid juggling a separate Python runtime, which simplifies deployment and reduces overhead. You also gain speed from JIT optimizations, making data preprocessing faster and more energy-efficient.</li></ul><h4><strong>Monitoring and Testing (RIG)</strong></h4><ul><li><strong>Step-by-step</strong>:</li></ul><ol><li>With RIG enabled, run load tests on your Java service that’s now integrated with GraalPy.</li><li>Observe CPU usage trends, memory allocation, and I/O patterns in real time, and look for any unexpected spikes.</li><li>Tune your memory settings or optimize I/O calls if you notice persistent high usage or bottlenecks.</li></ol><ul><li><strong>Why This Helps</strong>: Early detection of resource mismanagement means less wasted computing time. Optimizing your service at this stage also ensures smoother performance when you eventually deploy your AI model.</li></ul><h4><strong>Training and Inference (RIG AI)</strong></h4><ul><li><strong>Step-by-step</strong>:</li></ul><ol><li>Initiate model training using GraalPy for Python-based ML libraries (e.g., TensorFlow or PyTorch).</li><li>Have RIG AI measure energy consumption at each epoch (or each training cycle). Compare these readings when you tweak hyperparameters like learning rate, number of layers, or batch size.</li><li>Once the model is sufficiently trained, deploy it for inference in the same Java environment (still no separate Python process!). Let RIG AI keep watch during real-time predictions, measuring power usage per inference call or per batch.</li></ol><ul><li><strong>Why This Helps</strong>: By correlating training settings with energy usage, you can strike the best balance between model accuracy and sustainability. When you move into production, you’ll also have a clear view of how each inference request impacts your energy consumption, critical if you’re handling large volumes of traffic.</li></ul><h4><strong>Refinement and Scaling</strong></h4><ul><li><strong>Step-by-step</strong>:</li></ul><ol><li>Over time, examine logs from RIG and RIG AI to see if certain model updates or data distribution changes spike resource usage.</li><li>Scale up or out (adding instances) based on your real-time metrics. RIG can help you decide if a single machine is being overwhelmed; RIG AI can show if a cluster-based approach would be more energy-efficient.</li><li>Continuously refine your model or architecture, ensuring each step is guided by resource metrics; no more guesswork.</li></ol><ul><li><strong>Why This Helps</strong>: Operating at scale can amplify inefficiencies. By staying data-driven, you ensure your systems stay lean and green, even as usage grows.</li></ul><h3>Final Thoughts</h3><p>Creating AI systems that are powerful, user-friendly, and planet-friendly isn’t just a pipe dream! It’s entirely possible with the right tools. By leveraging <strong>GraalPy</strong> for streamlined Python-Java integration, <strong>RIG</strong> for resource transparency, and <strong>RIG AI</strong> for AI-specific energy insights, you’ll be able to:</p><ul><li>Deliver high-performance applications with minimal overhead.</li><li>Keep a close eye on resource use, preventing costly inefficiencies.</li><li>Actively reduce the carbon footprint of your AI workloads.</li></ul><p>In short, you’ll save on operational costs, offer snappier performance to your users, and help preserve the environment all at once. If you’re looking to future-proof your development practices, these three tools are a great place to start.</p><h3>Useful Resources</h3><ul><li><a href="https://www.graalvm.org/latest/reference-manual/python/"><strong>GraalPy Documentation</strong></a> : Learn more about embedding Python within Java via GraalVM.</li><li><a href="https://www.technologyreview.com/"><strong>MIT Technology Review</strong></a> : Articles about AI’s carbon footprint and sustainability challenges.</li><li><a href="https://hai.stanford.edu/research/ai-index-2021"><strong>Stanford AI Index</strong></a> : Detailed reports on AI trends, including energy usage data.</li><li><strong>International Energy Agency (IEA)</strong> : Insights and statistics on data center power consumption.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc87ef95d5db" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>