From per-customer deployment
To a single deployment
class User:
def __init__(self):
self.tweets = []
self.followers = []
self.followees = []
def tweet(self, tweet):
self.tweets.append(tweet)
def follow(self, other):
self.followees.append(other)
other.followers.append(self)
def timeline(self):
for followee in self.followees:
for tweet in followee.tweets:
yield tweet
class User:
def __init__(self):
self.tweets = []
self.followers = []
self.followees = []
self.timeline = []
def tweet(self, tweet):
self.tweets.append(tweet)
for follower in self.followers:
follower.timeline.append(tweet)
def follow(self, other):
self.followees.append(other)
other.followers.append(self)
for tweet in other.tweets:
self.timeline.append(tweet)
Denormalization loops are needed:
What happens when user A starts following user B at about the same time when user B tweets T?
def tweet(self, tweet):
self.tweets.append(tweet)
for follower in self.followers:
follower.timeline.append(tweet)
def follow(self, other):
self.followees.append(other)
other.followers.append(self)
for tweet in other.tweets:
self.timeline.append(tweet)
A follows B
B tweets T
The Problem is not SaaS
Business Logic
Data
Programming Language
Business Logic
Programmer
User
What:
Web Server
Database
Where:
How:
Who:
Business Logic
Data
Programming Language
Business Logic
Programmer
User
What:
Web Server
Database
Where:
How:
Who:
=
=
=
=
Instead of being a heirarchy:
PL → BL → Data
Can they be placed side by side?
Software library, not an interpreter...
Data using BL as a software library?
Reminder: There's a demo at the end...
follows(A, B)→
tweeted(B, T)→
timeline(A, B, T)
follows(A, B)→
tweeted(B, T)→
timeline(A, B, T)
+
follows(alice, bob)
tweeted(bob, T)→
timeline(alice, bob, T)
+
tweeted(bob, "Hello")
tweeted(bob, T)→
timeline(alice, bob, T)
timeline(alice, bob, "Hello")
Yeh, but deductive databases are practically dead for 20 years...
So, what's next?