Your SlideShare is downloading. ×
Tradeoffs of replacing core components
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Tradeoffs of replacing core components

515
views

Published on


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
515
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Tradeoffs of Replacing Core Components Andy Dai andy@dorm7.com Django Workshop 2014/1/21
  • 2. SHOULD I SWAP OUT DJANGO TEMPLATE/ORM?
  • 3. DON’T DO IT!
  • 4. WAIT! NOT REALLY! IT’S WORTH IF…
  • 5. YOU ARE OKAY WITH SACRIFICING ABILITY TO USE THIRD-PARTY DJANGO PACKAGES
  • 6. YOU HAVE NO PROBLEM GIVING UP THE POWERFUL DJANGO ADMIN
  • 7. YOU HAVE ALREADY ANALYZED YOUR OWN CODE TO FIND AND FIX THE ROOT CAUSES OF YOUR PROBLEMS
  • 8. YOU’VE EXPLORED ALL OTHER OPTIONS INCLUDING CACHING AND DENORMALIZATION
  • 9. YOU’RE VERY SURE THAT YOU’RE NOT OPTIMIZING PREMATURELY
  • 10. YOU’RE WILLING TO ACCEPT THE FACT THAT UPGRADING DJANGO WILL BE EXTREMELY PAINFUL
  • 11. THINK AGAIN!
  • 12. OK. SO YOU WANT TO USE DJANGO WITHOUT…
  • 13. “Django Admin” “Django Template” “Django ORM” “Django Third-Party Packages”
  • 14. AND YOU ADD SOME PACKAGES…
  • 15. “MongoEngine” “SQLAlchemy” “WTForms” “Jinja2”
  • 16. CONGRATULATION! YOU GOT FLASK!
  • 17. BUT ORM/TEMPLATE SUCKS…
  • 18. REPLACE ORM WITH NOSQL
  • 19. DO NOT DO THIS GUESS WEBSITE WILL GROW RAPIDLY
  • 20. IT’S OK IF…
  • 21. YOU HAVE TRIED CACHING, INDEX, QUERY OPTIMIZATION..
  • 22. YOU KNOW WHAT YOU ARE DOING
  • 23. REPLACE DJANGO TEMPLATE WITH JINJA2/MAKO
  • 24. DO NOT DO THIS LOGIC IN YOUR TEMPLATE
  • 25. IT’S OK IF THERE ARE SOME PAGES THAT
  • 26. ASK YOURSELF BEFORE REPLACING DJANGO TEMPLATE
  • 27. “Why you want to do this?” “Where’s the bottleneck?” “Cache?”
  • 28. DO IT ONLY WHEN YOU KNOW WHAT YOU ARE DOING
  • 29. ALWAYS USE THE RIGHT TOOL FOR THE RIGHT JOB
  • 30. “Premature optimization is the root of all evil” – Donald Knuth
  • 31. Django/Jinja2 Integration • Jingo - https://github.com/jbalogh/jingo • coffin - https://github.com/coffin/coffin/ • django-jinja - https://github.com/niwibe/django-jinja
  • 32. Replace Django ORM • SQLAlchemy - http://www.sqlalchemy.org/ • MongoEngine - http://mongoengine.org/
  • 33. THANKS!

×