HackMD
    • Sharing Link copied
    • /edit
    • View mode
      • Edit mode
      • View mode
      • Book mode
      • Slide mode
      Edit mode View mode Book mode Slide mode
    • Note Permission
    • Read
      • Only me
      • Signed-in users
      • Everyone
      Only me Signed-in users Everyone
    • Write
      • Only me
      • Signed-in users
      • Everyone
      Only me Signed-in users Everyone
    • More (Comment, Invitee)
    • Publishing
    • Commenting Enable
      Disabled Forbidden Owners Signed-in users Everyone
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Invitee
    • No invitee
    • Options
    • Versions
    • Transfer ownership
    • Delete this note
    • Template
    • Save as template
    • Insert from template
    • Export
    • Google Drive Export to Google Drive
    • Gist
    • Import
    • Google Drive Import from Google Drive
    • Gist
    • Clipboard
    • Download
    • Markdown
    • HTML
    • Raw HTML
Menu Sharing Help
Menu
Options
Versions Transfer ownership Delete this note
Export
Google Drive Export to Google Drive Gist
Import
Google Drive Import from Google Drive Gist Clipboard
Download
Markdown HTML Raw HTML
Back
Sharing
Sharing Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
More (Comment, Invitee)
Publishing
More (Comment, Invitee)
Commenting Enable
Disabled Forbidden Owners Signed-in users Everyone
Permission
Owners
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Invitee
No invitee
   owned this note    owned this note      
Published Linked with
Like BookmarkBookmarked
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# Rentea db Spec Data model: - ![](https://g0vhackmd.blob.core.windows.net/g0v-hackmd-images/upload_76a119891ea1c9a115aa4e64706fb508) - Raw House - 從租屋網站取得的每一筆租屋資料 - 裡面可能有多筆資料都指向同一個租屋位置 - 例如 591 網站: 因為其推銷機制,爬蟲會取得多筆重複的租屋資料 - Unique House - 將 Raw House 的資料做整理,去除重複的租屋資料 - 重複的定義方式: 兩筆租屋資料中每一個欄位都擁有相同的內容 - 重複的實作方式: 在 SELECT query 的 WHERE 後面加入所有比較的欄位,看看是否能找出一筆資料,如果有就代表重複 - House Meta - 需求: 因為網站上的租屋資料可能和實際看屋情況不同,所以讓使用者能夠 feed back 描述實際的租屋、看屋情況 - Filtered House - 需求: 使用者透過分類功能,搜尋所有擁有相同分類的租屋資料 - 實作: 可能在後端去除重複資料之後,將資料新增到 Unique House 時也要根據分類新增到 Filtered House。 - Search Filter - 需求: 列舉所有分類項目,Filtered House 中的分類項目來自於這個資料表 - 疑問: 分類是由誰來新增? 或是我們自己決定有幾種分類項目? - User - 需求: 讓使用者登入並且使用相關功能,例如提供租屋資訊回饋 - 實作: - 使用電子郵件登入,需要電子郵件驗證 - 使用社群網站登入 - 帳號密碼登入 - 忘記密碼 ## API ### Internal API (For Crawler) ### Public API (For Client) ## Goal: 1. 處裡 Raw House/Unique House 在 Insert/Update/Delete 之間的交互邏輯 2. 讓 crawler、api server(future work) 有共同的介面可以重用 - crawler 用 rentea-db 塞資料、更新資料 - api server 用 rentea-db 撈資料(?) ddio 表示在 https://github.com/g0v/tw-rental-house-data 處裡過在更新時,比對不同欄位、確定新增 unique house 的邏輯 rentea-db 這一邊就抄起來,再補齊刪除的部分 - 然後決定要用哪種 DB! - MySQL: - 一開始線上聚會討論的結果,想要穩定的話是比較好的選擇 - PostgreSQL 一票! - Elasticsearch: - 雖然擁有儲存功能,但是本質上還是一個搜尋引擎,沒有保證 ACID 中的 Durability 所以會有掉資料的問題。有詢問過 ddio 並表示,雖然爬蟲每天都會撈租屋資料回來,但還是無法接受會遺失的情況,每次遺失都只能等到明天後再將資料補回,這樣可能太慢了。 - 混用: - 資料庫使用 MySQL,配合 Elasticsearch 輔助搜尋 - 其他: - 前端有一個需求是在地圖上畫圈,然後搜尋圈內所有租屋資料。所以希望資料庫支援多邊形(Polygon)搜尋 ## High Level Tasks - 先來搞懂目前的 tw-rental-house-data 架構 - https://rentalhouse.g0v.ddio.io/about-data-set/0.2/#住宅與重複物件過濾條件 - https://github.com/g0v/tw-rental-house-data/blob/af583ef91aab6927698d381b3bc0b36965cdfad2/backend/rental/libs/filters.py 判斷是否為同一筆 House Data 的 filter,因為 tw-rental-house-data 會每次全爬所有的資料 -

Import from clipboard

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lost their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.


Upgrade

All
  • All
  • Team
No template.

Create a template


Upgrade

Delete template

Do you really want to delete this template?

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

Sign in via GitHub

New to HackMD? Sign up

Help

  • English
  • 中文
  • 日本語

Documents

Tutorials

Book Mode Tutorial

Slide Example

YAML Metadata

Resources

Releases

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions

Versions

Upgrade now

Version named by    

More Less
  • Edit
  • Delete

Note content is identical to the latest version.
Compare with
    Choose a version
    No search result
    Version not found

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.