Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Без ОРМ
Search
Deep Refactoring
October 26, 2017
Education
480
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Без ОРМ
https://youtu.be/mb6-NHMzSkY
Deep Refactoring
October 26, 2017
More Decks by Deep Refactoring
See All by Deep Refactoring
Поворот на 90°
deeprefactoring
0
140
Card Payments 101
deeprefactoring
0
140
Звонки на стероидах
deeprefactoring
0
140
Make Time
deeprefactoring
0
100
Learn-to-Rank или как научить бездушную машину хорошо искать
deeprefactoring
0
200
Уменьшаем количество рефлексии в коде
deeprefactoring
1
100
Прикладная кодогенерация для Java разработчика
deeprefactoring
0
460
Пишем игровой навык для Алисы Яндекс с помощью Excel
deeprefactoring
0
210
Подружиться с исключениями. Иван Гришаев, Exoscale
deeprefactoring
0
210
Other Decks in Education
See All in Education
Visionary Initiative: Future Intelligence — Laying the foundations for the future of science, intelligence, and society | Science Tokyo
sciencetokyo
PRO
0
300
私たちはなんでテストするんだっけ? Ver.東北IT物産展2026 in 会津若松
camel_404
3
190
Fundamentos, Caracteristicas y Aplicaciones de los Modulos NumPy , Matplotlib y Pandas
robintux
0
250
FA26 CLU MS Clinical Psychology New Student Orientation
jdbedics
0
170
[2026前期火5] 論理学(京都大学文学部 前期 第8回)「正規化定理の証明」
yatabe
0
320
The Strengthening Institutions Program
territorium
PRO
0
170
면접관 눈에 띄는 데이터 분석 포트폴리오 만드는 법 | 2026년 5월 세미나
datarian
0
1.1k
Beyond the Prompt: Programming as a Pathway to Statistical Thinking
minecr
0
350
Carbohydrates: Classification, Structure & Chemical Properties
pawan5505
0
220
[2026前期火5] 論理学(京都大学文学部 前期 第14回)「計算は、証明ではない——ハルシネーションを三層ハーモニーで診る」
yatabe
0
250
An Experiment in "Cross-Cultural Exchange" as a Method for Content Creation
naoji_taniguchi_ksk_0827
0
160
2026年度春学期 統計学 第10回 分布の推測とは - 標本調査,度数分布と確率分布 (2026. 6. 4)
akiraasano
PRO
0
210
Featured
See All Featured
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
570
Become a Pro
speakerdeck
PRO
31
6.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Testing 201, or: Great Expectations
jmmastey
46
8.3k
Utilizing Notion as your number one productivity tool
mfonobong
4
580
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Deep Space Network (abreviated)
tonyrice
0
300
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
320
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
WCS-LA-2024
lcolladotor
0
820
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
980
Transcript
Без ORM Иван Гришаев, 2017
Википедия is a technique for converting data between incompatible type
systems using object-oriented programming languages.
ORM, например
Что дает — абстракция над БД — упрощает процесс разработки
— объектность™
В реальности — абстракции (чаще всего) зло — база меняется
редко (и болезненно) — коллекции > объекты
SQL — создан до ООП — декларативный — не-Тьюринг полный
— решает задачи
Задача о переводе SQL в объекты... — неразрешима в принципе!
— сравнима с трансляцией языков
Примерная сложность SEL/INS/UPD/DEL + (на этом пора заканчивать) INNER/LEFT JOIN
++ WITH RECURSIVE ++++ JSON(b) ++++++++ GIS ++++++++++++++ FULLTEXT SEARCH ++++++++++++++++++++++++++++ ...
Проблемы — ORM системы сложны — внутренние API не документированы
— не спасают от raw SQL
Боязнь raw SQL — доменный язык (как HTML, CSS) —
ООП-код растет — неэффективная работа с БД
None
None
Эти ваши объекты
К чему приводит ORM — Боязнь (незнание) SQL — Хрупкость
базы — Лишний ОО-код — ORM-specific bugs
К чему приводит ORM — Зависимость — Нечитаемые запросы —
Трудно понять, что на выходе
None
None
None
None
А если будет тормозить? — Сперва добейся! — Конфигурация —
Железо — Меньше кода
Вам не нужны объекты — опасные property — нужны удобные
структуры — и функции для работы с ними — Clojure, Go, Rust
Что предлагаешь? — Построители запросов — Запросы из структур данных
— SQL-шаблоны — Генерация функций
Построители запросов
Запросы из структур данных
SQL templates
Наш проект — PostgreSQL, JDBC/Clojure — 70 таблиц — до
15 join-ов в запросах — GIS, JSONb — рекурсивные запросы
None
SQL templates
HugSQL, YeSQL — Один *.sql файл — Clojure, JS, Python,
PHP, Perl, Go, C#, Erlang, Ruby
Конец — Вопросы?