Backend Development 17 min read

Technical Accumulation and Work Insights: Code Standards, SQL Optimization, Transaction and Connection‑Pool Tips

This article shares practical Java backend engineering advice—including module layout, code‑level conventions, SQL execution‑plan understanding, index usage, transaction handling, connection‑pool tuning—as well as personal work‑habit reflections and career‑development suggestions for developers.

Java Captain
Java Captain
Java Captain
Technical Accumulation and Work Insights: Code Standards, SQL Optimization, Transaction and Connection‑Pool Tips

1. Technical Accumulation

(1) Code Standards – A typical web application should be divided into three modules: core , service , and web . The web module contains only controllers, the service module holds interfaces, DTOs and their implementations, while business logic resides in core . This layered design keeps dependencies clear and eases maintenance.

Backend projects are usually organized into an external‑interface layer, a service layer, and a DAO layer. DAO interacts with the database, service contains most business logic, and the external‑interface layer exposes APIs to other modules. Common utilities and constants belong in a common package.

Additional coding tips: use thread pools instead of creating raw threads, set reasonable pool sizes (usually ≤50), pre‑allocate collection capacities, place the most likely conditions first in if…else chains, compare constants before variables, minimize work inside synchronized blocks, avoid SELECT * , use pagination for large result sets, and keep methods short and well‑named.

(2) SQL Standards and Performance Optimization – Understand execution plans: they decide index usage, join order, and sorting. MySQL supports only nested‑loop joins. Optimize by creating appropriate indexes (ordinary, unique, single‑column, multi‑column, full‑text) and avoid patterns that invalidate indexes such as leading wildcards in LIKE , OR / IN on indexed columns, functions on indexed columns, and range queries on non‑leftmost index columns. Limit the number of indexes per table (≤5) and avoid duplicate indexes. Use EXPLAIN to inspect plans.

(3) Transaction Advice – Log operations in independent transactions to prevent loss on failures, and keep transactions short; move non‑critical logic outside the transaction scope.

(4) Database Connection‑Pool Settings – Important parameters include initialSize , minIdle , maxIdle , maxActive , maxWait , validationQuery , minEvictableIdleTimeMillis , and timeBetweenEvictionRunsMillis . Typically timeBetweenEvictionRunsMillis should be 1/5 to 1/10 of minEvictableIdleTimeMillis .

(5) Front‑end Tips – Compress images before use, use rem units for responsive design, and calculate font‑size based on screen width (e.g., width/320*16 ).

2. Work Insights

Communication & Collaboration – Proactively express ideas clearly, listen instead of complaining, and seek guidance when tasks feel overwhelming.

Record‑Keeping & Issue Tracking – Document meeting notes and debugging steps to avoid losing context and to prevent missing requirements.

Clear Thinking & Efficiency – Outline logic and requirements before coding to improve speed and quality.

Boundaries & Initiative – Recognize your responsibilities; offer suggestions only when appropriate.

Mental Attitude – Maintain a positive mindset despite setbacks.

Sustainable Development – Focus on code maintainability and extensibility, and propose improvements rather than merely following product specifications.

3. Learning Direction & Career Development

Breadth vs. Depth – Adopt a “wide‑then‑deep” approach: learn enough to apply a technology, then deepen knowledge as needed.

Business Experience – Accumulate domain knowledge; senior roles often value business insight as much as technical skill.

Project‑Management Experience – Managers gain broader perspective, better coordination ability, and higher market value.

Effective Learning Habits – Choose quiet environments, limit distractions, and allocate dedicated study time.

Seizing Learning Opportunities – Follow curiosity, investigate unfamiliar concepts, and dig into root causes of problems rather than accepting quick fixes.

Choosing a Career Path – Assess whether you prefer deep technical research (e.g., big data, cloud, architecture) or business‑oriented development, and align your efforts accordingly.

4. Life Reflections

Good vs. Bad Life States – Beware of stagnation; set goals and maintain curiosity to avoid drifting.

Personal Aspirations – Strive for steady growth, continuous learning, and the habits that shape the person you wish to become.

Javabackend-developmentPerformance TuningSQL OptimizationCode Standards
Java Captain
Written by

Java Captain

Focused on Java technologies: SSM, the Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading; occasionally covers DevOps tools like Jenkins, Nexus, Docker, ELK; shares practical tech insights and is dedicated to full‑stack Java development.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.