To be Default iOS Search Engine, How Much Do Google Have To Pay Apple?

A lucrative deal between Apple and Google is in the United States Justice Department’s target. The deal itself is as part of one of the U.S. Government’s largest antitrust cases, reports The New York Times.

On Tuesday, the Justice Department filed an antitrust lawsuit against Google. Claiming that the Mountain View-based company used anticompetitive and exclusionary practices in the search and advertising markets to maintain an unlawful monopoly.

In a 2017 agreement, Apple updated on its devices to keep Google’s search engine as the preselected option. The New York Times reports that Google pays Apple estimated 8 to 12 billion dollars per year in exchange for making its search engine as default on Apple devices and services. This might be the single Google’s biggest payment that it makes to anyone. And to Apple, it accounts for 14 to 21 percent of itss annual profits.

.

Apple and Google

The deal from Apple and Google is claimed that is representative of illegal tactics used to protect Google’s monopoly and stifle competition. According to the Justice Department, the traffic comes from Apple devices takes almost one half of Google’s search traffic; and the prospect of losing the agreement has been described as “terrifying” and a “code red” scenario within the company. Due to Google’s system of ads, search traffic is integral to its business model.

Apple is likewise coming under fire for facilitating anticompetitive behavior by acquiescing to the deal and extracting more money with regular renegotiations. Although the two companies are competitors in Silicon Valley; the agreement is to be part of “an unlikely union of rivals.”

The legal intervention poses a damage to a significant chunk of Apple’s revenue. But for Google, it is a bigger danger. Google seemingly have no way to replace the traffic it would lose. And may be, Apple will acquire or build its own search engine, which could in turn pose an even greater threat to Google.


Read more:

Adele Shows Off American Accent in ‘SNL’ Promo With Kate McKinnon

John Rambo will be joining to fight for Earthrealm in Mortal Kombat 11

Sức mạnh của Index trong Database

Việc nghe nói về tác dụng của Index trong quá trình Turning Database nói chung và Oracle nói riêng từ rất lâu. Việc cảm nhận thấy được tốc độ truy vấn, các chỉ số liên quan tới quá trình Turning như I/O… trong quá trình thực thi thấy rất rõ ràng. Những việc này mình thấy được do những người khác chỉ, bản thân thấy được trước và sau quá trình người khác đánh Index để sử dụng. Về tầm quan trọng và sức mạnh của Index trong Database là không cần bàn cãi.

Vừa rồi mình có phải build một luồng nghiệp vụ hoàn toàn mới cho một quy trình nghiệp vụ mới. Cụ thể là mỗi một khách hàng mới cần phải có một mã OTP để nhắn tin xác thực số điện thoại. Mã OTP là ngẫu nhiên, có thể là chữ hoặc số.
Sau khi phân tích và họp, hệ thống sẽ sinh trước mã OTP. Mỗi mã OTP gồm 5 ký tự có thể có cả chữ hoặc số. Toàn bộ các mã OTP này được sinh ra và lưu vào 1 bảng, hàng ngày hệ thống sẽ quét các khách hàng mới và tiến hành cập nhật ngẫu nhiên vào bảng này. Bảng này sẽ có (10+26)(10+26)(10+26)(10+26)(10+26) = 60 triệu dòng.
Hàng ngày có dưới 1000 khách hàng mới nên hệ thống xử lý cũng hơi chậm nhưng không có gì đáng ngại khi lấy ngẫu nhiên các mã OTP để cập nhật khách hàng, lấy ngẫu nhiên mỗi mã OTP mất hơn 1s.

Nhưng hôm vừa rồi, hệ thống cần đồng bộ gần 100.000 khách hàng mới vào và cũng có yêu cầu xác thực nên phải lấy ngẫu nhiên từng đó mã OTP. Việc này khi chạy thì đúng là không ổn chút nào. Nếu để chạy bình thường thì phải vài ngày mới có thể chạy xong, như vậy không đảm bảo tiến độ. Tình thế này buộc mình phải xem lại phương thức lấy ngẫu nhiên mã OTP. Vì không muốn thay đổi quy tắc lấy ngẫu nhiên nên mình tập trung vào tối ưu câu truy vấn. Khi kiểm tra độ phức tạp và I/O của câu lệnh lấy thì mình thấy việc lấy mã OTP rất nặng. Phải thôi, lấy ngẫu nhiên 1 trong 60 triệu dòng mà phải loại đi những mã OTP đã qua sử dụng thì khá nặng rồi.
Mình kiểm tra thì đúng là mình chưa đánh Index cho bảng này, thế là việc đầu tiên mình tiến hành đánh Index và đo lại thì hiệu quả thật không ngờ. Tốc độ lấy mã OTP của một khác hàng giảm xuống còn ~0.0016s. Mình chạy cho 100.000 khách hàng mất chưa tới 3 phút là xong. Công việc hàng ngày khoảng 1000 khách hàng thì chưa tới 2s đã chạy xong.

