Your SlideShare is downloading. ×
0
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
Multi tenancy with PostgreSQL
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

Multi tenancy with PostgreSQL

5,511

Published on

Watch the talk at http://www.youtube.com/watch?v=XuQfXQYUsgY&feature=share&list=PL0mVjsUoElSE4GBZEiogUeJLyvgzdb1N7

Watch the talk at http://www.youtube.com/watch?v=XuQfXQYUsgY&feature=share&list=PL0mVjsUoElSE4GBZEiogUeJLyvgzdb1N7

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

No Downloads
Views
Total Views
5,511
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
52
Comments
0
Likes
3
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. Multi-tenancy with PostgreSQL
  • 2. Requirements
  • 3. Three waysbit.ly/msn-multitenant-arch
  • 4. Shared Database, Shared Namespace
  • 5. Separate Databases
  • 6. Shared Database,Separate Namespace
  • 7. hasschemas
  • 8. hasnamespaces
  • 9. Guy Naor on Multi-tenancyhttp://bit.ly/guy-naor-multitenant-2009
  • 10. App
  • 11. carding.app.com/products/1-grapes
  • 12. SET SEARCH_PATH = carding
  • 13. cardingSELECT * FROM productswhere id = 1;
  • 14. Common Tables
  • 15. "public"
  • 16. cardingSELECT * FROM public.invoiceswhere tenant_id = 1;
  • 17. Apartmentgithub.com/bradrobertson/apartment
  • 18. bob.sqlcardingalice.sql
  • 19. carding
  • 20. carding assimo
  • 21. assimo
  • 22. Storeygithub.com/ramontayag/storey
  • 23. Gotchas
  • 24. Problem: Testing● transactions do not play well with schemas
  • 25. Answer: Testing● in tests, treat the public schema as a tenant
  • 26. Problem: Migrations● migrate every schema
  • 27. Answer: Apartment/Storey● loops through the namespaces and migrates each one
  • 28. Problem: Background Jobs● how do the workers know which schema contains the data?
  • 29. Answer: Pass schema name ● Pass the schema name along with the rest of the job arguments
  • 30. Questions?

×