RSS feed [root] /design /weblog




login:

password:

title search:




 


Sun Sep 10 16:25:08 HKT 2017

design



(google search) (amazon search)
second
download zip of files only

Wed Sep 20 10:02:11 HKT 2017 From /weblog/design

Implementation


Tired with duplicating Try-Catch for resource acquisition? Can try to create proxy method - http://hamletdarcy.blogspot.com[..]clarative-synchronization-with-java.html

Discussion of naming of if block - http://blog.objectmentor.com/articles/2008/09/26/if-methods-redux

Factors for choosing a strategic technology stack, runtime performance is not a factor for him, probably good idea - http://jchyip.blogspot.com[..]1/04/factors-for-choosing-strategic.html

Don't think , stay focus - http://www.threeriversinstitute.org/blog/?p=594

Using class name as variable name is a bad thing? I doubt about it, but interesting idea - http://www.warski.org/blog/2013/01/dry-parameter-names/

The problem of using generic name - http://martinfowler.com/bliki/TransparentCompilation.html

Beware of where memory allocated, sometime there is no off side for lazy initalization - http://plumbr.eu[..]ou-dare-to-change-hashmap-implementation

Some suggestion of how to code in order to prevent unreproducible bugs - http://googletesting.blogspot.hk[..]4/02/minimizing-unreproducible-bugs.html

More careful to check null - http://blog.jooq.org[..]et-paranoid-java-programming-techniques/

http://www.infoq.com/cn/articles/wisdom-of-programming

The fewer conditions you test for, the better your code “tastes”. - https://medium.com[..]ding-requirement-99749f37684a#.1glkhe7np

Think twice before running a loop - https://blog.jetbrains.com/idea/2017/08/code-smells-iteration

Example of how to remove mutation status - https://blog.jetbrains.com/idea/2017/08/code-smells-mutation

(google search) (amazon search)


Sun Sep 10 16:25:08 HKT 2017 From /weblog/design

Architecture


Top Ten Software Architecture Mistakes - http://www.infoq.com/news/2007/10/top-ten-architecture-mistakes

Discussion about the balance of upfront design - http://blog.objectmentor.com[..]4/25/the-scatology-of-agile-architecture

There is no conflict in agile and architecture - http://www.andrejkoelewijn.com[..]s-no-conflict-in-agile-and-architecture/

http://c2.com/cgi/wiki?HexagonalArchitecture

Experience of build instead of buy - http://arstechnica.com[..]uy-one-companys-decision-to-go-it-alone/

Problem of too many layer - http://johannesbrodwall.com[..]/10/the-madness-of-layered-architecture/

http://edmundkirwan.com/general/simple.html

http://blog.schauderhaft.de[..]are-architect-here-is-your-reading-list/

Sometime it is worth to build to throw - http://martinfowler.com/bliki/SacrificialArchitecture.html

Business Transactions
External Dependencies
Caching Strategy
Garbage Collection
Application Topology
http://blog.appdynamics.com[..]s-to-capture-in-enterprise-applications/

invent a solution the majority of whose components depend on no others with those few components whose task it is to compose those other components being left largely to coordination roles. - http://edmundkirwan.com/general/simple.html

http://blog.cloudera.com[..]ting-started-with-big-data-architecture/

Twitter - http://www.infoq.com/cn/articles/twitter-architecture-evolution http://highscalability.com[..]tter-handles-3000-images-per-second.html

Suning, more on HTTP - http://www.infoq.com[..]oduct-details-system-architecture-design

Decision - https://javax0.wordpress.com/2016/05/04/architects-dont-decide/

Some suggestion of making system simple, well, but the suggestion itself it is that simple - https://www.infoq.com/articles/driving-architectural-simplicity

https://medium.com[..]ural-patterns-in-a-nutshell-a0b47a1e9013

(google search) (amazon search)


Thu Aug 31 10:36:38 HKT 2017 From /weblog/design

logging


http://www.codemonkeyism.com[..]08/12/16/7-good-rules-to-log-exceptions/ - look obvious but a lot of program still make those mistakes.

Do you prefer log more or log smarter? It is good to log smart but if you log more, even if you not smart enough, you still have the data. - http://www.codinghorror.com/blog/archives/001192.html

