RSS feed [root] /design /weblog




login:

password:

title search:




 


Sun Oct 01 16:19:43 HKT 2017

design



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

Wed Nov 22 00:28:10 HKT 2017 From /weblog/design

functional


Having functional program in java? http://codemonkeyism.com/functional-programming/

Functional programming in old java, with eclipse template - http://www.javacodegeeks.com[..]functional-programming-with-map-and.html

Functional Programming For The Rest of Us - http://www.defmacro.org/ramblings/fp.html?

collection-pipeline - http://martinfowler.com/articles/collection-pipeline/

Make code composable - https://hackernoon.com[..]ical-functional-programming-6d7932abc58b

(google search) (amazon search)


Thu Nov 16 09:55:26 HKT 2017 From /weblog/design

static


I will prefer using static method as less as possible... there is some
side effect you are not expected, like, are you sure it thread safe? static
method easier to have thread problem.

You may take a look at http://debasishg.blogspot.com[..]007/03/making-classes-unit-testable.html , http://www.beust.com/weblog/archives/000173.html and http://discuss.joelonsoftware.com[..]Parent=7972&ixDiscussGroup=3&cReplies=29

Parameter passing vs static accessor: Should I press things around or get from public static instance? - http://groups.yahoo.com/group/refactoring/message/3342

Reason of static method is not overrided - http://groups.google.com[..]thread/ec8b924d60dd4734/99b488aa1f8106c9

Another example of thread problem with static member - http://jroller.com[..]=calendar_dateformat_and_multi_threading

How to mock static method code for testing - http://blog.xebia.com/2007/06/21/mocking-static-calls/

http://googletesting.blogspot.com[..]ic-methods-are-death-to-testability.html

Factory is bad? - http://www.yegor256.com/2017/11/14/static-factory-methods.html

(google search) (amazon search)


Mon Nov 13 00:44:30 HKT 2017 From /weblog/design

API design guideline


This is a message from a management blog, but I think the arguement is also apply API design. In fact, I think most critical difference of good and bad API is knowing which small detail is important and which is not - http://www.goodproductmanager.com[..]er.com/2007/11/08/sweat-the-small-stuff/

Design tips:
http://www.artima.com/weblogs/viewpost.jsp?thread=142428
http://openide.netbeans.org/tutorial/api-design.html
http://www.cincomsmalltalk.com[..]gView?showComments=true&entry=3258158706
http://today.java.net[..]its-of-highly-profitable-developers.html
http://www.infoq.com/news/2007/08/why-api-design-matters
http://www.infoq.com/presentations/effective-api-design
http://neuroning.com/2006/11/19/on-api-design-guidelines

About Compatibility issues
http://wiki.eclipse.org/Evolving_Java-based_APIs

A blog of using interfaces-vs-abstract-classes
http://hoskinator.blogspot.com[..]6/04/interfaces-vs-abstract-classes.html

XOM design overview - http://www.xom.nu/designprinciples.xhtml#d0e309

You need to identify the business value but not pick any tools/design just because it is cool - http://myarch.com/what-is-good-soa

A lot of links here - http://kasparov.skife.org/blog-live/src/api-design-refs.writeback http://discuss.joelonsoftware.com/default.asp?design.4.527465

An introduction of good OSS project to study their source - http://techkriti.wordpress.com[..]com/2007/06/28/learning-from-the-source/

CCCCDPIPE - http://blog.objectmentor.com/articles/2007/08/02/which-came-first

Discussion of why getting feedback quick is important - http://blog.objectmentor.com[..]u-dont-know-until-you-take-the-next-step

Someone saying that routines is the greatest invention in CS, I agree - http://www.codinghorror.com/blog/archives/001129.html

New way of modeling system then layering, The Onion Architecture - http://jeffreypalermo.com/blog/the-onion-architecture-part-1/

SOLID - http://www.lostechies.com[..]of-the-month-march-solid-principles.aspx http://dotnet.dzone.com/news/solid-software-works <-- very good picture! http://www.blackwasp.co.uk/SOLIDPrinciples.aspx

Idempotent, Orthogonality, Immutability - http://www.codinghorror.com/blog/archives/001244.html

Some example of how to driven good API - http://jdegoes.squarespace.com[..]al/2009/5/11/good-api-design-part-3.html

It's not enough to write tests for an API you develop, you have to write unit tests for code that uses your API. When you do, you learn first-hand the hurdles that your users will have to overcome when they try to test their code independently. http://butunclebob.com[..]MichaelFeathers.TheGoldenRuleOfApiDesign

Active interface vs. Passive interface, for me this is another way to under "Tell, don't ask" - http://code-o-matic.blogspot.com[..]-on-api-design-call-stack-as-source.html

The Principles of Good Programming - http://www.artima.com/weblogs/viewpost.jsp?thread=331531

http://net.tutsplus.com[..]software-principles-you-must-understand/

Difference choice of how API evolute with change - http://blog.jooq.org[..]sive-api-evolution-with-java-interfaces/

JUnit's evolving structure. - http://edmundkirwan.com/general/junit.html

API performance contract - http://queue.acm.org/detail.cfm?ref=rss&id=2576968

Consistent naming conventions
Standard terminology
Uniform error responses
Attention to detail (that’s the love part for APIs)
REST APIs that work with only 2 resources and use 4 HTTP verbs (oh, there is so much more to talk about here…)
Avoid API design by way of method-driven approach – that leads you down a slippery slope
- See more at: http://blogs.ancestry.com[..]are-like-parenting/#sthash.Ux1LHMNU.dpuf

http://blog.jooq.org[..]ake-this-mistake-when-developing-an-spi/

Guideline for webapi - https://cloud.google.com/apis/design/

(google search) (amazon search)


Wed Nov 08 00:48:02 HKT 2017 From /weblog/design/examples

netflix


https://medium.com[..]ens-every-time-you-hit-play-3a40c9be254b

(google search) (amazon search)


Sun Oct 01 16:19: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

Putting comments in code: the good, the bad, and the ugly. - https://medium.freecodecamp.org[..]e-good-the-bad-and-the-ugly-be9cc65fbf83

(google search) (amazon search)


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)


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)