Category Archives: Architecture

Clean architecture pattern

The main idea is to have layers that only depend on inner layers (see the image below). Let’s imagine you have a repository that includes several applications. Layers Domain (Entities) Has basic types and interfaces for your application. Including the application config and Registry with all the interfaces. Optionally could also include some common logic …

Read more

Style guide for golang project file structure

Highly recommended. It has a couple of odds like not explaining about /test dir (I assume, they wanted to say to put there only e2e and other integrational tests, not unit-test as the latter should be kept together with the code itself in files like …_test.go). But it’s awesome in general. https://github.com/golang-standards/project-layout

Microservice architecture patterns

Why do you need a microservice architecture? Decrease blast radius of problems and increase flexibility. You want technology diversity in your company. You want to scale your app more granular according to consumer needs. You want newcomers to be productive earlier. You want your company structure to be mirrored with technical responsibilities (it’s mainly about …

Read more

MVC vs Flux

They are all architecture patterns. M is for model. It stores generic logic for the model like fields and calculations based on the fields like validation and stuff. V is for view. It just renders stuff and passes user interactions (events) to its controller via the controller’s API. C is for controller that ties models …

Read more

Принципы SOLID с примерами на php

Шпаргалка Принцип единственной ответственности (Single responsibility) «На каждый объект должна быть возложена одна единственная обязанность» Для этого проверяем, сколько у нас есть причин для изменения класса — если больше одной, то следует разбить данный класс. Принцип открытости/закрытости (Open-closed) «Программные сущности должны быть открыты для расширения, но закрыты для модификации» Для этого представляем наш класс как …

Read more

Формализованные языки для построения API

http://ru.wikipedia.org/wiki/IDL Самые интересные: Apache Thrift — http://en.wikipedia.org/wiki/Apache_Thrift Гугловый ProtoBuf — http://en.wikipedia.org/wiki/Protobuf Apache Avro — http://en.wikipedia.org/wiki/Apache_Avro. Сравнений этих IDL — тысячи, например: http://www.slideshare.net/IgorAnishchenko/pb-vs-thrift-vs-avro. Но всё-таки имеет смысл делать самому, а из перечисленных брать основные идеи. И самое главное тут — формализация, формализация и ещё раз формализация. Т.е. всё делать вложенными объектами, никаких структур, вперемешку болтающихся, как …

Read more

Fatcache от Twitter — memcache на SSD

https://github.com/twitter/fatcache/blob/master/notes/performance.md

Выступление Jan Jongboom из Cloud9 — «The Architect Way» на YAC-2012

http://events.yandex.ru/talks/300/ Презентация в pdf — http://download.yandex.ru/company/experience/yac2012/jongboom_yac_2012.pdf

Алгоритм конкатенации js-файлов для каждой страницы на лету

Хочется сделать один js-файл на страницу. Думаю над таким алгоритмом. Сразу после процедуры деплоя пользователи грузят кучу отдельных js-файлов, всё как обычно. Первый пользователь, зашедший на страницу, ставит lock в кэш (на 1 минуту), означающий, что именно ему повезло создать единый js-файл. При генерации страницы пути всех подключаемых js-файлов сохраняются в массивчик (у нас уже …

Read more

Подкасты, которые я слушаю

Javascript: The javascript show yayQuery PHP: Lately in PHP DevZone Ruby: The ruby show ASP/Windows (MS stack): Herding code Python: Пока в раздумьях, что бы послушать SQL: Пока в раздумьях, что бы послушать Остальные: The changelog FLOSS Weekly SitePoint Podcast Software Engineering Radio This Developer’s Life WebDevRadio