Basic log techniques - http://www.ddj.com/cpp/212902973?cid=RSSfeed_DDJ_All

Advances and Challenges in Log Analysis - http://queue.acm.org/detail.cfm?id=2082137&ref=fullrss

Filtering only useful stacktrace - http://www.javacodegeeks.com[..]ter-irrelevant-stack-trace-lines-in.html

Some suggestion about logging - http://www.javacodegeeks.com[..]/10-tips-proper-application-logging.html and http://googletesting.blogspot.com.au/2013/06/optimal-logging.html

9 Logging Sins in Your Java Applications, the "Logging Plain User Input" is a good one - https://dzone.com[..]9-logging-sins-in-your-java-applications

(google search) (amazon search)


Tue Aug 29 10:34:21 HKT 2017 From /weblog/design

documentation


Comment about the java document of jdk8 - http://marxsoftware.blogspot.com.au[..]14/03/illuminating-javadoc-of-jdk-8.html

Thoughts On Comments - http://blog.codefx.org[..]ques/documentation/thoughts-on-comments/

The Art of Crafting Architectural Diagrams - https://www.infoq.com/articles/crafting-architectural-diagrams http://www.infoq.com/cn/articles/crafting-architectural-diagrams

(google search) (amazon search)



Wed Aug 09 11:37:20 HKT 2017 From /weblog/design

null


Use present and absent rather than NULL - http://binkley.blogspot.com/2012/01/better-than-null.html

Propose of enhancement, null handelers and null reference - http://shemnon.com[..]01/null-handelers-and-null-refere-1.html

How null breaks polymorphism - http://eureka3d.com[..]s-polymorphism-or-the-problem-with-null/ http://eureka3d.com[..]orphism-or-the-problem-with-null-part-2/

Discussion about forbid NULL as parameter and return - http://javablog.co.uk[..]5/07/null-parameters-and-returning-null/

Default object in C# - http://www.kodefuguru.com[..]t/2012/09/25/Default-Objects-with-C.aspx

Discussion about using optional - http://blog.jooq.org/2015/08/20/divided-we-stand-optional/

Some suggest about do something better than use null - https://blog.jetbrains.com/idea/2017/08/code-smells-null

(google search) (amazon search)


Tue Aug 08 18:12:08 HKT 2017 From /weblog/design/distribute

event


Event Bus Implementation(s) - https://hackernoon.com/event-bus-implementation-s-d2854a9fafd5 http://www.infoq.com[..]2017/08/Summary-event-bus-implementation

(google search) (amazon search)


Thu Aug 03 18:22:14 HKT 2017 From /weblog/design

refactoring


http://c2.com/cgi/wiki?RefactoringLanguage

Refactoring to Patterns Catalog - http://www.industriallogic.com/xp/refactoring/catalog.html

Article talk about the book: http://www.oreillynet.com/ruby/blog/2006/03/transformation.html

Catagories smell into "smell in class" and "smell between class" - http://www.codinghorror.com/blog/archives/000589.html

Known but good to remind http://www.thecodejunkie.com[..]10/01/6-steps-to-master-refactoring.html

An experience sharing - http://www.javacodegeeks.com[..]m/2011/05/refactor-hudson-god-class.html http://www.peterprovost.org[..]treme-Refactoring-with-Brian-Button.aspx

Refactoring should not introduce bug... - http://jchyip.blogspot.com[..]01/so-why-are-you-refactoring-again.html

A way to have formal refactoring, through Feature Clustering, Rapid Scratch Refactoring and Twisting Classes - http://www.thekua.com[..]rom-michael-feathers-brutal-refactoring/

Not all code change is refactoring - http://parlezuml.com/blog/?postid=850 , and

Some common issues about refactoring code in a team - http://www.rickylui.com[..]/2008/01/28/dont-be-a-refactoring-bigot/ http://blog.joepoon.com[..]01/dangers-of-premature-refactoring.html , beware taking the balance - http://www.makinggoodsoftware.com[..]ith-beautiful-code-the-refactor-syndrome

Refactory if needed - http://dreamhead.blogbus.com/logs/24874404.html

