Migration from Postgres to MongoDB

Dmitry

Need better solution for migration.

Description: Service for user mail address verification.

Problem: Business logic stored in pl/pgSQL procedures in Postgres.

Steps:

1. Insert into table user Email address and randomly generated hash

2. Send verification/confirmation Email with URL path and hash argument

3. Recv HTTP request with hash:
    hash equals - Update record: CONFIRMED, return success
    hash not found - Return error

4. Send response (error or success HTML page)

Details with servlet logic (Steps 3,4):

-Servlet call pl/pgSQL procedure with received hash as argument

-Postgres stored procedure doing:
  SELECT record by hash
  if FOUND
    DELETE temporary hash data
    UPDATE email address as verified
    return FOUND
  if NOT_FOUND
    return NOT_FOUND

-Servlet return success or fail HTML page.

As I think, with mongoDB migration, I need move some logic from pl/pgSQL procedures to java Servlet.

Is it right?

Dmitriy Sorochenkov

Yes, you are right.

Do not store application logic in the database. There are performance limitations to running JavaScript inside of MongoDB.

http://docs.mongodb.org/manual/tutorial/store-javascript-function-on-server/

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

从Postgres迁移到MongoDB

来自分类Dev

Rails Migration更改列以使用Postgres数组

来自分类Dev

将 Postgres 逐行迁移到 MongoDB

来自分类Dev

postgres return json from a function

来自分类Dev

Postgres对FROM子句的无效引用

来自分类Dev

python manage.py migration不会在postgres数据库中进行任何更改

来自分类Dev

Docker差异postgres:12 from postgres:12-alpine

来自分类Dev

Nodejs应用程序中的Mongodb vs Postgres

来自分类Dev

Starting a postgres database server from a data file

来自分类Dev

SELECT * FROM NEW TABLE在Postgres中等效

来自分类Dev

为什么使用IS DISTINCT FROM-Postgres

来自分类Dev

postgres抛出COPY FROM的语法错误

来自分类Dev

为什么使用IS DISTINCT FROM-Postgres

来自分类Dev

通过节点进行MongoDB查询返回可见结果,但Postgres不这样做吗?

来自分类Dev

建立3D模型资料库-最好是MySql / Postgres / MongoDB

来自分类Dev

Postgres查询中的“对表的FROM子句条目的无效引用”

来自分类Dev

根据其他查询的结果对Postgres UPDATE FROM设置值

来自分类Dev

How to use postgres AVG() function with order clause from Rails

来自分类Dev

在postgres中的FROM子句中使用FETCH

来自分类Dev

Postgres中基本SELECT * FROM x查询的奇怪结果

来自分类Dev

带有查询的postgres声明没有FROM子句

来自分类Dev

how to take a single record from an arraylist in mongodb

来自分类Dev

如何使用两个数据库系统(MongoDB/Postgres)在网站中存储不同的数据

来自分类Dev

Getting the elements from Collection MongoDB using Golang and mgo

来自分类Dev

How to retrieve image files from mongodb to html page

来自分类Dev

MongoDB聚合查询与MySQL SELECT字段1 FROM表

来自分类Dev

sequelize migration not working

来自分类Dev

Rails Migration Order and Git

来自分类Dev

使用Postgres COPY FROM时如何转换十六进制字符?

Related 相关文章

  1. 1

    从Postgres迁移到MongoDB

  2. 2

    Rails Migration更改列以使用Postgres数组

  3. 3

    将 Postgres 逐行迁移到 MongoDB

  4. 4

    postgres return json from a function

  5. 5

    Postgres对FROM子句的无效引用

  6. 6

    python manage.py migration不会在postgres数据库中进行任何更改

  7. 7

    Docker差异postgres:12 from postgres:12-alpine

  8. 8

    Nodejs应用程序中的Mongodb vs Postgres

  9. 9

    Starting a postgres database server from a data file

  10. 10

    SELECT * FROM NEW TABLE在Postgres中等效

  11. 11

    为什么使用IS DISTINCT FROM-Postgres

  12. 12

    postgres抛出COPY FROM的语法错误

  13. 13

    为什么使用IS DISTINCT FROM-Postgres

  14. 14

    通过节点进行MongoDB查询返回可见结果,但Postgres不这样做吗?

  15. 15

    建立3D模型资料库-最好是MySql / Postgres / MongoDB

  16. 16

    Postgres查询中的“对表的FROM子句条目的无效引用”

  17. 17

    根据其他查询的结果对Postgres UPDATE FROM设置值

  18. 18

    How to use postgres AVG() function with order clause from Rails

  19. 19

    在postgres中的FROM子句中使用FETCH

  20. 20

    Postgres中基本SELECT * FROM x查询的奇怪结果

  21. 21

    带有查询的postgres声明没有FROM子句

  22. 22

    how to take a single record from an arraylist in mongodb

  23. 23

    如何使用两个数据库系统(MongoDB/Postgres)在网站中存储不同的数据

  24. 24

    Getting the elements from Collection MongoDB using Golang and mgo

  25. 25

    How to retrieve image files from mongodb to html page

  26. 26

    MongoDB聚合查询与MySQL SELECT字段1 FROM表

  27. 27

    sequelize migration not working

  28. 28

    Rails Migration Order and Git

  29. 29

    使用Postgres COPY FROM时如何转换十六进制字符?

热门标签

归档