digoal
2017-11-07
PostgreSQL , 在线机器学习 , 流式机器学习 , pipelinedb , plr , plpython , madlib
pipelinedb 是一款基于PostgreSQL的SQL接口的流式数据库,数据处理吞吐量大,同时能使用PostgreSQL的内置强大功能。
对用户来说,可以省掉很多开发成本,使用pipelinedb以及plpython或plr语言,实现流式的机器学习,流式的数据处理。
pipelinedb作为流式数据处理平台,plpython和plr作为处理逻辑代码,写在pipelinedb数据库中。
例子:
1、定义数据流格式
create stream s1 (id int, content jsonb);
2、定义数据处理逻辑代码
create or replace function ml_func1(jsonb) returns text as $$
-- python代码
$$ language plpythonu strict;
或
create or replace function ml_func1(jsonb) returns text as $$
-- R代码
$$ language plr strict;
3、定义流式计算视图
createa continue view cv1 as select id, ml_func1(content) from s1;
4、通过SQL查询cv1得到流式计算的结果
select * from cv1 where ....;
https://www.postgresql.org/docs/10/static/plpython.html
https://github.com/postgres-plr/plr
《流计算风云再起 - PostgreSQL携PipelineDB力挺IoT》
您的愿望将传达给PG kernel hacker、数据库厂商等, 帮助提高数据库产品质量和功能, 说不定下一个PG版本就有您提出的功能点. 针对非常好的提议,奖励限量版PG文化衫、纪念品、贴纸、PG热门书籍等,奖品丰富,快来许愿。开不开森.