Refactoring, when start, when stop? - http://martinfowler.com/bliki/OpportunisticRefactoring.html

Refactoring metric - http://www.grahambrooks.com[..]rics-based-refactoring-for-cleaner-code/

Getting rid of util class
1) If the family of methods uses different parameters, depending on optional input or representations of the same input, then consider transforming the Helper via a fluent interface using the Builder pattern: from a collection of static methods like Helper.calculate(x), calculate(x, y), calculate(x, z), calculate(y, z) we could easily get to something like newBuilder().with(x).with(y).calculate(). The helper class would then offer behaviours, reduce its list of business methods and provide more flexibility for future extensions. Callers would then use it as internal field for reuse or instantiate it where needed. The helper class (as we knew it) disappeared.
2) If the helper class provides methods which are actually actions for different inputs (but, at this point, for the same domain), consider applying the Command pattern: the caller will actually create the required command (which will handle the necessary input and offer a behaviour) and an invoker will execute it within a certain context. You may get a command implementation for each static method and your code would move from an Helper.calculate(x, y), calculate(z) to something like invoker.calculate(new Action(x, y)). Bye bye helper class.
3) If the helper class provides methods for the same input but different logics, consider applying the Strategy pattern: each static method may easily become a strategy implementation, vanishing the need of its original helper class (replaced by a context component then).
4) If the given set of static methods concerns a certain class hierarchy or a defined collection of components, then consider applying the Visitor pattern: you may get several visitor implementations providing different visit methods which would probably replace partially or entirely the previously existing static methods.
5) If none of the above cases met your criteria, then apply the three most important indicators: your experience, your competences in the given project and common sense.

http://www.refactoringideas.com[..]-to-get-rid-of-helper-and-utils-classes/

Converting forloop to streaming - http://martinfowler.com/articles/refactoring-pipelines.html

Refactoring JavaScript from Sync to Async in Safe Baby-Steps - http://www.natpryce.com/articles/000812.html

code-refactoring-dos-donts - https://jaxenter.com/code-refactoring-dos-donts-135960.html

(google search) (amazon search)


Wed Jul 19 14:59:51 HKT 2017 From /weblog/design

packaging


Avoid circular dependencies between packages! http://www.infoq.com/news/2007/06/large-code-bases

2 common approach, by function or by layer - http://dolszewski.com/architecture/project-package-organization/

(google search) (amazon search)


Tue Jul 18 11:31:43 HKT 2017 From /weblog/design

comment


A nice thread of discussing how to comment in code - http://groups.yahoo.com/group/extremeprogramming/message/74195

A Taxonomy Of Comments - http://blog.codefx.org[..]hniques/documentation/taxonomy-comments/

Everything have 2 sides - http://blog.codefx.org[..]s/documentation/comments-costs-benefits/

Example of comment haven't update freq enough - http://marxsoftware.blogspot.hk[..]even-good-code-comments-deteriorate.html

https://testing.googleblog.com[..]health-to-comment-or-not-to-comment.html

(google search) (amazon search)


Sun Mar 19 10:25:58 HKT 2017 From /weblog/design

microservice


The Hidden Dividends of Microservices - http://queue.acm.org/detail.cfm?ref=rss&id=2956643

Best practices - http://www.infoq.com[..]constructing-micro-service-system-part03

http://basho.com/posts/technical/microservices-please-dont/

Compare using library / service - http://blog.jessitron.com/2017/01/dependencies.html http://www.infoq.com[..]cy-management-whether-library-or-service

(google search) (amazon search)


Thu Mar 09 23:13:09 HKT 2017 From /weblog/design

visibility


Someone saying that having private method is anti-pattern, here is the discussion - http://www.infoq.com/news/2008/01/private-methods-tdd-design

Discussion of encapsulation - http://niket-this.blogspot.com[..]/encapsulation-does-it-really-exist.html

My view on this is that most of the time there's little value in self-encapsulation. The value of encapsulation is proportional to the scope of the data access. Classes are usually small (at least mine are) so direct access isn't going to be an issue within that scope. Most accessors are simple assignments for the setter and retrieval for the getter, so there's little value in using them internally. - https://martinfowler.com/bliki/SelfEncapsulation.html

