#orm


SQLAlchemy and Django

Published at March 29, 2019 ·  1 min read

将 Django orm 与 sqlalchemy 结合在一起使用的案例,通过 Django orm 维护 model,实现写以及一些简单的查询功能,然后通过 sqlalchemy 实现复杂的只读查询。django orm 虽然可以通过 extra 实现与原生 sql 语句的融合,但通过 sqlalchemy 的 join 查询相比于 rawl sql 更加安全些 SQLAlchemy and Django...


Advanced usage of prefetch_related and select_related in Django

Published at March 29, 2019 ·  1 min read

django orm 的优化策略,在存在外键且需要多级嵌套查询的情况下,使用 prefetch_related(‘first_model__second_model’) 的方式将多次查询集合成一次查询 Advanced usage of prefetch_related and select_related in Django...


Django orm optimization cheat sheet

Published at March 29, 2019 ·  1 min read

django orm 常见的优化措施,除了 count 和 exists 外,select_related prefetch_related 也很常用,其他的则是考虑 queryset 在哪些场景下是 cached 哪些不是,以节省内存及减少数据库查询。 Django orm optimization cheat sheet...




Django ORM

Published at March 21, 2019 ·  1 min read

关于 Django orm 的资源合集,如何优化 orm 的查询和 model 的设计 Django ORM...


Building High Performance Django Systems

Published at March 18, 2019 ·  1 min read

用 Django 打造高性能的服务器,对于 Django 的应用,性能的瓶颈主要集中在 database 层,因此这里主要涉及的是 Django 中 orm 的正确高效的用法 Building High Performance Django Systems...



Tags

abcs accept acid activemq affinity algorithm allocation android array async aws b+tree b-tree backoff benchmark best-practices bfs big-o bigquery bind bitcount blog break broker bubble buffer cache cap cert cgroups channel citus class classmethod cluster concurrency config consumer container cookie cors crawler cronjob csrf ctr data-science data-structure database datadog dataflow datascience decorator defer dfs distributed django dns docker double-shipping drf ecosia elastic-search enumerate epoll extra fabric2 facebook-pixel financial-report flask flutter forward-proxy freelance frontend frp garbage-collector gc gcp generator get gil git golang goroutine graphql ha handbook haproxy hash hash-slot hashring hashtable hpa http http-auth http-proxy http_proxy https index init innodb instagram intergration interview ios javascript jinja2 jobboard jwt k8s kafka kibana kqueue label lambda layer4 layer7 lean levels.io linked-list linux list listen loadbalancer logs long-tail lru marketing master matplotlib memory merge metaclass metaprogramming metrics metrics-server microservices mitm model mq myisam mysql namespace nat netflix network-extension nginx nodejs nomad nosql npm oodesign openssl optimization orm pandas parallelism paramiko parkinglot patroni permission pg pipeline pixelme post postgresql postresql prefetch_related prerender private-key process proxy proxycommand put pvm python queue rabbitmq rbac react-native reactjs rebase redis redis-cluster replication resource rest restfulapi retargeting retry revenue reverse-proxy rocketmq rsa saas scaleable search-engine security select seo serverless service session set shadosocks shadowsocks shard sharding shell shopify sigint signal sigterm slack slave slow-query sniper sns socket socks5 source-code spa sql sqlalchemy sqs ssh ssl ssl-pinning stack startup state stateful stateless staticmethod string struct swift switch syscall system-design systemctl tcp tcp-proxy thread tmpreaper token traefik trustkit tunning type typeform udp variable vc vpn vuejs web web-development where yarn zset 削峰 宽索引 异步 窄索引 解耦 跨域 跳板机


Archives

2019 (141)