<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Database Sharding on miti99</title><link>https://miti99.com/en/tags/database-sharding/</link><description>Recent content in Database Sharding on miti99</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 16 Nov 2026 17:39:19 +0700</lastBuildDate><atom:link href="https://miti99.com/en/tags/database-sharding/index.xml" rel="self" type="application/rss+xml"/><item><title>Newsletter #3</title><link>https://miti99.com/en/post/2025/02/23/</link><pubDate>Sun, 23 Feb 2025 00:00:00 +0700</pubDate><guid>https://miti99.com/en/post/2025/02/23/</guid><description>&lt;i&gt;
Hello everyone, another weekend has rolled around—sit back, relax, and enjoy MiTi's Newsletter #3.
&lt;/i&gt;
&lt;h2 id="java"&gt;&lt;a href="https://www.youtube.com/watch?v=y26XGt8d_kI" rel="noopener noreferrer"&gt;Java&amp;rsquo;s Plans for 2025 - Inside Java Newscast #83&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Episode #83 of the Inside Java Newscast from the official Java channel surveys Java&amp;rsquo;s roadmap for 2025 across the major OpenJDK projects: Babylon, Loom, Leyden, Lilliput, Panama, and Valhalla. For each project, the video recaps what has been accomplished so far and what is planned next, saving Project Amber for a dedicated follow-up episode. It is a quick way to get the big picture of where the Java language and platform are headed.&lt;/p&gt;
&lt;h2 id="why-you-should-learn-kotlin-in-2025"&gt;&lt;del&gt;&lt;a href="https://dev.to/empiree/why-you-should-learn-kotlin-in-2025-47g0" rel="noopener noreferrer"&gt;Why You Should Learn Kotlin in 2025&lt;/a&gt;&lt;/del&gt;&lt;/h2&gt;&lt;p&gt;&lt;del&gt;This article on Dev.to encourages developers to learn Kotlin in 2025, highlighting its modern features, Java interoperability, and versatile applications. The post also discusses the job market and salary potential for Kotlin developers.&lt;/del&gt;&lt;/p&gt;
&lt;h2 id="mastering-java-logging-best-practices-for-effective-application-monitoring"&gt;&lt;a href="https://dev.to/nithinbharathwaj/mastering-java-logging-best-practices-for-effective-application-monitoring-20h7" rel="noopener noreferrer"&gt;Mastering Java Logging: Best Practices for Effective Application Monitoring&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This Dev.to article rounds up best practices for logging in Java applications. The author recommends pairing SLF4J as the logging facade with Logback as the underlying implementation so you can swap logging frameworks without touching application code, and explains how to choose appropriate log levels from TRACE to FATAL to avoid both missing critical errors and flooding alerting systems (the post mentions FATAL, though SLF4J and Logback only define TRACE, DEBUG, INFO, WARN, and ERROR). It also walks through structured JSON logging with &lt;code&gt;logstash-logback-encoder&lt;/code&gt; and using MDC (Mapped Diagnostic Context) to automatically attach contextual metadata like request IDs or user IDs to every log line.&lt;/p&gt;
&lt;p&gt;The second half focuses on performance and operations: using asynchronous appenders, avoiding expensive computations inside logging calls, and deferring message construction (in SLF4J 2, you can pass a &lt;code&gt;Supplier&lt;/code&gt; via the fluent logging API). On the security front, the author stresses masking sensitive data such as credit card numbers and passwords. Finally, the post covers centralized log aggregation with the ELK stack or Graylog, along with log rotation and retention policies to keep disks from filling up.&lt;/p&gt;
&lt;h2 id="fixed-window-counter-rate-limiter-redis--java"&gt;&lt;a href="https://foojay.io/today/fixed-window-counter-rate-limiter-redis-java/" rel="noopener noreferrer"&gt;Fixed Window Counter Rate Limiter (Redis &amp;amp; Java)&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This foojay.io tutorial walks through building a Fixed Window Counter rate limiter using Redis and Java. The algorithm divides time into fixed intervals, counts requests within each interval, and rejects requests once the threshold is exceeded; its main advantage is simplicity, though bursts of traffic near the boundary between two windows can let twice the allowed rate through. The implementation uses Jedis with a dedicated key per client: it reads the current counter with &lt;code&gt;GET&lt;/code&gt;, and then inside a &lt;code&gt;MULTI&lt;/code&gt;/&lt;code&gt;EXEC&lt;/code&gt; transaction increments the counter with &lt;code&gt;INCR&lt;/code&gt; and sets the TTL using &lt;code&gt;EXPIRE&lt;/code&gt; with the &lt;code&gt;NX&lt;/code&gt; flag so the expiration is only set when the key is first created rather than extending the window on every request.&lt;/p&gt;
&lt;p&gt;The post also demonstrates how to test the rate limiter using Redis TestContainers, JUnit 5, and AssertJ, covering key scenarios: requests within the limit are allowed, requests exceeding the limit are rejected, the counter resets once the window expires, separate clients maintain independent counters, and rejected requests do not increment the counter. Note that because the initial &lt;code&gt;GET&lt;/code&gt; and threshold check happen outside the &lt;code&gt;MULTI&lt;/code&gt;/&lt;code&gt;EXEC&lt;/code&gt; transaction, concurrent requests can still race past the limit; stricter enforcement requires a Lua script or &lt;code&gt;WATCH&lt;/code&gt; with retries.&lt;/p&gt;
&lt;h2 id="how-jvm-handles-exceptions"&gt;&lt;a href="https://foojay.io/today/how-jvm-handles-exceptions/" rel="noopener noreferrer"&gt;How JVM handles exceptions&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This foojay.io article explains how the Java Virtual Machine (JVM) handles exceptions at the bytecode level. Each method can carry an exception table where every entry specifies a protected bytecode range (&lt;code&gt;from&lt;/code&gt;, &lt;code&gt;to&lt;/code&gt;), a handler jump target (&lt;code&gt;target&lt;/code&gt;), and the exception type to catch—or &lt;code&gt;any&lt;/code&gt; for handlers that catch all throwables. When an &lt;code&gt;athrow&lt;/code&gt; instruction executes, the JVM pops the exception object from the operand stack and searches the current method&amp;rsquo;s exception table for a matching handler; if none is found, it unwinds the call stack frame by frame. If the exception remains uncaught all the way up the call chain, the active thread terminates after running its uncaught exception handler.&lt;/p&gt;
&lt;p&gt;The author also dissects how the compiler translates &lt;code&gt;try-catch-finally&lt;/code&gt; blocks into bytecode. In the example, the &lt;code&gt;finally&lt;/code&gt; block&amp;rsquo;s bytecode is duplicated along the normal execution path, while &lt;code&gt;any&lt;/code&gt; entries in the exception table route control flow through the &lt;code&gt;finally&lt;/code&gt; block whenever an exception is thrown inside &lt;code&gt;try&lt;/code&gt; or &lt;code&gt;catch&lt;/code&gt;. It is a great read if you want to see what actually happens under the hood when an exception is thrown.&lt;/p&gt;
&lt;h2 id="database-sharding-explained"&gt;&lt;a href="https://architecturenotes.co/p/database-sharding-explained" rel="noopener noreferrer"&gt;Database Sharding Explained&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This Architecture Notes piece explains database sharding—the technique of partitioning data across multiple machines when a single database server can no longer handle the load. Before reaching for sharding, the author advises exhausting simpler alternatives: doing nothing if there isn&amp;rsquo;t a clear bottleneck yet, scaling vertically with bigger hardware, adding read replicas to offload read traffic, or moving specific workloads to specialized stores like Elasticsearch for search or S3 for large blobs.&lt;/p&gt;
&lt;p&gt;The article then covers three primary sharding strategies: hash-based sharding (distributes data evenly but makes resharding painful), range-based sharding (requires a lookup table and a well-distributed shard key to avoid hot spots), and relationship-based sharding (keeps related entities together on the same shard). The author clarifies the role of the shard key, distinguishes logical shards from physical shards, and introduces two-phase commit (2PC) as a way to coordinate atomic transactions across multiple shards—at the cost of extra write latency and significant complexity. The overarching message: sharding unlocks horizontal scale, but comes with a heavy operational burden.&lt;/p&gt;
&lt;h2 id="protecting-your-time-from-predators-in-large-tech-companies"&gt;&lt;a href="https://www.seangoedecke.com/predators/" rel="noopener noreferrer"&gt;Protecting your time from predators in large tech companies&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In this post, Sean Goedecke warns high-performing engineers at large tech companies about people who constantly try to hijack their time—whom he calls &amp;ldquo;predators.&amp;rdquo; Two archetypes stand out: product managers from other teams who slide into DMs asking for a &amp;ldquo;quick fix&amp;rdquo; to bypass official prioritization channels, and underperforming engineers who lean on others as a substitute for learning on their own, claiming credit for the resulting work without acknowledging the help.&lt;/p&gt;
&lt;p&gt;To protect yourself, the author advises spotting asymmetric requests—where the requester puts in minimal effort while expecting hours of work from you—and matching their level of effort in your response. Move private requests into public channels so your contributions are visible and your manager stays in the loop. He also makes sure to distinguish legitimate demands on your time: helping your own manager, your reports, or junior teammates who are genuinely ramping up is part of the job. Above all, remember that shipping your own assigned projects is your primary responsibility.&lt;/p&gt;
&lt;h2 id="how-to-improve-your-wfh-lighting-to-reduce-eye-strain"&gt;&lt;a href="https://rustle.ca/posts/articles/work-from-home-lighting" rel="noopener noreferrer"&gt;How to improve your WFH lighting to reduce eye strain&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This post on rustle.ca shares practical ways to set up your work-from-home lighting to reduce eye strain. The author identifies three main culprits: imperceptible monitor flicker (PWM), especially when screen brightness is turned down and the monitor is the sole light source in the room; high-contrast environments such as harsh window glare or unevenly lit rooms; and focusing at a fixed distance for hours on end. For the last issue, the author recommends the 20/20/20 rule: every 20 minutes, look at something at least 20 feet (about 6 meters) away for at least 20 seconds.&lt;/p&gt;
&lt;p&gt;Concrete recommendations include making the most of natural daylight, using sheer curtains to diffuse direct sunlight rather than blocking it completely, placing multiple indirect light sources around the room to eliminate dark corners, choosing dimmable, flicker-free bulbs with a high Color Rendering Index (CRI) and a warm color temperature around 2700K, and adding a desk lamp or monitor bias lighting matched roughly to your screen&amp;rsquo;s brightness.&lt;/p&gt;
&lt;h2 id="working-fast-and-slow"&gt;&lt;a href="https://www.seangoedecke.com/working-fast-and-slow/" rel="noopener noreferrer"&gt;Working fast and slow&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Sean Goedecke argues that uneven productivity isn&amp;rsquo;t a flaw to be fixed; instead, he deliberately alternates between two working modes. During high-focus states, complex problems feel effortless, so he channels that energy into high-impact tasks, blocks out distractions, and works for hours at a stretch. However, this state burns through a finite internal reservoir of energy that takes time to recharge.&lt;/p&gt;
&lt;p&gt;When focus is low, he switches to lighter work such as knocking out easy tickets, reviewing pull requests, or unblocking other projects. Trying to force hard engineering work while unfocused, he notes, only introduces bugs that take longer to fix than simply waiting for focus to return—and usually gives you a headache to boot. This two-speed rhythm also aligns naturally with the cadence of large tech companies, where quiet maintenance periods alternate with high-stakes crunches that demand everything you&amp;rsquo;ve got.&lt;/p&gt;
&lt;h2 id="bonus"&gt;Bonus&lt;/h2&gt;&lt;h3 id="bonus-1-interesting-images-from-bytebytego"&gt;Bonus #1: Interesting images from &lt;a href="https://bytebytego.com/" rel="noopener noreferrer"&gt;ByteByteGo&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;img src="https://substack-post-media.s3.amazonaws.com/public/images/fe9062b4-fd0e-4530-8e20-eea854b8490e_2250x2814.png" alt="Top Strategies to Reduce Latency"&gt;
&lt;img src="https://substack-post-media.s3.amazonaws.com/public/images/9c309ad3-78a8-4511-a6f2-e69c06d5c500_1280x1566.gif" alt="The Ultimate API Learning Roadmap"&gt;
&lt;img src="https://substack-post-media.s3.amazonaws.com/public/images/a44f9f4b-193d-484e-bbf1-169751104380_1280x1568.gif" alt="10 Essential Components of a Production Web Application"&gt;
&lt;img src="https://substack-post-media.s3.amazonaws.com/public/images/d5155be3-163d-479c-a75e-632e0f98dd36_3006x3453.jpeg" alt="How do we design effective and safe APIs?"&gt;
&lt;img src="https://substack-post-media.s3.amazonaws.com/public/images/aad520f5-00d9-4606-af4b-fdb5d1ac63c4_1600x1483.png" alt="Code First v.s. API First"&gt;
&lt;img src="https://substack-post-media.s3.amazonaws.com/public/images/bb375f63-bf06-4956-b3a3-914fd6aa2d91_1280x1664.jpeg" alt="Oauth 2.0 Explained With Simple Terms"&gt;
&lt;img src="https://substack-post-media.s3.amazonaws.com/public/images/c1155e03-c3dc-4192-8e05-e6b87dc6a574_1280x1664.gif" alt="Session, Cookie, JWT, Token, SSO, and OAuth 2.0 Explained in One Diagram"&gt;&lt;/p&gt;
&lt;h3 id="bonus-2-other-interesting-links"&gt;Bonus #2: Other interesting links&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="https://openalternative.co/self-hosted" rel="noopener noreferrer"&gt;Self-hosted Alternatives to Popular Software&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;This post was rewritten by Claude Code with Opus 5.5 on 27/09/2026; reviewed and edited by Codex with GPT 6.1 Sol on 09/11/2026, and re-verified by Claude Code with Sonnet 5.5 on 16/11/2026.&lt;/em&gt;&lt;/p&gt;</description></item></channel></rss>