(google search) (amazon search)


Thu Feb 23 16:14:03 HKT 2017 From /weblog/design/interview

data


Interview with JOOQ founder - https://www.infoq.com/news/2017/02/data-geekery-releases-jooq-3-9

(google search) (amazon search)


Tue Feb 21 17:44:20 HKT 2017 From /weblog/design

dsl


A paper show the evolution of a DSL - http://www.mockobjects.com/files/evolving_an_edsl.ooplsa2006.pdf

A stock trading order example of DSL - http://debasishg.blogspot.com[..]05/designing-internal-dsls-in-scala.html

What is the difference between API / DSL if we don't write a parser for our language? From Martin Fowler's blog - http://martinfowler.com/bliki/DslReadings.html , it is mentioned:
Piers Cawley makes the point that a key characteristic of DSLs is their narrow focus on a domain.
I think this is a very good summary, usually if most of the APIs are getXXX() , setXXX(), loadXXX() , createXXX() ........ Then we mostly design APIs that expose low level detail to the API user to work on, which, is work but user probably work nicer if we can come up with language like API that allow users to do their work in more descriptive level.

I think if API design like that usually it will reduce the code duplication, what ever real duplication or conceptual duplication. It probably already apply "Tell, don't ask" style - http://c2.com/cgi/wiki?TellDontAsk

A discussion about applying "Tell, don't ask" which lead to message passing architecture - http://beautifulcode.oreillynet.com[..]07/10/do_messages_want_to_be_asynchr.php

And other discussion about "Tell, don't ask"
http://sriramnarayan.blogspot.com[..]/2008/11/demeters-law-tell-dont-ask.html
http://sriramnarayan.blogspot.com[..]part-two-demeters-law-tell-dont-ask.html
http://sriramnarayan.blogspot.com[..]rt-three-demeters-law-tell-dont-ask.html

One good sample with explaination -
http://hamletdarcy.blogspot.com[..]-it-really-domain-specific-language.html
http://nat.truemesh.com/archives/000727.html

Few links - http://dreamhead.blogbus.com/logs/17667876.html

From CRUD to DDD - http://www.udidahan.com[..]2/15/from-crud-to-domain-driven-fluency/

I like this: "XML abuse reduction (conducting an “XML Intervention”)" - http://www.lostechies.com[..]ps-internal-dsl-draft-outline-notes.aspx

DSL maybe the result of encapsulation - http://dreamhead.blogbus.com/logs/214225975.html

Excellent implementation of extending java yourself - http://www.infoq.com/presentations/JetBrains-MPS-DSL http://www.infoq.com/presentations/JetBrains-MPS-DSL-2

How DSL method named - http://tech.pro[..]he-java-fluent-api-designer-crash-course

https://tomassetti.me/domain-specific-languages/

(google search) (amazon search)


Thu Feb 16 00:03:22 HKT 2017 From /weblog/design/pattern

reactive


https://realm.io[..]ation-hugo-visser-rxjava-for-rest-of-us/

(google search) (amazon search)


Tue Feb 07 15:44:58 HKT 2017 From /weblog/design

performance


http://highscalability.com[..]6/big-list-of-20-common-bottlenecks.html

Nothing specific, mostly code clean up, refactoring and simplification, the performance boost was a surprise. <- This is a good one - http://bad-concurrency.blogspot.com.au[..]12/07/disruptor-v3-faster-hopefully.html

Is there anything we can do about this when designing algorithms and data-structures? Yes there is a lot we can do. If we perform chunks of work on data that is co-located, and we stride around memory in a predictable fashion, then our algorithms can be many times faster. For example rather than using bucket and chain hash tables, like in the JDK, we can employ hash tables using open-addressing with linear-probing. Rather than using linked-lists or trees with single items in each node, we can store an array of many items in each node. - http://mechanical-sympathy.blogspot.com.au[..]emory-access-patterns-are-important.html

Skip lists are used instead of b-trees because b-trees don’t scale. - http://highscalability.com[..]ast-mvcc-inmem-lockfree-codegen-and.html

Beware about the performance issue of static initalization - http://stackoverflow.com[..]-cause-problems-with-multi-threading-how

