Generating gRPC Service from Postgres Database [IDEA]

blov · · 549 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Hi, I once started a project to generate a gRPC service from a given database, generating server side code for existing tables, views and stored procedures. I made something but it is primitive. What do you think about it? I am always tired of writing database code and do not like using ORMs that get in the way too much, and I thought having a gRPC service, It can be helpful for multi language use case or deploying it infront of a database and possibly providing a layer for security / isolation. What do you think? If I complete this project, would that be useful? I actually like writing stored procedures, and having the most of the DB logic in one place would be helpful, but what can be downsides of this approach?</p> <p><a href="https://github.com/mustafaakin/gopqgen">https://github.com/mustafaakin/gopqgen</a></p> <hr/>**评论:**<br/><br/>natefinch: <pre><p>That looks pretty cool, though I&#39;m not sure you&#39;re going to convince people to start making a lot of functions in their database.</p></pre>mustafaakin: <pre><p>Yeah, me neither :)</p></pre>earthboundkid: <pre><p>What&#39;s the value this provides over connecting to the database as a database? Adding an adapter layer has to make things slower. What does the slowness buy you? &#34;Easier to work with than an ORM&#34;—maybe but then why are you using Postgres if your objects aren&#39;t relational? Just use a key-value store to store serialized objects. </p></pre>natefinch: <pre><p>It&#39;s an API. On top of your database. So that other people can generate a client in whatever gRPC-supported language they like, and access it without needing to hand code a bunch of sql interaction, or set up a whole ORM etc.</p></pre>mustafaakin: <pre><p>Yeah, it will definetely be slower, but how much? Most of my applications can tolerate that, they are not that high performant. Also, I can write custom stored procedures that can make use of relations and aggregations etc. so it is a little different from just key-value stores.</p> <p>Actually, my whole point is to write the logic as stored procedures so that you call your functions.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

549 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传