TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Communication Logs: Handling 250M SMS messages a day

27 pointsby Parsecoover 9 years ago

4 comments

Cieplakover 9 years ago
They mention using Neo4j instead of a relational database. Recently I needed to implement a friendship data model, and started off using Neo4j because it seemed like the best tool for the task, but ended up using essentially the following model in Postgres:<p><pre><code> CREATE TABLE friendship ( person1 INT NOT NULL, person2 INT NOT NULL, PRIMARY KEY (person1, person2), CHECK (person1 &lt; person2) ); CREATE INDEX friendship_person2 ON friendship(person2); CREATE VIEW friendship_view AS SELECT person1 AS person, person2 AS friend FROM friendship UNION SELECT person2 AS person, person1 AS friend FORM friendship; </code></pre> taken from here: <a href="http:&#x2F;&#x2F;www.postgresql.org&#x2F;message-id&#x2F;20141111201127.d80b6bc4c2a6970a6b941dec@potentialtech.com" rel="nofollow">http:&#x2F;&#x2F;www.postgresql.org&#x2F;message-id&#x2F;20141111201127.d80b6bc4...</a><p>What do you folks think? It seems like this would be the densest way to store the relationship, using the checked constraint trick with the IDs so you don&#x27;t need duplicate records to store Alice and Bob&#x27;s friendship as {A -&gt; B, B -&gt; A} if the friendship is inherently bidirectional (vs a followed&#x2F;follower model), and doesn&#x27;t preclude one from storing the data in another isomorphic structure that might be optimized for specific queries. I&#x27;m sure it&#x27;s possible to replicate this with Neo4j, but it felt cumbersome programming that in Java versus expressing that in SQL. But I&#x27;d really like to use Neo4j in an OLTP environment, but still haven&#x27;t had enough of an impetus yet because WITH RECURSIVE in postgres works well if the recursion depth is capped.
评论 #10749895 未加载
gue5tover 9 years ago
Worst-case, you&#x27;d have to process input at a sustained rate of (140×250×1000000)&#x2F;(24×3600) = 405093 B&#x2F;s.<p>I certainly hope your system can manage 400kBps throughput.
评论 #10749854 未加载
评论 #10749857 未加载
pbreitover 9 years ago
What&#x27;s Infobip pricing for numbers and SMS in US?
elcctover 9 years ago
Nice work, but to be fair 250M msgs per day is not at all impressive.