Experiment show why arraylist is better in most cases - http://www.javaadvent.com/2013/12/arraylist-vs-linkedlist.html

How to design low latency application in java - http://vanillajava.blogspot.com.au[..]5/chronicle-and-low-latency-in-java.html

http://highscalability.com[..]ciples-of-high-performance-programs.html http://blog.libtorrent.org[..]principles-of-high-performance-programs/

Suggestion about how to determine number of thread pool - http://venkateshcm.com[..]rmine-Web-Applications-Thread-Poll-Size/

Beware the performance penalty of logging - https://plumbr.eu/blog/locking-and-logging

Keep thing dynamic - http://highscalability.com[..]ciples-of-high-performance-programs.html

http://www.rationaljava.com[..]st-rule-of-performance-optimisation.html

http://www.eecs.berkeley.edu[..]u/~rcs/research/interactive_latency.html

http://highscalability.com[..]aling-data-platforms.html?SSLoginOk=true

Discuss about developing low latency financial application - http://queue.acm.org/detail.cfm?ref=rss&id=2770868

Discussion of object pooling - http://highscalability.com[..]-but-forgotten-trick-object-pooling.html http://coffeenco.de[..]m_performance_part_1_object_pooling.html

Efficiency - the amount of work you need to do.
Performance - how fast you can do that work
Efficiency - governed by your algorithm
Performance - governed by your data structures.
http://www.rationaljava.com[..]e-difference-between-efficiency-and.html


Turning off power save mode on the CPU reduced brought the max latency from 11 msec down to 8 msec.
Guaranteeing threads will always have CPU resources using CPU isolation and thread affinity brought the maximum latency down to 14 microseconds.
http://highscalability.com[..]eduler-jitter-using-cpu-isolation-a.html
http://epickrram.blogspot.co.uk[..]o.uk/2015/09/reducing-system-jitter.html

About design for performance for webapi - http://tech.forter.com[..]y-decision-as-a-service-design-patterns/

check list - http://techbeacon.com[..]ery-software-development-team-should-ask

Beware if system utilization over 80% - http://www.infoq.com/cn/news/2016/02/utilisation-wait-latency http://robharrop.github.io[..]/20/service-latency-and-utilisation.html

scalable-io-events-vs-multithreading-based - https://thetechsolo.wordpress.com[..]lable-io-events-vs-multithreading-based/

How to find out bottleneck - https://vanilla-java.github.io[..]entile-latencies-in-Chronicle-Queue.html

(google search) (amazon search)


Mon Jan 23 18:33:07 HKT 2017 From /weblog/design/concurrency

thread


Stealing thread - http://badamczewski.blogspot.com.au/2012/05/work-stealing.html

Intel Guide for Developing Multithreaded Applications - http://software.intel.com[..]or-developing-multithreaded-applications

Difference ways to stop a thread - http://www.ddj.com[..]ept_url=/hpc-high-performance-computing/

Interesting, I am not sure if I agree, but chrome ( which use fork ) are really cool in performance:
There’s another problem with Unix programming in Ruby that I’ll just touch on briefly: Java people and Windows people. They’re going to tell you that fork(2) is bad because they don’t have it on their platform, or it sucks on their platform, or whatever, but it’s cool, you know, because they have native threads, and threads are like, way better anyways.

Fuck that.

Don’t ever let anyone tell you that fork(2) is bad. Thirty years from now, there will still be a fork(2) and a pipe(2) and a exec(2) and smart people will still be using them to solve hard problems reliably and predictably, just like they were thirty years ago.

MRI Ruby people need to accept, like Python (you have seen multiprocessing, yes?), that Unix processes are one of two techniques for achieving reliable concurrency and parallelism in server applications. Threads are out. You can use processes, or async/events, or both processes and async/events, but definitely not threads. Threads are out.
http://tomayko.com/writings/unicorn-is-unix

1x1 win M*N - http://binkley.blogspot.com/2012/01/1-1-beats-n-m.html

Best number of threads:
N = number of CPUs
U = target CPU utilization (0 <= U <= 1)
W/C = ration of wait time to cpu time (measured through profiling)

