Reference

Search the archive or browse every post grouped by topic. For the chronological feed, see the home page or the RSS feed.

Fastest MS SQL Inserts (series)

A measured deep-dive into how to insert data into SQL Server from Java — 8 parts, 4,222 benchmark runs, 50 takeaways. Start with Part 1 if you're new; Part 8 contains the executive summary and final ranking of 33 strategies.

#PostKey finding
1Hibernate BatchingBatched persist() is 6.6× faster than default saveAll()
2JDBC StrategiesBulk API wins at 492 ms vs 2,423 ms for JDBC PreparedStatement
3Multi-Value INSERT200 values per statement is the sweet spot (4-5× faster than single-row)
4Bulk Copy FlagOne connection-string flag — useBulkCopyForBatchInsert=true — gives 2-2.5× speedup
5Hibernate TuningPersistable + StatelessSession close 80% of the gap to raw JDBC
6Parallel Threads4 threads × Bulk API = 330 ms — the Java-client ceiling
7Index Impact5 non-clustered indexes slow inserts 11× regardless of strategy
8TVP, JDBC, Full RankingINSERT…SELECT = 319 ms — the absolute fastest overall path

Java performance

PostKey finding
What Is Memory Churn and How to Avoid It in JavaShort-lived allocations break CPU cache locality; two patterns to fix
Data-Oriented Programming in Java: Move Data to FunctionsImmutable records + pure functions beat deep object hierarchies

Java fundamentals

PostKey finding
Safe Zip Extraction in Java: Zip Slip, Bombs, Limits6 thresholds to enforce before touching disk or memory
How to Use Case Insensitive String in Hash MapCustom wrapper class — no new strings, no copies
How to Write Classes With Multiple Case Insensitive StringsMemory-efficient alternatives to per-field wrappers
Setting up Junit 5 Parallel Test Execution With MavenSurefire config + the catch of shared resources

Learning & career

PostKey finding
How to Learn Functional Programming in JavaThe FP patterns that stuck in production code — and the ones that didn't
10 Mistakes Java Developers Make Early OnNot writing tests, no refactoring, no code reviews, no asking for help
Why Should You, as a Software Developer, Learn Soft Skills?Five concrete reasons soft skills matter more than you think

Test your knowledge

Think you've got the series down? Try the Fastest MS SQL Inserts quiz — 10 questions, with answers linked back to the right post.