Sử dụng Index còn cần phải quan tâm đến quá trình Insert, Update dữ liệu. Nhưng hệ thống mình thì trường đánh Index này chỉ sinh ra một lần và không có thao tác update vào trường Index nên không phải quan tâm đến nó. Sau việc này đúng là mình đã thực sự bị thuyết phục bởi sức mạnh của Index trong Database. Bài học sau này cần vận dụng nhiều hơn tới Index trong quá trình triển khai hệ thống.

Monorepos vs Multilrepos

Lang thang trên mạng tự nhiên gặp bài viết này [1] nên tò mò xem Momorepos là gì? Sau đó tìm hiểu thêm google thì có bài viết [2] [3] [4] giải thích và cho ví dụ khá rõ ràng.

Thì ra nó liên quan đến việc quản lý mã nguồn của dự án. Trước đây mình không để ý lắm nên không biết phân biệt giữa 2 khái niệm này. Khi dùng SVN thì công ty mình dùng theo kiểu Monorepos(mặc dù chưa biết đến thuật ngữ đó), nghĩa là có một Repository duy nhất được tạo ra, các dự án khác nhau đều tống chung vào đó, mỗi dự án là một thư mục được tạo ra. Tất nhiên vẫn phân quyền được bình thường theo từng thư mục.

Sau này khi chuyển sang Gitlab cùng với việc phát triển Microservice nên trên Gitlab mỗi một project thì đều tạo Repository riêng cho nó. Tương đương trên github mình làm các project nhỏ nhỏ khác cũng như vậy.

Sơ sơ thì mỗi cái lại có ưu và nhược điểm nhưng thấy nhiều ý kiến cho rằng đối với Startup và Công ty lớn ưa chuộng việc dùng Monorepos hơn như Google, Facebook…

[1]: https://medium.com/@hoangbkit/why-monorepo-in-2018-89221acd4bfb
[2]: https://www.reddit.com/r/devops/comments/8vgqhq/what_do_you_prefer_and_why_mono_repo_or_multiple/
[3]: https://www.atlassian.com/git/tutorials/monorepos
[4]: https://medium.com/@patrickleet/mono-repo-or-multi-repo-why-choose-one-when-you-can-have-both-e9c77bd0c668

Config send email from oracle database server

ORA-24247: network access denied by access control list (ACL)

Kiểm tra bằng cách chạy câu lệnh

select * from dba_network_acls;

Nếu có data dạng:

 HOST LOWER_PORT UPPER_PORT ACL  ACLID
 mail.vstv.vn    1   1024    /sys/acls/send_mail.xml D285E04B69B942688587AB8FE5B41C69 

Chạy câu lệnh này:

BEGIN
   DBMS_NETWORK_ACL_ADMIN.create_acl (
     acl          => 'send_mail.xml',
     description  => 'Purpose of the acl is to send mail',
     principal    => 'INTRANET',
     is_grant     => TRUE,
     privilege    => 'connect',
     start_date   => SYSTIMESTAMP,
     end_date     => NULL);
 DBMS_NETWORK_ACL_ADMIN.assign_acl (
     acl         => 'send_mail.xml',
     host        => 'mail.trituenhantao.info',
     lower_port  => 1,
     upper_port  => 1024);
 COMMIT;
 END;

Plugin Compare for Notepad++

Before, I usually using SVN to find the different points of version source code. But recently, I don’t use SVN or Source Code Management Tools other. Today, I can find the difference of a package Oracle with version before we upgrade.
I was recommended using plugin Compare for Notepad++ to work this it. It is perfect for me.

We has two ways to install Plugin Compare for Notepad++:
1: Install from Plugin Manager
Choice menu Plugins -> Plugins Admin…
Search: Compare and tick on Compare. Click Install.
After that, dialog display Notepad++ is about to exit ask confirm Notepad++ will restart to Apply plugin.
2: Install from package dowload
Dowload the last version Compare Plugin on link: https://sourceforge.net/projects/npp-compare/
Unzip file dowloaded, we have file ComparePlugin.dll
Choice Settings -> Import -> Import plugin(s)… Select the file ComparePlugin.dll

To compare, we open two file and select Plugins -> Compare -> Compare
Or press Alt + D