threads = N * U * (1 + W/C) - http://www.ibm.com/developerworks/library/j-jtp0730.html http://stackoverflow.com[..]ratio-of-java-threads-to-cpus-on-solaris

Another post about tuning thread pool - http://www.javaadvent.com[..]ortance-of-tuning-your-thread-pools.html

Threads Basics - http://www.hpl.hp.com/techreports/2009/HPL-2009-259html.html http://www.hpl.hp.com/personal/Hans_Boehm/c++mm/threadsintro.html

The Dos and Don'ts of Multithreading - http://www.infoq.com/presentations/multithreading

https://www.infoq.com/articles/engstrand-microservice-threading

http://cbloomrants.blogspot.hk[..]-26-09-low-level-threading-table-of.html

(google search) (amazon search)


Tue Jan 17 23:09:08 HKT 2017 From /weblog/design

gc


https://blog.plan99.net[..]rbage-collection-911ef4f8bd8e#.wr03zaasu

(google search) (amazon search)


Tue Jan 17 22:58:18 HKT 2017 From /weblog/design

cache


5 Hints You're Using A Map When You Should Be Using a Cache? - http://dsoguy.blogspot.com[..]ints-your-using-map-when-you-should.html

How hibernate design the cache - http://www.javalobby.org/java/forums/t48846.html

Consider to do more careful update, not just update DB and dirty cache, but update DB and cache in a same time - http://dormando.livejournal.com/495593.html

Caching can be architectural smell, some hint and some alternative - http://www.codingthearchitecture.com[..]2/is_caching_an_architectural_smell.html

General caching discussion - http://tutorials.jenkov.com[..]are-architecture/caching-techniques.html http://www.infoq.com/cn/news/2017/01/Program-design-how-cache

http://highscalability.com[..]10-program-busting-caching-mistakes.html http://www.codeproject.com[..]B/web-cache/cachingmistakes.aspx?azid=74

(google search) (amazon search)


Wed Dec 07 18:48:22 HKT 2016 From /weblog/design

work with legacy


Simple ways to improve legacy code - http://www.onjava.com/lpt/a/4805

One approach to work with legacy code, instead of phrase by phrase or part by part, identify and improve the domain part first - http://gojko.net[..]-efforts-to-replace-legacy-systems-fail/

http://arne-mertz.de[..]egacy-applications-tests-modularization/

Note of common point for refactoring with legacy application - http://marxsoftware.blogspot.hk[..]/2016/10/unintentionally-obfuscated.html

(google search) (amazon search)


Tue Nov 29 00:12:57 HKT 2016 From /weblog/design/interview

Amazon


"They build their own infrastructure for performance, reliability, and cost control reasons. By building it themselves they never have to say Amazon went down because it was company X's fault. Their software may not be more reliable than others, but they can fix, debug, and deployment much quicker than when working with a 3rd party."

http://highscalability.com/amazon-architecture

Shel Kaphan - http://www.infoq.com/cn/articles/talk-with-amazon-shel-kaphan

(google search) (amazon search)


Tue Nov 15 10:53:50 HKT 2016 From /weblog/design

value object


Discussion of DTO - http://mrpmorris.blogspot.com/2009/01/data-transfer-objects.html

Discussion of value object - http://blog.joda.org/2014/03/valjos-value-java-objects.html http://martinfowler.com/bliki/ValueObject.html http://martinfowler.com/bliki/AliasingBug.html

(google search) (amazon search)


Tue Nov 15 10:49:25 HKT 2016 From /weblog/design/concurrency

concurrency


How to write safer concurrency code - http://www.artima.com/forums/flat.jsp?forum=276&thread=178345

reentrant and thread safe functions - http://kevinrodrigues.com[..]/31/reentrant-and-thread-safe-functions/

Libraries / toolkits for multicore process - http://www.ddj.com[..]intableArticle.jhtml?articleID=212900103

Introduction - http://www.ddj.com[..]QQSNDLRSKHSCJUNN2JVN?articleID=212903586 http://www.ddj.com[..]CQSNDLRSKHSCJUNN2JVN?articleID=213001517

Collections of links - http://dobbscodetalk.com[..]rallel-Or-Get-Left-Behind.html&Itemid=29

