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
Beyond the Prompt: Programming as a Pathway to Statistical Thinking
minecr
0
400
武藤の処世術を書いてみた
mutomasa
0
120
Book-keeping
bvr7352
0
110
私たちはなんでテストするんだっけ? Ver.東北IT物産展2026 in 会津若松
camel_404
3
200
Introduction - Lecture 1 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
3.4k
【デザイナー就活講座】 デザイナー就活市場・企業探し・ポートフォリオのポイント
koheihasebe
0
640
AI時代のセキュリティ監査
matshogo
PRO
0
120
Plano urbano de Madrid desde el Ensanche al s. XXI (2ª parte).
juanmartin2026
1
92k
実践プレゼンテーション・デザイン
dragon2
1
260
AIの力を100%引き出すために
frievea
0
540
新しいJavaを学んで・使っていこう! / osd26do
gishi_yama
0
260
第2部-高校生とAI活用/high-school2026-2
okana2ki
0
200
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
How to make the Groovebox
asonas
2
2.5k
The Curse of the Amulet
leimatthew05
3
15k
KATA
mclloyd
PRO
35
16k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
540
The agentic SEO stack - context over prompts
schlessera
0
940
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
540
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The Limits of Empathy - UXLibs8
cassininazir
1
690
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
Конец — Вопросы?