Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Без ОРМ
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Deep Refactoring
October 26, 2017
Education
0
450
Без ОРМ
https://youtu.be/mb6-NHMzSkY
Deep Refactoring
October 26, 2017
Tweet
Share
More Decks by Deep Refactoring
See All by Deep Refactoring
Поворот на 90°
deeprefactoring
0
140
Card Payments 101
deeprefactoring
0
130
Звонки на стероидах
deeprefactoring
0
120
Make Time
deeprefactoring
0
91
Learn-to-Rank или как научить бездушную машину хорошо искать
deeprefactoring
0
180
Уменьшаем количество рефлексии в коде
deeprefactoring
1
95
Прикладная кодогенерация для Java разработчика
deeprefactoring
0
440
Пишем игровой навык для Алисы Яндекс с помощью Excel
deeprefactoring
0
190
Подружиться с исключениями. Иван Гришаев, Exoscale
deeprefactoring
0
190
Other Decks in Education
See All in Education
Analysis and Validation - Lecture 4 - Information Visualisation (4019538FNR)
signer
PRO
0
2.6k
Gitの仕組みと用語 / 01-b-term
kaityo256
PRO
0
220
青森県の人口減少について | | 下山学園高等学校
aomori6
PRO
0
120
160人の中高生にAI・技術体験の講師をしてみた話
shuntatoda
1
410
Gluon Recruit Deck
gluon
0
160
Lenguajes de Programacion (Ingresantes UNI 2026)
robintux
0
150
Modelamiento Matematico (Ingresantes UNI 2026)
robintux
0
260
2025-12-19-LT
takesection
0
120
From Participation to Outcomes
territorium
PRO
0
400
Introduction - Lecture 1 - Advanced Topics in Big Data (4023256FNR)
signer
PRO
2
2.3k
Surviving the surfaceless web
jonoalderson
0
740
Highest and Best Use: Development Considerations for Land Sites
rmccaic
0
160
Featured
See All Featured
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
160
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
250
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
160
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Making the Leap to Tech Lead
cromwellryan
135
9.8k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
250
Raft: Consensus for Rubyists
vanstee
141
7.4k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
780
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
700
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
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
Конец — Вопросы?