Briefing of difference modeling of threading system - http://www.ddj.com[..]intableArticle.jhtml?articleID=215900465 http://software.intel.com[..]inners-guide-to-multithreaded-libraries/

http://natishalom.typepad.com[..]haloms_blog/2010/08/concurrency-101.html

Saving the Failwhale: The Art of Concurrency (Page last updated December 2012, Added 2012-12-26, Author Dhanji R. Prasanna, Publisher informit). Tips:

1) Contention is unavoidable - some resources are just slower, and you must wait for them. The secrets to good concurrency are 1) ensuring that these slower resources are rarely used, and 2) during such waiting periods, giving the faster tiers other work to do so that they continue to be utilized well.
2) Overuse of synchronization constructs such as locks and mutexes leads to systems that perform poorly under load.
3) ConcurrentHashMap is an efficient thread-safe map while HashMap is not thread-safe.
4) ConcurrentHashMap doesn't do away with locks, it still uses them but it uses more than the single global lock, so that threads gain some measure of concurrency. It uses separate locks for partitions, so that multiple threads writing to the map are likely to access different partitions, using separate locks and therefore process their data simultaneously. This technique is known as lock-striping. Efficient striping uses a number of locks proportional to the number of CPU cores in a system.
5) The asynchronous processing model smooths resource spikes by adding requests to a queue which is serviced by a pool of workers - spikes in requests make the queue grow rather than overloading the workers. (The ExecutorService is essentially a thread pool accompanied by a task queue.)

http://www.informit.com/articles/article.aspx?p=1994789

Discussion of using difference model for concurrency - http://highscalability.com[..]cks-application-architecture-pros-a.html

Concurrency vs Parallelism - http://concurrencyfreaks.blogspot.hk[..]/2013/12/concurrency-vs-parallelism.html

Compare between Actors, CSP, Disruptor and raw Threads - http://java-is-the-new-c.blogspot.com.au[..]omparision-of-different-concurrency.html

Few coding tips that should be useful for most languages - http://www.javacodegeeks.com[..]erformance-scalability-and-liveness.html http://www.javacodegeeks.com[..]2015/09/java-concurrency-essentials.html

Service Design
Do one thing, do it well
No shared operational state
Bound your queues
Name custom thread pools and register an UncaughtExceptionHandler
Prefer immutable data objects over mutable state
http://highscalability.com[..]-to-25-billion-notifications-during.html

(google search) (amazon search)


Wed Nov 02 16:14:20 HKT 2016 From /weblog/design/pattern

retry


understanding-retry-pattern-with-exponential-back-off-and-circuit-breaker-pattern - http://rahulrajatsingh.com[..]al-back-off-and-circuit-breaker-pattern/

(google search) (amazon search)


Wed Nov 02 16:13:31 HKT 2016 From /weblog/design/concurrency

lock


10-ways-to-reduce-lock-contention-in-threaded-programs - http://www.thinkingparallel.com[..]ce-lock-contention-in-threaded-programs/

Discussion about lock the form and prevent 2 user edit it in the same time and currupt the object, what is the possible drawback. - http://www.dcmanges.com[..]-optimistic-locking-isnt-a-silver-bullet

futexes - http://en.wikipedia.org/wiki/Futex http://groups.google.com[..]ds/browse_thread/thread/3c3608a779dc6731

Spinning - http://www.1024cores.net[..]ome/lock-free-algorithms/tricks/spinning

Locks for rarely changed data, sound like good suggestion - https://groups.google.com[..]pic/comp.programming.threads/dyrbRKsj4gw

Try to use non-blocking approach if possible - http://mechanical-sympathy.blogspot.com[..]1/locks-condition-variables-latency.html

Concurrency without lock, and even without correctness? - http://splashcon.org/2011/program/dls/245-invited-talk-2

Single write principle - http://mechanical-sympathy.blogspot.com.au[..].au/2011/09/single-writer-principle.html

Comparing difference kind of locks again - http://concurrencyfreaks.blogspot.com.au[..]11/stampedlocktryoptimisticread-and.html

10-ways-to-reduce-lock-contention-in-threaded-programs - http://www.thinkingparallel.com[..]ce-lock-contention-in-threaded-programs/

(google search) (amazon search)