New product/feature:
New installations of main product:
Technical improvements:
Extract generic code
Put it into a separate modules => Adapt your deployment process for fast-moving internal dependencies
Use a single, coherent visual design:
Deploy an efficient Single-Sign-On solution:
Concept:
Also works for websites
=> Django receives a REMOTE_USER HTTP header
Loosely coupled, isolated module:
Avoid rewriting the whole module before splitting:
At first, avoid conforming to a strict REST API:
Important points:
Don't trust the frontend:
You'll go through several iterations of the API.
Avoid complex migrations:
- Deploy client compatible with old and new contract
- Deploy server with both old and new contract
- Ask client to switch to new contract
- Deploy client and server without old contract
Simpler:
Choose your protocol:
Three layers:
Required features:
Options:
Required features:
Options:
Required features:
Provided by the implementation:
Options:
Recommended technologies:
Start with a simple stack:
HTTP transport, JSON serialization, JSON-RPC/REST-like protocol
Move to a more efficient stack for scaling/perf:
ZeroMQ/AMQP transport, Protobuf serialization, <missing> protocol
Ensure that the role of each service is clear:
Is it the only source for some data, and must be queried every time?
=> High availability required
Is it an authoritative datastore, cached by client services?
=> Don't forget cache invalidation and automatic synchronization
New challenges:
Critical service: progressive upgrade
=> Play with load-balancers
Seldom used backends: up to you
Client services: progressive upgrade
=> Ensure you're still compatible with your upstream services
Small changes: deploy new server then new clients
=> Needs more steps for strict schemas
Big changes: increase the API version number (new code path)
=> Monitor old service for non-upgraded clients
Upgrades to various libraries:
Security
=> Deploy as soon as possible
New major features
=> Integrate to a new major upgrade
Minor improvements
=> For the next minor upgrade
Release often, if only to upgrade dependencies
Full range of tests:
Different levels:
Server-side contracts
=> Proper input validation
Isolated clients
=> Runs faster
Full-system tests
=> Most accurate
Solution?
django-shareddb: offload all DB operations to a single thread
=> Wrap LiveServerTestCase tests in transactions!
But:
Prototype: fire / djfire.
Release: soon!
Example:
class MyRemoteTest(fire_tests.FireTestCase): fire_servers = { 'proj': '../../remote.sock', } def test_user_factory(self): proj = self.fire_remotes['proj'] auth_factories = proj.module('django_fact.factories') auth_models = proj.module('django.contrib.auth.models') user = auth_factories.UserFactory() user2 = auth_models.User.objects.get() self.assertEqual(user, user2) self.assertEqual(0, user2.groups.count())
Table of Contents | t |
---|---|
Exposé | ESC |
Full screen slides | e |
Presenter View | p |
Source Files | s |
Slide Numbers | n |
Toggle screen blanking | b |
Show/hide slide context | c |
Notes | 2 |
Help | h |